From adf6d2f0579f4e98467a29b13aa412a27962166a Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 28 Oct 2024 18:22:37 +0500 Subject: [PATCH 1/4] fix: corrected requirements dir path --- dockerfiles/enterprise-access.Dockerfile | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/dockerfiles/enterprise-access.Dockerfile b/dockerfiles/enterprise-access.Dockerfile index 75bb515..eb03cfd 100644 --- a/dockerfiles/enterprise-access.Dockerfile +++ b/dockerfiles/enterprise-access.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal as app +FROM ubuntu:focal AS app MAINTAINER sre@edx.org @@ -81,10 +81,10 @@ RUN ./configure && make && make install && ldconfig RUN ln -s /usr/bin/python3 /usr/bin/python RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DJANGO_SETTINGS_MODULE enterprise_access.settings.production +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 +ENV DJANGO_SETTINGS_MODULE=enterprise_access.settings.production EXPOSE 18270 EXPOSE 18271 @@ -92,13 +92,14 @@ RUN useradd -m --shell /bin/false app WORKDIR /edx/app/enterprise-access -RUN mkdir -p /requirements +RUN mkdir -p requirements +RUN ls -la && echo "Listing..." -RUN curl -L -o /requirements/pip.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/pip.txt -RUN curl -L -o /requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/production.txt +RUN curl -L -o requirements/pip.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/pip.txt +RUN curl -L -o requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/production.txt # Dependencies are installed as root so they cannot be modified by the application user. -RUN pip install -r /requirements/pip.txt -RUN pip install -r /requirements/production.txt +RUN pip install -r requirements/pip.txt +RUN pip install -r requirements/production.txt RUN mkdir -p /edx/var/log @@ -111,12 +112,14 @@ USER app # Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. CMD gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application -FROM app as newrelic +FROM app AS newrelic RUN pip install newrelic CMD newrelic-admin run-program gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application -FROM app as devstack +FROM app AS devstack + USER root -RUN pip install -r /requirements/dev.txt +RUN pip install -r requirements/dev.txt + USER app CMD gunicorn --workers=2 --name enterprise-access -c /edx/app/enterprise-access/enterprise_access/docker_gunicorn_configuration.py --log-file - --max-requests=1000 enterprise_access.wsgi:application From c37a60910125c052c2f6e1530b8e5ccac288d1f3 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 28 Oct 2024 18:26:02 +0500 Subject: [PATCH 2/4] test: triggering workflow on PR for testing --- .github/workflows/push-enterprise-access-image.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push-enterprise-access-image.yaml b/.github/workflows/push-enterprise-access-image.yaml index 53a8ce5..dff6b56 100644 --- a/.github/workflows/push-enterprise-access-image.yaml +++ b/.github/workflows/push-enterprise-access-image.yaml @@ -9,6 +9,10 @@ on: schedule: - cron: "0 4 * * 1-5" # UTC Time + pull_request: + branches: + - '**' + jobs: build-and-push-image: runs-on: ubuntu-latest From 73ee81c3b202d0091f4aaf2ed56e513f01b349b0 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 28 Oct 2024 18:32:28 +0500 Subject: [PATCH 3/4] test: removed PR trigger for workflow --- .github/workflows/push-enterprise-access-image.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/push-enterprise-access-image.yaml b/.github/workflows/push-enterprise-access-image.yaml index dff6b56..53a8ce5 100644 --- a/.github/workflows/push-enterprise-access-image.yaml +++ b/.github/workflows/push-enterprise-access-image.yaml @@ -9,10 +9,6 @@ on: schedule: - cron: "0 4 * * 1-5" # UTC Time - pull_request: - branches: - - '**' - jobs: build-and-push-image: runs-on: ubuntu-latest From 521f1b07d89954c77a2c76c63b37f60e1438e34d Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 28 Oct 2024 18:38:03 +0500 Subject: [PATCH 4/4] chore: removed test logging --- dockerfiles/enterprise-access.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/dockerfiles/enterprise-access.Dockerfile b/dockerfiles/enterprise-access.Dockerfile index eb03cfd..f984abb 100644 --- a/dockerfiles/enterprise-access.Dockerfile +++ b/dockerfiles/enterprise-access.Dockerfile @@ -93,7 +93,6 @@ RUN useradd -m --shell /bin/false app WORKDIR /edx/app/enterprise-access RUN mkdir -p requirements -RUN ls -la && echo "Listing..." RUN curl -L -o requirements/pip.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/pip.txt RUN curl -L -o requirements/production.txt https://raw.githubusercontent.com/openedx/enterprise-access/main/requirements/production.txt