From 423ff4c52320921e38e3856717383c4673479210 Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Wed, 4 Oct 2023 23:46:38 +0200 Subject: [PATCH] [chore] Build and publish application hosted in the repository for the Python instrumentation E2E test (#2095) * Build and publish the Python E2E image Signed-off-by: Israel Blancas * Fix archs Signed-off-by: Israel Blancas * Fix the tags Signed-off-by: Israel Blancas * Fix the tags Signed-off-by: Israel Blancas * Use reusable workflow Signed-off-by: Israel Blancas * Fix workflow name Signed-off-by: Israel Blancas --------- Signed-off-by: Israel Blancas --- .../publish-autoinstrumentation-e2e-images.yaml | 5 +++++ tests/instrumentation-e2e-apps/python/Dockerfile | 7 +++++++ tests/instrumentation-e2e-apps/python/app.py | 10 ++++++++++ tests/instrumentation-e2e-apps/python/requirements.txt | 1 + 4 files changed, 23 insertions(+) create mode 100644 tests/instrumentation-e2e-apps/python/Dockerfile create mode 100644 tests/instrumentation-e2e-apps/python/app.py create mode 100644 tests/instrumentation-e2e-apps/python/requirements.txt diff --git a/.github/workflows/publish-autoinstrumentation-e2e-images.yaml b/.github/workflows/publish-autoinstrumentation-e2e-images.yaml index 3acdd22fa2..eda942370e 100644 --- a/.github/workflows/publish-autoinstrumentation-e2e-images.yaml +++ b/.github/workflows/publish-autoinstrumentation-e2e-images.yaml @@ -23,6 +23,11 @@ jobs: with: language: golang platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le + python: + uses: ./.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml + with: + language: python + platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le java: uses: ./.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml with: diff --git a/tests/instrumentation-e2e-apps/python/Dockerfile b/tests/instrumentation-e2e-apps/python/Dockerfile new file mode 100644 index 0000000000..e6558779b8 --- /dev/null +++ b/tests/instrumentation-e2e-apps/python/Dockerfile @@ -0,0 +1,7 @@ +FROM python:alpine3.18 + +COPY requirements.txt . +RUN pip install -r requirements.txt +COPY app.py . + +ENTRYPOINT ["flask", "run", "-p", "8080"] diff --git a/tests/instrumentation-e2e-apps/python/app.py b/tests/instrumentation-e2e-apps/python/app.py new file mode 100644 index 0000000000..32a35d6938 --- /dev/null +++ b/tests/instrumentation-e2e-apps/python/app.py @@ -0,0 +1,10 @@ +from flask import Flask + +app = Flask(__name__) + +@app.route('/') +def index(): + return "Hi" + +if __name__ == "__main__": + app.run(host='0.0.0.0') diff --git a/tests/instrumentation-e2e-apps/python/requirements.txt b/tests/instrumentation-e2e-apps/python/requirements.txt new file mode 100644 index 0000000000..cc35792f29 --- /dev/null +++ b/tests/instrumentation-e2e-apps/python/requirements.txt @@ -0,0 +1 @@ +Flask==2.3.3 \ No newline at end of file