diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ccc4e3a2..9db7ddd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,12 +124,12 @@ auth-service-image_builder: DOCKER_CONTEXT_DIRECTORY: app-config/auth-service -caimira-webservice-image_builder: +calculator-app-image_builder: extends: - .image_builder variables: - IMAGE_NAME: caimira-webservice - DOCKERFILE_DIRECTORY: app-config/caimira-webservice + IMAGE_NAME: calculator-app + DOCKERFILE_DIRECTORY: app-config/calculator-app DOCKER_CONTEXT_DIRECTORY: "" @@ -159,11 +159,11 @@ link_auth-service_with_gitlab_registry: variables: IMAGE_NAME: auth-service -link_caimira-webservice_with_gitlab_registry: +link_calculator-app_with_gitlab_registry: extends: - .link_docker_images_with_gitlab_registry variables: - IMAGE_NAME: caimira-webservice + IMAGE_NAME: calculator-app link_calculator_with_gitlab_registry: extends: diff --git a/README.md b/README.md index 6ae24d2b..771a94f6 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ pytest ./caimira ``` s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/nginx/ centos/nginx-112-centos7 caimira-nginx-app -docker build . -f ./app-config/caimira-webservice/Dockerfile -t caimira-webservice +docker build . -f ./app-config/calculator-app/Dockerfile -t calculator-app docker build ./app-config/auth-service -t auth-service ``` diff --git a/app-config/caimira-webservice/Dockerfile b/app-config/calculator-app/Dockerfile similarity index 93% rename from app-config/caimira-webservice/Dockerfile rename to app-config/calculator-app/Dockerfile index 0a652800..273326e1 100644 --- a/app-config/caimira-webservice/Dockerfile +++ b/app-config/calculator-app/Dockerfile @@ -3,7 +3,7 @@ FROM registry.cern.ch/docker.io/condaforge/mambaforge as conda RUN mamba create --yes -p /opt/app python=3.9 COPY . /opt/app-source RUN cd /opt/app-source && conda run -p /opt/app python -m pip install -r ./requirements.txt .[app] -COPY app-config/caimira-webservice/app.sh /opt/app/bin/caimira-app.sh +COPY app-config/calculator-app/app.sh /opt/app/bin/calculator-app.sh RUN cd /opt/app \ && find -name '*.a' -delete \ && rm -rf /opt/app/conda-meta \ @@ -32,5 +32,5 @@ WORKDIR /scratch RUN CAIMIRA_INIT_FILE=$(/opt/app/bin/python -c "import caimira; print(caimira.__file__)") \ && ln -s $(dirname ${CAIMIRA_INIT_FILE}) /scratch/caimira CMD [ \ - "caimira-app.sh" \ + "calculator-app.sh" \ ] diff --git a/app-config/caimira-webservice/app.sh b/app-config/calculator-app/app.sh similarity index 95% rename from app-config/caimira-webservice/app.sh rename to app-config/calculator-app/app.sh index af223351..8555379e 100755 --- a/app-config/caimira-webservice/app.sh +++ b/app-config/calculator-app/app.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ "$APP_NAME" == "caimira-webservice" ]]; then +if [[ "$APP_NAME" == "calculator-app" ]]; then args=("$@") if [ "$DEBUG" != "true" ] && [[ ! "${args[@]}" =~ "--no-debug" ]]; then args+=("--no-debug") diff --git a/app-config/docker-compose.yml b/app-config/docker-compose.yml index a6b62067..d9ddb34a 100644 --- a/app-config/docker-compose.yml +++ b/app-config/docker-compose.yml @@ -1,32 +1,32 @@ version: "3.8" services: - caimira-app: - image: caimira-webservice + expert-app: + image: calculator-app environment: - APP_NAME=caimira-voila user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"} - caimira-co2-app: - image: caimira-webservice + expert-co2-app: + image: calculator-app environment: - APP_NAME=caimira-co2-voila user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"} - caimira-webservice: - image: caimira-webservice + calculator-app: + image: calculator-app environment: - COOKIE_SECRET - - APP_NAME=caimira-webservice + - APP_NAME=calculator-app - APPLICATION_ROOT=/ - CAIMIRA_CALCULATOR_PREFIX=/calculator-cern - CAIMIRA_THEME=caimira/apps/templates/cern user: ${CURRENT_UID} - caimira-calculator-open: - image: caimira-webservice + calculator-open-app: + image: calculator-app environment: - COOKIE_SECRET - - APP_NAME=caimira-webservice + - APP_NAME=calculator-app - APPLICATION_ROOT=/ - CAIMIRA_CALCULATOR_PREFIX=/calculator-open user: ${CURRENT_UID} @@ -46,13 +46,13 @@ services: ports: - "8080:8080" depends_on: - caimira-webservice: + calculator-app: condition: service_started - caimira-calculator-open: + calculator-open-app: condition: service_started - caimira-app: + expert-app: condition: service_started - caimira-co2-app: + expert-co2-app: condition: service_started auth-service: condition: service_started diff --git a/app-config/nginx/nginx.conf b/app-config/nginx/nginx.conf index 73be04cc..5e0ed708 100644 --- a/app-config/nginx/nginx.conf +++ b/app-config/nginx/nginx.conf @@ -70,7 +70,7 @@ http { # Pass the request on to the webservice. Most likely the URI won't # exist so we get a 404 from that service instead (good as the 404 # pages are consistent). - proxy_pass http://caimira-webservice:8080/$request_uri; + proxy_pass http://calculator-app:8080/$request_uri; } location /voila-server/ { @@ -81,9 +81,9 @@ http { error_page 401 = @error401; error_page 404 = @proxy_404_error_handler; - # caimira-app is the name of the voila server in each of docker-compose, + # expert-app is the name of the voila server in each of docker-compose, # caimira-test.web.cern.ch and caimira.web.cern.ch. - proxy_pass http://caimira-app:8080/voila-server/; + proxy_pass http://expert-app:8080/voila-server/; } rewrite ^/expert-app$ /voila-server/voila/render/caimira.ipynb last; rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last; @@ -101,9 +101,9 @@ http { error_page 401 = @error401; error_page 404 = @proxy_404_error_handler; - # caimira-co2-app is the name of the voila server in each of docker-compose, + # expert-co2-app is the name of the voila server in each of docker-compose, # caimira-test.web.cern.ch and caimira.web.cern.ch. - proxy_pass http://caimira-co2-app:8080/co2-voila-server/; + proxy_pass http://expert-co2-app:8080/co2-voila-server/; } rewrite ^/co2-app$ /co2-voila-server/voila/render/caimira.ipynb last; rewrite ^/(files/static)/(.*)$ /co2-voila-server/voila/$1/$2 last; @@ -114,7 +114,7 @@ http { location / { # By default we have no authentication. - proxy_pass http://caimira-webservice:8080; + proxy_pass http://calculator-app:8080; } location /calculator { @@ -126,14 +126,14 @@ http { auth_request /auth/probe; error_page 401 = @error401; - # caimira-webservice is the name of the tornado server (for the calculator) + # calculator-app is the name of the tornado server (for the calculator) # in each of docker-compose, caimira-test.web.cern.ch and caimira.web.cern.ch. - proxy_pass http://caimira-webservice:8080/calculator-cern; + proxy_pass http://calculator-app:8080/calculator-cern; } location /calculator-open { # Public open calculator - proxy_pass http://caimira-calculator-open:8080/calculator-open; + proxy_pass http://calculator-open-app:8080/calculator-open; } } }