diff --git a/docker/Dockerfile-gunicorn b/docker/Dockerfile-gunicorn index f1790fd68..5c1c810eb 100644 --- a/docker/Dockerfile-gunicorn +++ b/docker/Dockerfile-gunicorn @@ -1,6 +1,13 @@ FROM python:3.13.7-slim-bookworm ENV DEBIAN_FRONTEND=noninteractive +ARG HTTP_PROXY +ARG HTTPS_PROXY +ARG NO_PROXY +ARG http_proxy +ARG https_proxy +ARG no_proxy + WORKDIR /var/www/startup/ COPY requirements.txt requirements.txt RUN python -m venv venv diff --git a/docker/compose.yml.example b/docker/compose.yml.example index 59e1a3c31..dd966b2a9 100644 --- a/docker/compose.yml.example +++ b/docker/compose.yml.example @@ -54,6 +54,13 @@ services: build: context: . dockerfile: Dockerfile-gunicorn + args: + HTTP_PROXY: ${HTTP_PROXY} + HTTPS_PROXY: ${HTTPS_PROXY} + NO_PROXY: ${NO_PROXY} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + no_proxy: ${no_proxy} container_name: green-coding-gunicorn-container init: true depends_on: diff --git a/tests/data/bare-metal/usage_scenario.yml b/tests/data/bare-metal/usage_scenario.yml index 226926570..889ca24d8 100644 --- a/tests/data/bare-metal/usage_scenario.yml +++ b/tests/data/bare-metal/usage_scenario.yml @@ -8,6 +8,15 @@ services: ubuntu-systemd-docker: type: container image: greencoding/ubuntu-systemd-docker + networks: + - bridge + volumes: + - gmt-tests-pip-cache:/root/.cache/pip/ + - gmt-tests-apt-package-cache:/var/cache/apt/ + - gmt-tests-apt-list-cache:/var/lib/apt/lists/ + - gmt-tests-buildkit-cache:/root/.cache/buildkit-gmt/ + setup-commands: + - command: rm /etc/apt/apt.conf.d/docker-clean # the image comes with a script that deletes all apt packages after install. we do not want that flow: - name: Pull GMT @@ -20,7 +29,7 @@ flow: container: ubuntu-systemd-docker commands: - type: console - # we set here --nvidia-gpu altough the M4 machine does not have any. We want to test if the headers can be correctly downloaded + # we set here --nvidia-gpu although the M4 machine does not have any. We want to test if the headers can be correctly downloaded command: | cd ~/green-metrics-tool ./install_linux.sh -p testpw -a http://api.green-coding.internal:9142 -m http://metrics.green-coding.internal:9142 -T -L -z -f -j -d -g --nvidia-gpu @@ -43,8 +52,8 @@ flow: commands: - type: console command: | - source venv/bin/activate cd ~/green-metrics-tool/tests + source ../venv/bin/activate python3 setup-test-env.py shell: bash @@ -65,7 +74,8 @@ flow: - type: console command: | cd ~/green-metrics-tool/tests - python3 -m pytest -vv -rA + source ../venv/bin/activate + python3 -m pytest --durations=0 -vv -rA shell: bash - name: Stop Test Containers