diff --git a/tools/profiler/config.json b/tools/profiler/config.json index ec7a64e2d..a52027d83 100644 --- a/tools/profiler/config.json +++ b/tools/profiler/config.json @@ -1,4 +1,32 @@ [ + { + "yaml-location": "./yamls/compression/kn-compression-python-txt.yaml", + "predeployment-commands": [ + "kubectl apply -f ./yamls/compression/compression-database.yaml" + ], + "postdeployment-commands": [] + }, + { + "yaml-location": "./yamls/compression/kn-compression-python-img-1.yaml", + "predeployment-commands": [ + "kubectl apply -f ./yamls/compression/compression-database.yaml" + ], + "postdeployment-commands": [] + }, + { + "yaml-location": "./yamls/compression/kn-compression-python-img-2.yaml", + "predeployment-commands": [ + "kubectl apply -f ./yamls/compression/compression-database.yaml" + ], + "postdeployment-commands": [] + }, + { + "yaml-location": "./yamls/compression/kn-compression-python-vid.yaml", + "predeployment-commands": [ + "kubectl apply -f ./yamls/compression/compression-database.yaml" + ], + "postdeployment-commands": [] + }, { "yaml-location": "./yamls/aes-nodejs/kn-aes-nodejs-10-10.yaml", "predeployment-commands": [], diff --git a/tools/profiler/yamls/compression/compression-database.yaml b/tools/profiler/yamls/compression/compression-database.yaml new file mode 100644 index 000000000..b42a588d6 --- /dev/null +++ b/tools/profiler/yamls/compression/compression-database.yaml @@ -0,0 +1,74 @@ +# MIT License + +# Copyright (c) 2024 EASE lab + +# 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. + + +## Database ---------- +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: compression-database + namespace: default +spec: + selector: + matchLabels: + app: compression-database + template: + metadata: + labels: + app: compression-database + spec: + containers: + - name: database + image: docker.io/vhiveease/mongodb + ports: + - containerPort: 27017 + +--- +apiVersion: v1 +kind: Service +metadata: + name: compression-database + namespace: default +spec: + type: ClusterIP + selector: + app: compression-database + ports: + - name: database + port: 27017 + targetPort: 27017 + +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: init-compression-database +spec: + template: + spec: + containers: + - name: init-compression-database + image: docker.io/vhiveease/compression-init-database:latest + args: + - --db_addr=mongodb://compression-database:27017 + restartPolicy: Never \ No newline at end of file diff --git a/tools/profiler/yamls/compression/kn-compression-python.yaml b/tools/profiler/yamls/compression/kn-compression-python-img-1.yaml similarity index 96% rename from tools/profiler/yamls/compression/kn-compression-python.yaml rename to tools/profiler/yamls/compression/kn-compression-python-img-1.yaml index 4e61f8291..7f18cb776 100644 --- a/tools/profiler/yamls/compression/kn-compression-python.yaml +++ b/tools/profiler/yamls/compression/kn-compression-python-img-1.yaml @@ -38,7 +38,8 @@ spec: - --function-endpoint-url=0.0.0.0 - --function-endpoint-port=50051 - --function-name=compression-python - - --value=metamorphosis.txt + - --value=img1.jpg + - --profile-function=true - image: docker.io/vhiveease/compression-python:latest args: - --addr=0.0.0.0 diff --git a/tools/profiler/yamls/compression/kn-compression-python-img-2.yaml b/tools/profiler/yamls/compression/kn-compression-python-img-2.yaml new file mode 100644 index 000000000..263383e3b --- /dev/null +++ b/tools/profiler/yamls/compression/kn-compression-python-img-2.yaml @@ -0,0 +1,46 @@ +# MIT License + +# Copyright (c) 2024 EASE lab + +# 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. + +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: compression-python + namespace: default +spec: + template: + spec: + containers: + - image: docker.io/vhiveease/relay:latest + ports: + - name: h2c + containerPort: 50000 + args: + - --addr=0.0.0.0:50000 + - --function-endpoint-url=0.0.0.0 + - --function-endpoint-port=50051 + - --function-name=compression-python + - --value=img2.jpg + - --profile-function=true + - image: docker.io/vhiveease/compression-python:latest + args: + - --addr=0.0.0.0 + - --port=50051 diff --git a/tools/profiler/yamls/compression/kn-compression-python-txt.yaml b/tools/profiler/yamls/compression/kn-compression-python-txt.yaml new file mode 100644 index 000000000..b4116166d --- /dev/null +++ b/tools/profiler/yamls/compression/kn-compression-python-txt.yaml @@ -0,0 +1,46 @@ +# MIT License + +# Copyright (c) 2024 EASE lab + +# 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. + +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: compression-python + namespace: default +spec: + template: + spec: + containers: + - image: docker.io/vhiveease/relay:latest + ports: + - name: h2c + containerPort: 50000 + args: + - --addr=0.0.0.0:50000 + - --function-endpoint-url=0.0.0.0 + - --function-endpoint-port=50051 + - --function-name=compression-python + - --value=helloworld.txt + - --profile-function=true + - image: docker.io/vhiveease/compression-python:latest + args: + - --addr=0.0.0.0 + - --port=50051 diff --git a/tools/profiler/yamls/compression/kn-compression-python-vid.yaml b/tools/profiler/yamls/compression/kn-compression-python-vid.yaml new file mode 100644 index 000000000..40d5057f2 --- /dev/null +++ b/tools/profiler/yamls/compression/kn-compression-python-vid.yaml @@ -0,0 +1,46 @@ +# MIT License + +# Copyright (c) 2024 EASE lab + +# 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. + +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: compression-python + namespace: default +spec: + template: + spec: + containers: + - image: docker.io/vhiveease/relay:latest + ports: + - name: h2c + containerPort: 50000 + args: + - --addr=0.0.0.0:50000 + - --function-endpoint-url=0.0.0.0 + - --function-endpoint-port=50051 + - --function-name=compression-python + - --value=video1.mp4 + - --profile-function=true + - image: docker.io/vhiveease/compression-python:latest + args: + - --addr=0.0.0.0 + - --port=50051