Skip to content

Commit

Permalink
implement python injection test matrix [APMON-1544] (#3186)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler authored Oct 9, 2024
1 parent 94aba8d commit 521c3eb
Show file tree
Hide file tree
Showing 25 changed files with 301 additions and 4 deletions.
18 changes: 17 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,23 @@ onboarding_python:
ONBOARDING_FILTER_WEBLOG: [test-app-python-container,test-app-python-alpine]
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT]
- ONBOARDING_FILTER_ENV: [dev, prod]
ONBOARDING_FILTER_WEBLOG: [test-app-python,test-app-python-container,test-app-python-alpine]
ONBOARDING_FILTER_WEBLOG: [
test-app-python,
test-app-python-container,
test-app-python-alpine,
test-app-python-alpine-libgcc,
test-app-python-container-3.7,
test-app-python-container-3.8,
test-app-python-container-3.9,
test-app-python-container-3.10,
test-app-python-container-3.11,
test-app-python-container-3.12,
test-app-python-container-3.7-alpine,
test-app-python-container-3.9-alpine,
test-app-python-container-3.10-alpine,
test-app-python-container-3.11-alpine,
test-app-python-container-3.12-alpine,
]
SCENARIO: [INSTALLER_AUTO_INJECTION]
- ONBOARDING_FILTER_ENV: [dev, prod]
ONBOARDING_FILTER_WEBLOG: [test-app-python]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.10-alpine
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.10-alpine/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.10
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.10/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.11-alpine
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.11-alpine/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.11
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.11/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.12-alpine
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.12-alpine/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.12
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.12/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.7-alpine
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.7-alpine/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.7
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.7/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.8
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.8/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.9-alpine
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.9-alpine/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
weblog:
name: test-app-python-container-3.9
exact_os_branches: [ubuntu24]
install:
- os_type: linux
copy_files:
- name: copy-container-run-script
local_path: utils/build/virtual_machine/weblogs/common/create_and_run_app_container.sh
- name: copy-docker-compose-file
local_path: utils/build/virtual_machine/weblogs/common/docker-compose.yml
- name: copy-python-app
local_path: lib-injection/build/docker/python/dd-lib-python-init-test-django
- name: copy-python-app-dockerfile
local_path: utils/build/virtual_machine/weblogs/python/test-app-python-container-3.9/Dockerfile.template

remote-command: sh create_and_run_app_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.10-alpine

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.10

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.11-alpine

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.11

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.12-alpine

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.12

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.7-alpine

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.7

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.8

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.9-alpine

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM public.ecr.aws/docker/library/python:3.9

ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE django_app
WORKDIR /src
ADD . /src
RUN pip install django
EXPOSE 18080
CMD python -m django runserver 0.0.0.0:18080
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lang_variant:
name: Ruby_3_0_2
version: 3.0.2
cache: true
install:
install:
- os_type: linux
os_distro: deb
remote-command: |
Expand Down Expand Up @@ -33,7 +33,7 @@ weblog:

copy_files:
- name: copy-ruby-app
local_path: lib-injection/build/docker/ruby/lib_injection_rails_app
local_path: lib-injection/build/docker/ruby/lib_injection_rails_app

- name: copy-service
local_path: utils/build/virtual_machine/weblogs/common/test-app.service
Expand Down
8 changes: 7 additions & 1 deletion utils/virtual_machine/virtual_machine_provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def remove_unsupported_machines(
for vm in required_vms:
installations = config_data["weblog"]["install"]
allowed = False
if "exact_os_branches" in config_data["weblog"]:
if vm.os_branch not in config_data["weblog"]["exact_os_branches"]:
logger.stdout(f"WARNING: Removed VM [{vm.name}] due to weblog directive in exact_os_branches")
vms_to_remove.append(vm)
continue

# Exclude by vm_only_branch
if vm_only_branch and vm.os_branch != vm_only_branch:
logger.stdout(f"WARNING: Removed VM [{vm.name}] due to vm_only_branch directive")
Expand Down Expand Up @@ -189,7 +195,7 @@ def _get_vm_logs(self, env, library_name, os_type, os_distro, os_branch, os_cpu,

def _get_lang_variant_provision(self, env, library_name, os_type, os_distro, os_branch, os_cpu, weblog_raw_data):
if "lang_variant" not in weblog_raw_data:
logger.debug(f"lang_variant not found in weblog provision file")
logger.debug("lang_variant not found in weblog provision file")
return None
lang_variant = weblog_raw_data["lang_variant"]
installations = lang_variant["install"]
Expand Down

0 comments on commit 521c3eb

Please sign in to comment.