diff --git a/1-intermediate-images/pyod/Dockerfile b/1-intermediate-images/pyod/Dockerfile new file mode 100644 index 0000000..23269e7 --- /dev/null +++ b/1-intermediate-images/pyod/Dockerfile @@ -0,0 +1,14 @@ +FROM ghcr.io/timeeval/python3-base:0.3.0 + +LABEL maintainer="sebastian.schmidl@hpi.de" + +# install pyod library and cleanup afterwards +RUN set -eux; \ + pip install --no-cache-dir pyod==0.9.2; \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -rf /tmp/* /var/tmp/* ~/.cache/pip diff --git a/1-intermediate-images/pyod/LICENSE b/1-intermediate-images/pyod/LICENSE new file mode 100644 index 0000000..739212c --- /dev/null +++ b/1-intermediate-images/pyod/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Phillip Wenig and Sebastian Schmidl + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/1-intermediate-images/pyod/version.txt b/1-intermediate-images/pyod/version.txt new file mode 100644 index 0000000..9325c3c --- /dev/null +++ b/1-intermediate-images/pyod/version.txt @@ -0,0 +1 @@ +0.3.0 \ No newline at end of file diff --git a/1-intermediate-images/python3-torch/Dockerfile b/1-intermediate-images/python3-torch/Dockerfile new file mode 100644 index 0000000..f7cd7ba --- /dev/null +++ b/1-intermediate-images/python3-torch/Dockerfile @@ -0,0 +1,5 @@ +FROM ghcr.io/timeeval/python3-base:0.3.0 + +LABEL maintainer="phillip.wenig@hpi.de" + +RUN pip install --no-cache-dir torch==1.7.1 diff --git a/1-intermediate-images/python3-torch/LICENSE b/1-intermediate-images/python3-torch/LICENSE new file mode 100644 index 0000000..739212c --- /dev/null +++ b/1-intermediate-images/python3-torch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Phillip Wenig and Sebastian Schmidl + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/1-intermediate-images/python3-torch/version.txt b/1-intermediate-images/python3-torch/version.txt new file mode 100644 index 0000000..0d91a54 --- /dev/null +++ b/1-intermediate-images/python3-torch/version.txt @@ -0,0 +1 @@ +0.3.0 diff --git a/1-intermediate-images/timeeval-test-algorithm/Dockerfile b/1-intermediate-images/timeeval-test-algorithm/Dockerfile new file mode 100644 index 0000000..66fab63 --- /dev/null +++ b/1-intermediate-images/timeeval-test-algorithm/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/timeeval/python3-base:0.3.0 + +LABEL maintainer="phillip.wenig@hpi.de" + +ENV ALGORITHM_MAIN=/app/algorithm.py + +COPY manifest.json /app/ +COPY algorithm.py /app/ diff --git a/1-intermediate-images/timeeval-test-algorithm/LICENSE b/1-intermediate-images/timeeval-test-algorithm/LICENSE new file mode 100644 index 0000000..739212c --- /dev/null +++ b/1-intermediate-images/timeeval-test-algorithm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Phillip Wenig and Sebastian Schmidl + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/1-intermediate-images/timeeval-test-algorithm/algorithm.py b/1-intermediate-images/timeeval-test-algorithm/algorithm.py new file mode 100644 index 0000000..d4da8a0 --- /dev/null +++ b/1-intermediate-images/timeeval-test-algorithm/algorithm.py @@ -0,0 +1,41 @@ +import numpy as np +import pandas as pd +import json +import time +import argparse +import sys + + +class AlgorithmArgs(argparse.Namespace): + @property + def ts(self) -> np.ndarray: + dataset = pd.read_csv(self.dataInput) + return dataset.values[:, 1:-1] + + @staticmethod + def from_sys_args() -> 'AlgorithmArgs': + args = json.loads(sys.argv[1]) + return AlgorithmArgs(**args) + + +def main(): + args = AlgorithmArgs.from_sys_args() + will_raise = args.customParameters.get("raise", False) + sleep_seconds = args.customParameters.get("sleep", 10) + write_preliminary_results = args.customParameters.get("write_prelim_results", False) + + results = np.zeros(args.ts.shape[0]) + + if write_preliminary_results: + results.tofile(args.dataOutput, sep="\n") + + if will_raise: + raise Exception("from within") + + time.sleep(sleep_seconds) + + results.tofile(args.dataOutput, sep="\n") + + +if __name__ == "__main__": + main() diff --git a/1-intermediate-images/timeeval-test-algorithm/manifest.json b/1-intermediate-images/timeeval-test-algorithm/manifest.json new file mode 100644 index 0000000..1235b33 --- /dev/null +++ b/1-intermediate-images/timeeval-test-algorithm/manifest.json @@ -0,0 +1,37 @@ +{ + "title": "timeeval-test-algorithm", + "description": "Test algorithm image for TimeEval.", + "inputDimensionality": "multivariate", + "version": "0.3.0", + "authors": "Sebastian Schmidl, Phillip Wenig", + "language": "Python", + "type": "Detector", + "mainFile": "algorithm.py", + "learningType": "unsupervised", + "executionStep": { + "parameters": [ + { + "name": "raise", + "type": "bool", + "defaultValue": false, + "optional": "true", + "description": "Force the algorithm to raise an exception and return a non-zero exit-code." + }, + { + "name": "sleep", + "type": "int", + "defaultValue": 10, + "optional": "true", + "description": "Controls the duration of the algorithm 'processing' via sleeping for a certain amount of time before writing the results." + }, + { + "name": "write_prelim_results", + "type": "bool", + "defaultValue": false, + "optional": "true", + "description": "If the algorithm should write some results before raising an exception or sleeping." + } + ], + "modelInput": "none" + } +} diff --git a/1-intermediate-images/tsmp/Dockerfile b/1-intermediate-images/tsmp/Dockerfile new file mode 100644 index 0000000..2603bb0 --- /dev/null +++ b/1-intermediate-images/tsmp/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/timeeval/r-base:0.3.0 + +LABEL maintainer="sebastian.schmidl@hpi.de" + +# install tsmp library and cleanup afterwards +RUN set -eux; \ + R -e 'install.packages("tsmp")'; \ + find /usr/lib/R/library -depth \ + \( \ + -type d -a \( -name doc -o -name html \) \ + \) -exec rm -rf '{}' +; \ + rm -rf /tmp/* /var/tmp/* diff --git a/1-intermediate-images/tsmp/LICENSE b/1-intermediate-images/tsmp/LICENSE new file mode 100644 index 0000000..739212c --- /dev/null +++ b/1-intermediate-images/tsmp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Phillip Wenig and Sebastian Schmidl + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/1-intermediate-images/tsmp/version.txt b/1-intermediate-images/tsmp/version.txt new file mode 100644 index 0000000..9325c3c --- /dev/null +++ b/1-intermediate-images/tsmp/version.txt @@ -0,0 +1 @@ +0.3.0 \ No newline at end of file