From f7ce8c96f3324bfe07ed2369b2d0327455f832e2 Mon Sep 17 00:00:00 2001 From: Nicola Tarocco Date: Thu, 29 Jul 2021 12:13:43 +0000 Subject: [PATCH] Continue to allow a relative path to be specified for the theme directory. --- .dockerignore | 3 ++- .gitlab-ci.yml | 2 +- app-config/cara-webservice/Dockerfile | 4 ++++ app-config/openshift/deploymentconfig.yaml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5e6416bd..1e5b4d48 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,5 +2,6 @@ venv env* prototypes support -Dockerfile +**/Dockerfile _* + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 329be699..68874eb9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ include: variables: project_name: cara - PY_VERSION: "3.9" # This is what we have running in OpenShift currently. + PY_VERSION: "3.9" # A full installation of CARA, tested with pytest. diff --git a/app-config/cara-webservice/Dockerfile b/app-config/cara-webservice/Dockerfile index fb09d775..e4d044ac 100644 --- a/app-config/cara-webservice/Dockerfile +++ b/app-config/cara-webservice/Dockerfile @@ -22,6 +22,10 @@ FROM debian COPY --from=conda /opt/app /opt/app ENV PATH=/opt/app/bin/:$PATH +# Make a convenient location to the installed CARA package (i.e. a directory called cara in the CWD). +RUN CARA_INIT_FILE=$(/opt/app/bin/python -c "import cara; print(cara.__file__)") \ + && ln -s $(dirname $(dirname ${CARA_INIT_FILE})) /opt/site-packages \ + && ln -s /opt/site-packages/cara ./cara CMD [ \ "cara-app.sh" \ ] diff --git a/app-config/openshift/deploymentconfig.yaml b/app-config/openshift/deploymentconfig.yaml index 9f9504ba..a473f6a6 100644 --- a/app-config/openshift/deploymentconfig.yaml +++ b/app-config/openshift/deploymentconfig.yaml @@ -201,7 +201,7 @@ - name: CARA_CALCULATOR_PREFIX value: /calculator-cern - name: CARA_THEME - value: /opt/app/lib/python3.9/site-packages/cara/apps/calculator/themes/cern + value: cara/apps/calculator/themes/cern image: '${PROJECT_NAME}/cara-webservice' ports: - containerPort: 8080