diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5c41b8ea..20a79941 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -# This module is part of CARA. Please see the repository at +# This module is part of CAiMIRA. Please see the repository at # https://gitlab.cern.ch/cara/cara for details of the license and terms of use. name: CI @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest env: PROJECT_ROOT: ./ - PROJECT_NAME: cara + PROJECT_NAME: caimira steps: - name: Checkout uses: actions/checkout@v2 @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-20.04 env: PROJECT_ROOT: ./ - PROJECT_NAME: cara + PROJECT_NAME: caimira steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 40759e9f..5ba02f52 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ venv support # openshift config check folder -app-config/openshift/test-cara -app-config/openshift/cara-prod +app-config/openshift/caimira-test +app-config/openshift/caimira-prod # documentation build folder -cara/docs/_build \ No newline at end of file +caimira/docs/_build \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f57bc054..ccc4e3a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,24 +11,24 @@ include: file: acc_py_devtools/templates/gitlab-ci/python.yml variables: - project_name: cara + project_name: caimira PY_VERSION: "3.9" # ################################################################################################### # Test code -# A full installation of CARA, tested with pytest. +# A full installation of CAiMIRA, tested with pytest. test_install: extends: .acc_py_full_test -# A development installation of CARA tested with pytest. +# A development installation of CAiMIRA tested with pytest. test_dev: extends: .acc_py_dev_test -# A development installation of CARA tested with pytest. +# A development installation of CAiMIRA tested with pytest. test_dev-39: variables: PY_VERSION: "3.9" @@ -55,33 +55,41 @@ test_dev-39: script: - cd ./app-config/openshift - oc login ${OC_SERVER} --token="${OC_TOKEN}" - - python ./config-fetch.py ${CARA_INSTANCE} --output-directory ./${CARA_INSTANCE}/actual - - python ./config-generate.py ${CARA_INSTANCE} --output-directory ./${CARA_INSTANCE}/expected - - python ./config-normalise.py ./${CARA_INSTANCE}/actual ./${CARA_INSTANCE}/actual-normed - - python ./config-normalise.py ./${CARA_INSTANCE}/expected ./${CARA_INSTANCE}/expected-normed - - diff -u ./${CARA_INSTANCE}/actual-normed/ ./${CARA_INSTANCE}/expected-normed/ + - python ./config-fetch.py ${CAIMIRA_INSTANCE} --output-directory ./${CAIMIRA_INSTANCE}/actual + - python ./config-generate.py ${CAIMIRA_INSTANCE} --output-directory ./${CAIMIRA_INSTANCE}/expected + - python ./config-normalise.py ./${CAIMIRA_INSTANCE}/actual ./${CAIMIRA_INSTANCE}/actual-normed + - python ./config-normalise.py ./${CAIMIRA_INSTANCE}/expected ./${CAIMIRA_INSTANCE}/expected-normed + - diff -u ./${CAIMIRA_INSTANCE}/actual-normed/ ./${CAIMIRA_INSTANCE}/expected-normed/ artifacts: paths: - - ./app-config/openshift/${CARA_INSTANCE}/actual - - ./app-config/openshift/${CARA_INSTANCE}/expected + - ./app-config/openshift/${CAIMIRA_INSTANCE}/actual + - ./app-config/openshift/${CAIMIRA_INSTANCE}/expected check_openshift_config_test: extends: .test_openshift_config variables: - CARA_INSTANCE: 'test-cara' - BRANCH: 'live/test-cara' + CAIMIRA_INSTANCE: 'caimira-test' + BRANCH: 'live/caimira-test' OC_SERVER: https://api.paas.okd.cern.ch - OC_TOKEN: "${OPENSHIFT_TEST_CONFIG_CHECKER_TOKEN}" + OC_TOKEN: "${OPENSHIFT_CAIMIRA_TEST_CONFIG_CHECKER_TOKEN}" check_openshift_config_prod: extends: .test_openshift_config variables: - CARA_INSTANCE: 'cara-prod' + CAIMIRA_INSTANCE: 'caimira-prod' BRANCH: 'master' OC_SERVER: https://api.paas.okd.cern.ch - OC_TOKEN: "${OPENSHIFT_PROD_CONFIG_CHECKER_TOKEN}" + OC_TOKEN: "${OPENSHIFT_CAIMIRA_PROD_CONFIG_CHECKER_TOKEN}" + + +oci_calculator: + extends: .image_builder + variables: + IMAGE_NAME: calculator + DOCKERFILE_DIRECTORY: app-config/caimira-public-docker-image + DOCKER_CONTEXT_DIRECTORY: "" # ################################################################################################### @@ -91,12 +99,12 @@ check_openshift_config_prod: # Build and push images to the openshift instance, which automatically triggers an application re-deployment. stage: docker-build rules: - - if: '$CI_COMMIT_BRANCH == "live/test-cara"' + - if: '$CI_COMMIT_BRANCH == "live/caimira-test"' variables: - IMAGE_TAG: test-cara-latest + IMAGE_TAG: caimira-test-latest - if: '$CI_COMMIT_BRANCH == "master"' variables: - IMAGE_TAG: cara-prod-latest + IMAGE_TAG: caimira-prod-latest image: # Based on guidance at https://gitlab.cern.ch/gitlabci-examples/build_docker_image. name: gitlab-registry.cern.ch/ci-tools/docker-image-builder @@ -116,21 +124,12 @@ auth-service-image_builder: DOCKER_CONTEXT_DIRECTORY: app-config/auth-service -cara-webservice-image_builder: +caimira-webservice-image_builder: extends: - .image_builder variables: - IMAGE_NAME: cara-webservice - DOCKERFILE_DIRECTORY: app-config/cara-webservice - DOCKER_CONTEXT_DIRECTORY: "" - - -oci_calculator: - extends: - - .image_builder - variables: - IMAGE_NAME: calculator - DOCKERFILE_DIRECTORY: app-config/cara-public-docker-image + IMAGE_NAME: caimira-webservice + DOCKERFILE_DIRECTORY: app-config/caimira-webservice DOCKER_CONTEXT_DIRECTORY: "" @@ -141,16 +140,16 @@ oci_calculator: stage: oc-tag image: gitlab-registry.cern.ch/paas-tools/openshift-client:latest rules: - - if: '$CI_COMMIT_BRANCH == "live/test-cara"' + - if: '$CI_COMMIT_BRANCH == "live/caimira-test"' variables: - OC_PROJECT: "test-cara" - OC_TOKEN: ${OPENSHIFT_TEST_DEPLOY_TOKEN} - IMAGE_TAG: test-cara-latest + OC_PROJECT: "caimira-test" + OC_TOKEN: ${OPENSHIFT_CAIMIRA_TEST_DEPLOY_TOKEN} + IMAGE_TAG: caimira-test-latest - if: '$CI_COMMIT_BRANCH == "master"' variables: - OC_PROJECT: "cara-prod" - OC_TOKEN: ${OPENSHIFT_PROD_DEPLOY_TOKEN} - IMAGE_TAG: cara-prod-latest + OC_PROJECT: "caimira-prod" + OC_TOKEN: ${OPENSHIFT_CAIMIRA_PROD_DEPLOY_TOKEN} + IMAGE_TAG: caimira-prod-latest script: - oc tag --source=docker ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:latest --token ${OC_TOKEN} --server=https://api.paas.okd.cern.ch -n ${OC_PROJECT} @@ -160,11 +159,11 @@ link_auth-service_with_gitlab_registry: variables: IMAGE_NAME: auth-service -link_cara-webservice_with_gitlab_registry: +link_caimira-webservice_with_gitlab_registry: extends: - .link_docker_images_with_gitlab_registry variables: - IMAGE_NAME: cara-webservice + IMAGE_NAME: caimira-webservice link_calculator_with_gitlab_registry: extends: @@ -174,18 +173,18 @@ link_calculator_with_gitlab_registry: # ################################################################################################### -# Trigger build of CARA router on OpenShift +# Trigger build of CAiMIRA router on OpenShift -trigger_cara-router_build_on_openshift: +trigger_caimira-router_build_on_openshift: stage: deploy rules: - - if: '$CI_COMMIT_BRANCH == "live/test-cara"' + - if: '$CI_COMMIT_BRANCH == "live/caimira-test"' variables: - OC_PROJECT: "test-cara" - BUILD_WEBHOOK_SECRET: ${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET} + OC_PROJECT: "caimira-test" + BUILD_WEBHOOK_SECRET: ${OPENSHIFT_CAIMIRA_TEST_BUILD_WEBHOOK_SECRET} - if: '$CI_COMMIT_BRANCH == "master"' variables: - OC_PROJECT: "cara-prod" - BUILD_WEBHOOK_SECRET: ${OPENSHIFT_PROD_BUILD_WEBHOOK_SECRET} + OC_PROJECT: "caimira-prod" + BUILD_WEBHOOK_SECRET: ${OPENSHIFT_CAIMIRA_PROD_BUILD_WEBHOOK_SECRET} script: - - curl -X POST -k https://api.paas.okd.cern.ch/apis/build.openshift.io/v1/namespaces/${OC_PROJECT}/buildconfigs/cara-router/webhooks/${BUILD_WEBHOOK_SECRET}/generic + - curl -X POST -k https://api.paas.okd.cern.ch/apis/build.openshift.io/v1/namespaces/${OC_PROJECT}/buildconfigs/caimira-router/webhooks/${BUILD_WEBHOOK_SECRET}/generic diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 44aa3959..8a50de4c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,7 +17,7 @@ build: # Build documentation in the docs/ directory with Sphinx sphinx: - configuration: cara/docs/conf.py + configuration: caimira/docs/conf.py # If using Sphinx, optionally build your docs in additional formats such as PDF # formats: diff --git a/README.md b/README.md index 950429b7..db51d327 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# CARA - COVID Airborne Risk Assessment +# CAiMIRA - CERN Airborne Model for Risk Assessment -CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. +CAiMIRA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. -CARA models the concentration profile of potential virions in enclosed spaces , both as background (room) concentration and during close-proximity interations, with clear and intuitive graphs. +CAiMIRA models the concentration profile of potential virions in enclosed spaces , both as background (room) concentration and during close-proximity interations, with clear and intuitive graphs. The user can set a number of parameters, including room volume, exposure time, activity type, mask-wearing and ventilation. The report generated indicates how to avoid exceeding critical concentrations and chains of airborne transmission in spaces such as individual offices, meeting rooms and labs. @@ -24,7 +24,7 @@ While the SARS-CoV-2 virus is in circulation among the population, the notion of Each event modelled is unique, and the results generated therein are only as accurate as the inputs and assumptions. ## Authors -CARA was developed by following members of CERN - European Council for Nuclear Research (visit https://home.cern/): +CAiMIRA was developed by following members of CERN - European Council for Nuclear Research (visit https://home.cern/): Andre Henriques1, Luis Aleixo1, Marco Andreini1, Gabriella Azzopardi2, James Devine3, Philip Elson4, Nicolas Mounet2, Markus Kongstein Rognlien2,6, Nicola Tarocco5 @@ -37,15 +37,15 @@ Andre Henriques1, Luis Aleixo1, Marco Andreini1 ### Reference and Citation -**For the use of the CARA web app** +**For the use of the CAiMIRA web app** -CARA – COVID Airborne Risk Assessment tool +CAiMIRA – CERN Airborne Model for Indoor Risk Assessment tool [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6520432.svg)](https://doi.org/10.5281/zenodo.6520432) © Copyright 2020-2021 CERN. All rights not expressly granted are reserved. -**For use of the CARA model** +**For use of the CAiMIRA model** Henriques A, Mounet N, Aleixo L, Elson P, Devine J, Azzopardi G, Andreini M, Rognlien M, Tarocco N, Tang J. (2022). Modelling airborne transmission of SARS-CoV-2 using CARA: risk assessment for enclosed spaces. _Interface Focus 20210076_. https://doi.org/10.1098/rsfs.2021.0076 @@ -55,80 +55,80 @@ https://doi.org/10.1016/j.buildenv.2022.109166 ## Applications -### COVID Calculator +### Calculator A risk assessment tool which simulates the airborne spread of the SARS-CoV-2 virus for space managers. -### CARA Expert App +### CAiMIRA Expert App -A tool to interact with various parameters of the CARA model. +A tool to interact with various parameters of the CAiMIRA model. ## Disclaimer -CARA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. +CAiMIRA has not undergone review, approval or certification by competent authorities, and as a result, it cannot be considered as a fully endorsed and reliable tool, namely in the assessment of potential viral emissions from infected hosts to be modelled. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. -## Running CARA locally +## Running CAiMIRA locally -The easiest way to run a version of CARA Calculator is to use docker. A pre-built -image of CARA is made available at https://gitlab.cern.ch/cara/cara/container_registry. -In order to run cara locally with docker, run the following: +The easiest way to run a version of CAiMIRA Calculator is to use docker. A pre-built +image of CAiMIRA is made available at https://gitlab.cern.ch/cara/cara/container_registry. +In order to run CAiMIRA locally with docker, run the following: $ docker run -it -p 8080:8080 gitlab-registry.cern.ch/cara/cara/calculator -This will start a local version of CARA, which can be visited at http://localhost:8080/. +This will start a local version of CAiMIRA, which can be visited at http://localhost:8080/. ## Development guide -CARA is also mirrored to Github if you wish to collaborate on development and can be found at: https://github.com/CERN/cara +CAiMIRA is also mirrored to Github if you wish to collaborate on development and can be found at: https://github.com/CERN/caimira -### Installing CARA in editable mode +### Installing CAiMIRA in editable mode ``` pip install -e . # At the root of the repository ``` -### Running the COVID calculator app in development mode +### Running the Calculator app in development mode ``` -python -m cara.apps.calculator +python -m caimira.apps.calculator ``` To run with the CERN theme: ``` -python -m cara.apps.calculator --theme=cara/apps/templates/cern +python -m caimira.apps.calculator --theme=caimira/apps/templates/cern ``` To run the calculator on a different URL path: ``` -python -m cara.apps.calculator --prefix=/mycalc +python -m caimira.apps.calculator --prefix=/mycalc ``` ### How to compile and read the documentation -In order to generate the documentation, CARA must be installed first with the `doc` dependencies: +In order to generate the documentation, CAiMIRA must be installed first with the `doc` dependencies: ``` pip install -e .[doc] ``` -To generate the HTML documentation page, the command `make html` should be executed in the `cara/docs` directory. -If any of the `.rst` files under the `cara/docs` folder is changed, this command should be executed again. +To generate the HTML documentation page, the command `make html` should be executed in the `caimira/docs` directory. +If any of the `.rst` files under the `caimira/docs` folder is changed, this command should be executed again. -Then, right click on `cara/docs/_build/html/index.html` and select `Open with` your preferred web browser. +Then, right click on `caimira/docs/_build/html/index.html` and select `Open with` your preferred web browser. -### Running the CARA Expert-App app in development mode +### Running the CAiMIRA Expert-App app in development mode ``` -voila cara/apps/expert/cara.ipynb --port=8080 +voila caimira/apps/expert/caimira.ipynb --port=8080 ``` Then visit http://localhost:8080. @@ -138,7 +138,7 @@ Then visit http://localhost:8080. ``` pip install -e .[test] -pytest ./cara +pytest ./caimira ``` ### Building the whole environment for local development @@ -146,12 +146,12 @@ pytest ./cara **Simulate the docker build that takes place on openshift with:** ``` -s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/nginx/ centos/nginx-112-centos7 cara-nginx-app -docker build . -f ./app-config/cara-webservice/Dockerfile -t cara-webservice +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 ./app-config/auth-service -t auth-service ``` -Get the client secret from the CERN Application portal for the `cara-test` app. See [CERN-SSO-integration](#CERN-SSO-integration) for more info. +Get the client secret from the CERN Application portal for the `caimira-test` app. See [CERN-SSO-integration](#CERN-SSO-integration) for more info. ``` read CLIENT_SECRET ``` @@ -161,7 +161,7 @@ Define some env vars (copy/paste): export COOKIE_SECRET=$(openssl rand -hex 50) export OIDC_SERVER=https://auth.cern.ch/auth export OIDC_REALM=CERN -export CLIENT_ID=cara-test +export CLIENT_ID=caimira-test export CLIENT_SECRET ``` @@ -175,21 +175,21 @@ Then visit http://localhost:8080/. ### Setting up the application on openshift -The https://cern.ch/cara application is running on CERN's OpenShift platform. In order to set it up for the first time, we followed the documentation at https://cern.service-now.com/service-portal?id=kb_article&n=KB0004498. In particular we: +The https://cern.ch/caimira application is running on CERN's OpenShift platform. In order to set it up for the first time, we followed the documentation at https://cern.service-now.com/service-portal?id=kb_article&n=KB0004498. In particular we: * Added the OpenShift application deploy key to the GitLab repository * Created a Python 3.6 (the highest possible at the time of writing) application in OpenShift * Configured a generic webhook on OpenShift, and call that from the CI of the GitLab repository -### Updating the test-cara.web.cern.ch instance +### Updating the caimira-test.web.cern.ch instance -We have a replica of https://cara.web.cern.ch running on http://test-cara.web.cern.ch. Its purpose is to simulate what will happen when -a feature is merged. To push your changes to test-cara, simply push your branch to `live/test-cara` and the CI pipeline will trigger the +We have a replica of https://caimira.web.cern.ch running on http://caimira-test.web.cern.ch. Its purpose is to simulate what will happen when +a feature is merged. To push your changes to caimira-test, simply push your branch to `live/caimira-test` and the CI pipeline will trigger the deployment. To push to this branch, there is a good chance that you will need to force push - you should always force push with care and understanding why you are doing it. Syntactically, it will look something like (assuming that you have "upstream" as your remote name, but it may be origin if you haven't configured it differently): - git push --force upstream name-of-local-branch:live/test-cara + git push --force upstream name-of-local-branch:live/caimira-test ## OpenShift templates @@ -205,7 +205,7 @@ $ oc login https://api.paas.okd.cern.ch Then, switch to the project that you want to update: ```console -$ oc project cara-test +$ oc project caimira-test ``` Create a new service account in OpenShift to use GitLab container registry: @@ -221,17 +221,17 @@ $ oc serviceaccounts get-token gitlabci-deployer <...test-token...> ``` -Add the token to GitLab to allow GitLab to access OpenShift and define/change image stream tags. Go to `Settings` -> `CI / CD` -> `Variables` -> click on `Expand` button and create the variable `OPENSHIFT_TEST_DEPLOY_TOKEN`: insert the token `<...test-token...>`. +Add the token to GitLab to allow GitLab to access OpenShift and define/change image stream tags. Go to `Settings` -> `CI / CD` -> `Variables` -> click on `Expand` button and create the variable `OPENSHIFT_CAIMIRA_TEST_DEPLOY_TOKEN`: insert the token `<...test-token...>`. Then, create the webhook secret to be able to trigger automatic builds from GitLab. -Create and store the secret. Copy the secret above and add it to the GitLab project under `CI /CD` -> `Variables` with the name `OPENSHIFT_TEST_WEBHOOK_SECRET`. +Create and store the secret. Copy the secret above and add it to the GitLab project under `CI /CD` -> `Variables` with the name `OPENSHIFT_CAIMIRA_TEST_WEBHOOK_SECRET`. ```console $ WEBHOOKSECRET=$(openssl rand -hex 50) $ oc create secret generic \ --from-literal="WebHookSecretKey=$WEBHOOKSECRET" \ - gitlab-cara-webhook-secret + gitlab-caimira-webhook-secret ``` For CI usage, we also suggest creating a service account: @@ -256,8 +256,8 @@ $ cd app-config/openshift $ oc process -f configmap.yaml | oc create -f - $ oc process -f services.yaml | oc create -f - $ oc process -f imagestreams.yaml | oc create -f - -$ oc process -f buildconfig.yaml --param GIT_BRANCH='live/test-cara' | oc create -f - -$ oc process -f deploymentconfig.yaml --param PROJECT_NAME='cara-test' | oc create -f - +$ oc process -f buildconfig.yaml --param GIT_BRANCH='live/caimira-test' | oc create -f - +$ oc process -f deploymentconfig.yaml --param PROJECT_NAME='caimira-test' | oc create -f - ``` ### CERN SSO integration @@ -265,12 +265,12 @@ $ oc process -f deploymentconfig.yaml --param PROJECT_NAME='cara-test' | oc cre The SSO integration uses OpenID credentials configured in [CERN Applications portal](https://application-portal.web.cern.ch/). How to configure the application: -* Application Identifier: `cara-test` -* Homepage: `https://test-cara.web.cern.ch` -* Administrators: `cara-dev` +* Application Identifier: `caimira-test` +* Homepage: `https://caimira-test.web.cern.ch` +* Administrators: `caimira-dev` * SSO Registration: * Protocol: `OpenID (OIDC)` - * Redirect URI: `https://test-cara.web.cern.ch/auth/authorize` + * Redirect URI: `https://caimira-test.web.cern.ch/auth/authorize` * Leave unchecked all the other checkboxes * Define new roles: * Name: `CERN Users` @@ -282,12 +282,12 @@ How to configure the application: * Role Identifier: `admin` * Leave unchecked checkboxes * Minimum Level Of Assurance: `Any (no restrictions)` - * Assign role to groups: `cara-app-external-access` e-group + * Assign role to groups: `caimira-app-external-access` e-group * Name: `Allowed users` * Role Identifier: `allowed-users` * Check `This role is required to access my application` * Minimum Level Of Assurance:`Any (no restrictions)` - * Assign role to groups: `cern-accounts-primary` and `cara-app-external-access` e-groups + * Assign role to groups: `cern-accounts-primary` and `caimira-app-external-access` e-groups Copy the client id and client secret and use it below. @@ -318,8 +318,8 @@ $ cd app-config/openshift $ oc process -f configmap.yaml | oc replace -f - $ oc process -f services.yaml | oc replace -f - $ oc process -f imagestreams.yaml | oc replace -f - -$ oc process -f buildconfig.yaml --param GIT_BRANCH='live/test-cara' | oc replace -f - -$ oc process -f deploymentconfig.yaml --param PROJECT_NAME='cara-test' | oc replace -f - +$ oc process -f buildconfig.yaml --param GIT_BRANCH='live/caimira-test' | oc replace -f - +$ oc process -f deploymentconfig.yaml --param PROJECT_NAME='caimira-test' | oc replace -f - ``` Be aware that if you create/recreate the environment you must manually create a **route** in OpenShift, diff --git a/app-config/caimira-public-docker-image/Dockerfile b/app-config/caimira-public-docker-image/Dockerfile new file mode 100644 index 00000000..ee69552b --- /dev/null +++ b/app-config/caimira-public-docker-image/Dockerfile @@ -0,0 +1,21 @@ +FROM registry.cern.ch/docker.io/library/python:3.9 + +# Copy just the requirements.txt initially, allowing Docker effectively to cache the build (good for dev). +COPY ./requirements.txt /tmp/requirements.txt + +RUN python -m venv /opt/caimira/app +RUN sed '/\.\[/d' -i /tmp/requirements.txt && /opt/caimira/app/bin/pip install -r /tmp/requirements.txt +RUN apt-get update && apt-get install -y nginx + +# Now that we have done the installation of the dependencies, copy the caimira source. +COPY ./ /opt/caimira/src +COPY ./app-config/caimira-public-docker-image/run_caimira.sh /opt/caimira/start.sh + +# To ensure that we have installed the full requirements, re-run the pip install. +# In the best case this will be a no-op. +RUN cd /opt/caimira/src/ && /opt/caimira/app/bin/pip install -r /opt/caimira/src/requirements.txt +RUN /opt/caimira/app/bin/jupyter trust /opt/caimira/src/caimira/apps/expert/*.ipynb +COPY ./app-config/caimira-public-docker-image/nginx.conf /opt/caimira/nginx.conf + +EXPOSE 8080 +ENTRYPOINT ["/bin/sh", "-c", "/opt/caimira/start.sh"] diff --git a/app-config/cara-public-docker-image/nginx.conf b/app-config/caimira-public-docker-image/nginx.conf similarity index 97% rename from app-config/cara-public-docker-image/nginx.conf rename to app-config/caimira-public-docker-image/nginx.conf index b873a7d2..88cd8e2b 100644 --- a/app-config/cara-public-docker-image/nginx.conf +++ b/app-config/caimira-public-docker-image/nginx.conf @@ -37,7 +37,7 @@ http { listen 8080 default_server; listen [::]:8080 default_server; server_name _; - root /opt/cara/src; + root /opt/caimira/src; # Load configuration files for the default server block. include /opt/app-root/etc/nginx.default.d/*.conf; diff --git a/app-config/cara-public-docker-image/run_cara.sh b/app-config/caimira-public-docker-image/run_caimira.sh similarity index 54% rename from app-config/cara-public-docker-image/run_cara.sh rename to app-config/caimira-public-docker-image/run_caimira.sh index 43d963b2..bfaa57ab 100755 --- a/app-config/cara-public-docker-image/run_cara.sh +++ b/app-config/caimira-public-docker-image/run_caimira.sh @@ -1,16 +1,16 @@ -echo 'CARA is running on http://localhost:8080' +echo 'CAiMIRA is running on http://localhost:8080' echo 'Please see https://gitlab.cern.ch/cara/cara for terms of use.' # Run a proxy for the apps (listening on 8080). -nginx -c /opt/cara/nginx.conf +nginx -c /opt/caimira/nginx.conf # Run the expert app in the background. -cd /opt/cara/src/cara -/opt/cara/app/bin/python -m voila /opt/cara/src/cara/apps/expert/cara.ipynb \ +cd /opt/caimira/src/caimira +/opt/caimira/app/bin/python -m voila /opt/caimira/src/caimira/apps/expert/caimira.ipynb \ --port=8082 --no-browser --base_url=/voila-server/ \ --Voila.tornado_settings 'allow_origin=*' \ >> /var/log/expert-app.log 2>&1 & # Run the calculator in the foreground. -/opt/cara/app/bin/python -m cara.apps.calculator --port 8081 --no-debug +/opt/caimira/app/bin/python -m caimira.apps.calculator --port 8081 --no-debug diff --git a/app-config/cara-webservice/Dockerfile b/app-config/caimira-webservice/Dockerfile similarity index 77% rename from app-config/cara-webservice/Dockerfile rename to app-config/caimira-webservice/Dockerfile index a1a0ba1d..0a652800 100644 --- a/app-config/cara-webservice/Dockerfile +++ b/app-config/caimira-webservice/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/cara-webservice/app.sh /opt/app/bin/cara-app.sh +COPY app-config/caimira-webservice/app.sh /opt/app/bin/caimira-app.sh RUN cd /opt/app \ && find -name '*.a' -delete \ && rm -rf /opt/app/conda-meta \ @@ -22,15 +22,15 @@ FROM registry.cern.ch/docker.io/library/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). +# Make a convenient location to the installed CAiMIRA package (i.e. a directory called caimira in the CWD). # It is important that this directory is also writable by a non-root user. RUN mkdir -p /scratch \ && chmod a+wx /scratch # Set the HOME directory to something that anybody can write to (to support non root users, such as on openshift). ENV HOME=/scratch WORKDIR /scratch -RUN CARA_INIT_FILE=$(/opt/app/bin/python -c "import cara; print(cara.__file__)") \ - && ln -s $(dirname ${CARA_INIT_FILE}) /scratch/cara +RUN CAIMIRA_INIT_FILE=$(/opt/app/bin/python -c "import caimira; print(caimira.__file__)") \ + && ln -s $(dirname ${CAIMIRA_INIT_FILE}) /scratch/caimira CMD [ \ - "cara-app.sh" \ + "caimira-app.sh" \ ] diff --git a/app-config/caimira-webservice/app.sh b/app-config/caimira-webservice/app.sh new file mode 100755 index 00000000..9ea2862a --- /dev/null +++ b/app-config/caimira-webservice/app.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [[ "$APP_NAME" == "caimira-webservice" ]]; then + args=("$@") + if [ "$DEBUG" != "true" ] && [[ ! "${args[@]}" =~ "--no-debug" ]]; then + args+=("--no-debug") + fi + + if [ ! -z "$CAIMIRA_THEME" ]; then + args+=("--theme=${CAIMIRA_THEME}") + fi + + if [ ! -z "$CAIMIRA_CALCULATOR_PREFIX" ]; then + args+=("--prefix=${CAIMIRA_CALCULATOR_PREFIX}") + fi + + echo "Starting the caimira webservice with: python -m caimira.apps.calculator ${args[@]}" + python -m caimira.apps.calculator "${args[@]}" +elif [[ "$APP_NAME" == "caimira-voila" ]]; then + echo "Starting the voila service" + voila caimira/apps/expert/ --port=8080 --no-browser --base_url=/voila-server/ --tornado_settings 'allow_origin=*' +else + echo "No APP_NAME specified" + exit 1 +fi + diff --git a/app-config/cara-public-docker-image/Dockerfile b/app-config/cara-public-docker-image/Dockerfile deleted file mode 100644 index b4a01695..00000000 --- a/app-config/cara-public-docker-image/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM registry.cern.ch/docker.io/library/python:3.9 - -# Copy just the requirements.txt initially, allowing Docker effectively to cache the build (good for dev). -COPY ./requirements.txt /tmp/requirements.txt - -RUN python -m venv /opt/cara/app -RUN sed '/\.\[/d' -i /tmp/requirements.txt && /opt/cara/app/bin/pip install -r /tmp/requirements.txt -RUN apt-get update && apt-get install -y nginx - -# Now that we have done the installation of the dependencies, copy the cara source. -COPY ./ /opt/cara/src -COPY ./app-config/cara-public-docker-image/run_cara.sh /opt/cara/start.sh - -# To ensure that we have installed the full requirements, re-run the pip install. -# In the best case this will be a no-op. -RUN cd /opt/cara/src/ && /opt/cara/app/bin/pip install -r /opt/cara/src/requirements.txt -RUN /opt/cara/app/bin/jupyter trust /opt/cara/src/cara/apps/expert/*.ipynb -COPY ./app-config/cara-public-docker-image/nginx.conf /opt/cara/nginx.conf - -EXPOSE 8080 -ENTRYPOINT ["/bin/sh", "-c", "/opt/cara/start.sh"] diff --git a/app-config/cara-webservice/app.sh b/app-config/cara-webservice/app.sh deleted file mode 100755 index 879a8571..00000000 --- a/app-config/cara-webservice/app.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [[ "$APP_NAME" == "cara-webservice" ]]; then - args=("$@") - if [ "$DEBUG" != "true" ] && [[ ! "${args[@]}" =~ "--no-debug" ]]; then - args+=("--no-debug") - fi - - if [ ! -z "$CARA_THEME" ]; then - args+=("--theme=${CARA_THEME}") - fi - - if [ ! -z "$CARA_CALCULATOR_PREFIX" ]; then - args+=("--prefix=${CARA_CALCULATOR_PREFIX}") - fi - - echo "Starting the cara webservice with: python -m cara.apps.calculator ${args[@]}" - python -m cara.apps.calculator "${args[@]}" -elif [[ "$APP_NAME" == "cara-voila" ]]; then - echo "Starting the voila service" - voila cara/apps/expert/ --port=8080 --no-browser --base_url=/voila-server/ --tornado_settings 'allow_origin=*' -else - echo "No APP_NAME specified" - exit 1 -fi - diff --git a/app-config/docker-compose.yml b/app-config/docker-compose.yml index e96da5fd..cb9d3958 100644 --- a/app-config/docker-compose.yml +++ b/app-config/docker-compose.yml @@ -1,26 +1,26 @@ version: "3.8" services: - cara-app: - image: cara-webservice + caimira-app: + image: caimira-webservice environment: - - APP_NAME=cara-voila + - APP_NAME=caimira-voila user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"} - cara-webservice: - image: cara-webservice + caimira-webservice: + image: caimira-webservice environment: - COOKIE_SECRET - - APP_NAME=cara-webservice - - CARA_CALCULATOR_PREFIX=/calculator-cern - - CARA_THEME=cara/apps/templates/cern + - APP_NAME=caimira-webservice + - CAIMIRA_CALCULATOR_PREFIX=/calculator-cern + - CAIMIRA_THEME=caimira/apps/templates/cern user: ${CURRENT_UID} - cara-calculator-open: - image: cara-webservice + caimira-calculator-open: + image: caimira-webservice environment: - COOKIE_SECRET - - APP_NAME=cara-webservice - - CARA_CALCULATOR_PREFIX=/calculator-open + - APP_NAME=caimira-webservice + - CAIMIRA_CALCULATOR_PREFIX=/calculator-open user: ${CURRENT_UID} auth-service: @@ -33,16 +33,16 @@ services: - CLIENT_SECRET user: ${CURRENT_UID} - cara-router: - image: cara-nginx-app + caimira-router: + image: caimira-nginx-app ports: - "8080:8080" depends_on: - cara-webservice: + caimira-webservice: condition: service_started - cara-calculator-open: + caimira-calculator-open: condition: service_started - cara-app: + caimira-app: condition: service_started auth-service: condition: service_started diff --git a/app-config/nginx/nginx.conf b/app-config/nginx/nginx.conf index fb69f77a..2fef5b56 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://cara-webservice:8080/$request_uri; + proxy_pass http://caimira-webservice:8080/$request_uri; } location /voila-server/ { @@ -81,21 +81,21 @@ http { error_page 401 = @error401; error_page 404 = @proxy_404_error_handler; - # cara-app is the name of the voila server in each of docker-compose, - # test-cara.web.cern.ch and cara.web.cern.ch. - proxy_pass http://cara-app:8080/voila-server/; + # caimira-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/; } - rewrite ^/expert-app$ /voila-server/voila/render/cara.ipynb last; + rewrite ^/expert-app$ /voila-server/voila/render/caimira.ipynb last; rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last; - # Before implementing the nginx router we could access /voila/render/cara.ipynb. + # Before implementing the nginx router we could access /voila/render/caimira.ipynb. # Redirect this (and all other) URLs to the new scheme. absolute_redirect off; rewrite ^/voila/(.*)$ /voila-server/voila/$1 redirect; location / { # By default we have no authentication. - proxy_pass http://cara-webservice:8080; + proxy_pass http://caimira-webservice:8080; } location /calculator { @@ -107,14 +107,14 @@ http { auth_request /auth/probe; error_page 401 = @error401; - # cara-webservice is the name of the tornado server (for the calculator) - # in each of docker-compose, test-cara.web.cern.ch and cara.web.cern.ch. - proxy_pass http://cara-webservice:8080/calculator-cern; + # caimira-webservice 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; } location /calculator-open { # Public open calculator - proxy_pass http://cara-calculator-open:8080/calculator-open; + proxy_pass http://caimira-calculator-open:8080/calculator-open; } } } diff --git a/app-config/openshift/buildconfig.yaml b/app-config/openshift/buildconfig.yaml index 9bcbc165..3fa3bcdb 100644 --- a/app-config/openshift/buildconfig.yaml +++ b/app-config/openshift/buildconfig.yaml @@ -2,21 +2,21 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-application" + name: "caimira-application" creationTimestamp: null annotations: - description: "CARA build config OpenShift template." - tags: "cara-application" + description: "CAiMIRA build config OpenShift template." + tags: "caimira-application" labels: - template: "cara-application" + template: "caimira-application" objects: - kind: BuildConfig apiVersion: build.openshift.io/v1 metadata: - name: cara-router + name: caimira-router labels: - template: "cara-application" + template: "caimira-application" spec: source: type: Git @@ -24,15 +24,13 @@ ref: ${GIT_BRANCH} uri: ${GIT_REPO} contextDir: app-config/nginx - sourceSecret: - name: sshdeploykey postCommit: {} resources: {} runPolicy: Serial output: to: kind: ImageStreamTag - name: 'cara-router:latest' + name: 'caimira-router:latest' strategy: sourceStrategy: from: @@ -46,13 +44,13 @@ - type: ConfigChange - generic: secretReference: - name: gitlab-cara-webhook-secret + name: gitlab-caimira-webhook-secret type: Generic nodeSelector: null parameters: - name: GIT_REPO description: The GIT repo URL - value: 'ssh://git@gitlab.cern.ch:7999/cara/cara.git' + value: 'https://gitlab.cern.ch/cara/cara.git' - name: GIT_BRANCH - description: The name of the GIT branch to use when building the app, e.g. `live/test-cara` in TEST, `master` in prod + description: The name of the GIT branch to use when building the app, e.g. `live/caimira-test` in TEST, `master` in prod required: true diff --git a/app-config/openshift/config-fetch.py b/app-config/openshift/config-fetch.py index c596c31c..ee737b0d 100644 --- a/app-config/openshift/config-fetch.py +++ b/app-config/openshift/config-fetch.py @@ -6,10 +6,10 @@ import typing def configure_parser(parser: argparse.ArgumentParser) -> None: - parser.description = "Fetch the openshift config for CARA" + parser.description = "Fetch the openshift config for CAiMIRA" parser.set_defaults(handler=handler) parser.add_argument( - "instance", choices=['cara-prod', 'test-cara'], + "instance", choices=['caimira-prod', 'caimira-test'], help="Pick the instance for which you want to fetch the config", ) parser.add_argument( @@ -53,10 +53,10 @@ def fetch_config(output_directory: pathlib.Path): def handler(args: argparse.ArgumentParser) -> None: login_server = 'https://api.paas.okd.cern.ch:443' - if args.instance == 'cara-prod': - project_name = 'cara-prod' - elif args.instance == 'test-cara': - project_name = 'test-cara' + if args.instance == 'caimira-prod': + project_name = 'caimira-prod' + elif args.instance == 'caimira-test': + project_name = 'caimira-test' actual_login_server = get_oc_server() if actual_login_server != login_server: diff --git a/app-config/openshift/config-generate.py b/app-config/openshift/config-generate.py index 3a33db5b..e8a0eec8 100644 --- a/app-config/openshift/config-generate.py +++ b/app-config/openshift/config-generate.py @@ -8,7 +8,7 @@ def configure_parser(parser: argparse.ArgumentParser) -> None: parser.description = "Generate the config files which can be later submitted to openshift" parser.set_defaults(handler=handler) parser.add_argument( - "instance", choices=['cara-prod', 'test-cara'], + "instance", choices=['caimira-prod', 'caimira-test'], help="Pick the instance for which you want to generate the config", ) parser.add_argument( @@ -38,14 +38,14 @@ def generate_config(output_directory: pathlib.Path, project_name: str, hostname: def handler(args: argparse.ArgumentParser) -> None: - if args.instance == 'cara-prod': - project_name = 'cara-prod' + if args.instance == 'caimira-prod': + project_name = 'caimira-prod' branch = 'master' - hostname = 'cara.web.cern.ch' - elif args.instance == 'test-cara': - project_name = 'test-cara' - branch = 'live/test-cara' - hostname = 'test-cara.web.cern.ch' + hostname = 'caimira.web.cern.ch' + elif args.instance == 'caimira-test': + project_name = 'caimira-test' + branch = 'live/caimira-test' + hostname = 'caimira-test.web.cern.ch' generate_config(pathlib.Path(args.output_directory), project_name, hostname, branch) diff --git a/app-config/openshift/configmap.yaml b/app-config/openshift/configmap.yaml index 9b6e2cbf..383e7456 100644 --- a/app-config/openshift/configmap.yaml +++ b/app-config/openshift/configmap.yaml @@ -2,12 +2,12 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-configuration" + name: "caimira-configuration" annotations: - description: "CARA configuration OpenShift template." - tags: "cara-configuration" + description: "CAiMIRA configuration OpenShift template." + tags: "caimira-configuration" labels: - template: "cara-configuration" + template: "caimira-configuration" objects: - apiVersion: v1 diff --git a/app-config/openshift/deploymentconfig.yaml b/app-config/openshift/deploymentconfig.yaml index 67d9e6e5..520fa088 100644 --- a/app-config/openshift/deploymentconfig.yaml +++ b/app-config/openshift/deploymentconfig.yaml @@ -2,12 +2,12 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-application" + name: "caimira-application" annotations: - description: "CARA application OpenShift template." - tags: "cara-application" + description: "CAiMIRA application OpenShift template." + tags: "caimira-application" labels: - template: "cara-application" + template: "caimira-application" objects: - apiVersion: apps.openshift.io/v1 @@ -72,21 +72,21 @@ apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - name: cara-app - labels: {app: cara-app} + name: caimira-app + labels: {app: caimira-app} spec: replicas: 1 template: metadata: labels: - app: cara-app + app: caimira-app spec: containers: - - name: cara-webservice + - name: caimira-webservice env: - name: APP_NAME - value: cara-voila - image: '${PROJECT_NAME}/cara-webservice' + value: caimira-voila + image: '${PROJECT_NAME}/caimira-webservice' ports: - containerPort: 8080 protocol: TCP @@ -113,33 +113,33 @@ type: Rolling test: false selector: - app: cara-app + app: caimira-app triggers: - type: ConfigChange - type: ImageChange imageChangeParams: automatic: true containerNames: - - cara-webservice + - caimira-webservice from: kind: ImageStreamTag - name: 'cara-webservice:latest' + name: 'caimira-webservice:latest' namespace: ${PROJECT_NAME} - apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - name: cara-router + name: caimira-router spec: replicas: 1 template: metadata: labels: - app: cara-router + app: caimira-router spec: containers: - - name: cara-router - image: '${PROJECT_NAME}/cara-router' + - name: caimira-router + image: '${PROJECT_NAME}/caimira-router' ports: - containerPort: 8080 protocol: TCP @@ -166,35 +166,35 @@ type: Rolling test: false selector: - app: cara-router + app: caimira-router triggers: - type: ImageChange imageChangeParams: automatic: true containerNames: - - cara-router + - caimira-router from: kind: ImageStreamTag - name: 'cara-router:latest' + name: 'caimira-router:latest' namespace: ${PROJECT_NAME} - type: ConfigChange - apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - name: cara-webservice + name: caimira-webservice labels: - image: cara-webservice - app: cara-webservice + image: caimira-webservice + app: caimira-webservice spec: replicas: 1 template: metadata: labels: - app: cara-webservice + app: caimira-webservice spec: containers: - - name: cara-webservice + - name: caimira-webservice env: - name: COOKIE_SECRET valueFrom: @@ -204,12 +204,12 @@ - name: REPORT_PARALLELISM value: '3' - name: APP_NAME - value: cara-webservice - - name: CARA_CALCULATOR_PREFIX + value: caimira-webservice + - name: CAIMIRA_CALCULATOR_PREFIX value: /calculator-cern - - name: CARA_THEME - value: cara/apps/templates/cern - image: '${PROJECT_NAME}/cara-webservice' + - name: CAIMIRA_THEME + value: caimira/apps/templates/cern + image: '${PROJECT_NAME}/caimira-webservice' ports: - containerPort: 8080 protocol: TCP @@ -250,41 +250,41 @@ type: Rolling test: false selector: - app: cara-webservice + app: caimira-webservice triggers: - type: ImageChange imageChangeParams: automatic: true containerNames: - - cara-webservice + - caimira-webservice from: kind: ImageStreamTag - name: 'cara-webservice:latest' + name: 'caimira-webservice:latest' namespace: ${PROJECT_NAME} - type: ConfigChange - apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - name: cara-calculator-open + name: caimira-calculator-open labels: - image: cara-webservice - app: cara-calculator-open + image: caimira-webservice + app: caimira-calculator-open spec: replicas: 1 template: metadata: labels: - app: cara-calculator-open + app: caimira-calculator-open spec: containers: - - name: cara-calculator-open + - name: caimira-calculator-open env: - name: APP_NAME - value: cara-webservice - - name: CARA_CALCULATOR_PREFIX + value: caimira-webservice + - name: CAIMIRA_CALCULATOR_PREFIX value: /calculator-open - image: '${PROJECT_NAME}/cara-webservice' + image: '${PROJECT_NAME}/caimira-webservice' ports: - containerPort: 8080 protocol: TCP @@ -315,21 +315,21 @@ type: Rolling test: false selector: - app: cara-calculator-open + app: caimira-calculator-open triggers: - type: ConfigChange - type: ImageChange imageChangeParams: automatic: true containerNames: - - cara-calculator-open + - caimira-calculator-open from: kind: ImageStreamTag - name: 'cara-webservice:latest' + name: 'caimira-webservice:latest' namespace: ${PROJECT_NAME} - type: ConfigChange parameters: - name: PROJECT_NAME - description: The name of this project, e.g. test-cara + description: The name of this project, e.g. caimira-test required: true diff --git a/app-config/openshift/imagestreams.yaml b/app-config/openshift/imagestreams.yaml index 5a3205c5..86a4780d 100644 --- a/app-config/openshift/imagestreams.yaml +++ b/app-config/openshift/imagestreams.yaml @@ -2,13 +2,13 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-imagestreams" + name: "caimira-imagestreams" creationTimestamp: null annotations: - description: "CARA imagestreams OpenShift template." - tags: "cara-imagestreams" + description: "CAiMIRA imagestreams OpenShift template." + tags: "caimira-imagestreams" labels: - template: "cara-application" + template: "caimira-application" objects: - kind: ImageStream @@ -22,7 +22,7 @@ kind: ImageStream apiVersion: image.openshift.io/v1 metadata: - name: cara-router + name: caimira-router spec: lookupPolicy: local: False @@ -30,7 +30,15 @@ kind: ImageStream apiVersion: image.openshift.io/v1 metadata: - name: cara-webservice + name: caimira-webservice + spec: + lookupPolicy: + local: False + - + kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: calculator spec: lookupPolicy: local: False diff --git a/app-config/openshift/routes.example.yaml b/app-config/openshift/routes.example.yaml index a7f0f0e1..262b73cc 100644 --- a/app-config/openshift/routes.example.yaml +++ b/app-config/openshift/routes.example.yaml @@ -2,21 +2,21 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-route" + name: "caimira-route" creationTimestamp: null annotations: - description: "CARA route OpenShift template." - tags: "cara-route" + description: "CAiMIRA route OpenShift template." + tags: "caimira-route" labels: - template: "cara-route" + template: "caimira-route" objects: - apiVersion: route.openshift.io/v1 kind: Route metadata: - name: cara-route + name: caimira-route labels: - app: "cara-route" + app: "caimira-route" spec: host: ${HOST} port: @@ -26,12 +26,12 @@ termination: edge to: kind: Service - name: cara-router + name: caimira-router weight: 100 wildcardPolicy: None parameters: - name: HOST - description: The hostname of the site, e.g. test-cara.web.cern.ch + description: The hostname of the site, e.g. caimira-test.web.cern.ch required: true diff --git a/app-config/openshift/services.yaml b/app-config/openshift/services.yaml index d5de132e..d6aaf814 100644 --- a/app-config/openshift/services.yaml +++ b/app-config/openshift/services.yaml @@ -2,13 +2,13 @@ kind: "Template" apiVersion: template.openshift.io/v1 metadata: - name: "cara-services" + name: "caimira-services" creationTimestamp: null annotations: - description: "CARA services OpenShift template." - tags: "cara-services" + description: "CAiMIRA services OpenShift template." + tags: "caimira-services" labels: - template: "cara-services" + template: "caimira-services" objects: - apiVersion: v1 @@ -32,8 +32,8 @@ kind: Service metadata: labels: - app: cara-app - name: cara-app + app: caimira-app + name: caimira-app spec: ports: - name: 8080-tcp @@ -41,7 +41,7 @@ protocol: TCP targetPort: 8080 selector: - deploymentconfig: cara-app + deploymentconfig: caimira-app sessionAffinity: 'None' type: 'ClusterIP' - @@ -49,8 +49,8 @@ kind: Service metadata: labels: - app: cara-router - name: cara-router + app: caimira-router + name: caimira-router spec: ports: - name: 8080-tcp @@ -58,7 +58,7 @@ protocol: TCP targetPort: 8080 selector: - deploymentconfig: cara-router + deploymentconfig: caimira-router sessionAffinity: 'None' type: 'ClusterIP' - @@ -66,8 +66,8 @@ kind: Service metadata: labels: - app: cara-webservice - name: cara-webservice + app: caimira-webservice + name: caimira-webservice spec: ports: - name: 8080-tcp @@ -75,7 +75,7 @@ protocol: TCP targetPort: 8080 selector: - deploymentconfig: cara-webservice + deploymentconfig: caimira-webservice sessionAffinity: 'None' type: 'ClusterIP' - @@ -83,8 +83,8 @@ kind: Service metadata: labels: - app: cara-calculator-open - name: cara-calculator-open + app: caimira-calculator-open + name: caimira-calculator-open spec: ports: - name: 8080-tcp @@ -92,6 +92,6 @@ protocol: TCP targetPort: 8080 selector: - deploymentconfig: cara-calculator-open + deploymentconfig: caimira-calculator-open sessionAffinity: 'None' type: 'ClusterIP' diff --git a/cara/__init__.py b/caimira/__init__.py similarity index 52% rename from cara/__init__.py rename to caimira/__init__.py index 0561df4a..cf04da3a 100644 --- a/cara/__init__.py +++ b/caimira/__init__.py @@ -1,7 +1,7 @@ -# This module is part of CARA. Please see the repository at +# This module is part of CAiMIRA. Please see the repository at # https://gitlab.cern.ch/cara/cara for details of the license and terms of use. """ -Documentation for the CARA package +Documentation for the CAiMIRA package """ diff --git a/cara/apps/__init__.py b/caimira/apps/__init__.py similarity index 100% rename from cara/apps/__init__.py rename to caimira/apps/__init__.py diff --git a/cara/apps/calculator/__init__.py b/caimira/apps/calculator/__init__.py similarity index 96% rename from cara/apps/calculator/__init__.py rename to caimira/apps/calculator/__init__.py index 40a13f1a..2010a624 100644 --- a/cara/apps/calculator/__init__.py +++ b/caimira/apps/calculator/__init__.py @@ -1,4 +1,4 @@ -# This module is part of CARA. Please see the repository at +# This module is part of CAiMIRA. Please see the repository at # https://gitlab.cern.ch/cara/cara for details of the license and terms of use. import asyncio @@ -31,7 +31,7 @@ from .user import AuthenticatedUser, AnonymousUser # Effectively, if the model increases its MAJOR version then so too should this # calculator version. If the calculator needs to make breaking changes (e.g. change # form attributes) then it can also increase its MAJOR version without needing to -# increase the overall CARA version (found at ``cara.__version__``). +# increase the overall CAiMIRA version (found at ``caimira.__version__``). __version__ = "4.2" @@ -40,7 +40,7 @@ class BaseRequestHandler(RequestHandler): """Called at the beginning of a request before `get`/`post`/etc.""" # Read the secure cookie which exists if we are in an authenticated - # context (though not if the cara webservice is running standalone). + # context (though not if the caimira webservice is running standalone). session = json.loads(self.get_secure_cookie('session') or 'null') if session: @@ -60,7 +60,7 @@ class BaseRequestHandler(RequestHandler): contents = ( f'Unfortunately an error occurred when processing your request. ' f'Please let us know about this issue with as much detail as possible at ' - f'CARA-dev@cern.ch, reporting status ' + f'CAiMIRA-dev@cern.ch, reporting status ' f'code {status_code}, the error id of "{error_id}" and the time of the ' f'request ({datetime.datetime.utcnow()}).



' ) @@ -269,9 +269,9 @@ def make_app( (calculator_prefix + r'/static/(.*)', StaticFileHandler, {'path': calculator_static_dir}), ] - cara_templates = Path(__file__).parent.parent / "templates" + caimira_templates = Path(__file__).parent.parent / "templates" calculator_templates = Path(__file__).parent / "templates" - templates_directories = [cara_templates, calculator_templates] + templates_directories = [caimira_templates, calculator_templates] if theme_dir: templates_directories.insert(0, theme_dir) loader = jinja2.FileSystemLoader([str(path) for path in templates_directories]) diff --git a/cara/apps/calculator/__main__.py b/caimira/apps/calculator/__main__.py similarity index 100% rename from cara/apps/calculator/__main__.py rename to caimira/apps/calculator/__main__.py diff --git a/cara/apps/calculator/markdown_tools.py b/caimira/apps/calculator/markdown_tools.py similarity index 100% rename from cara/apps/calculator/markdown_tools.py rename to caimira/apps/calculator/markdown_tools.py diff --git a/cara/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py similarity index 98% rename from cara/apps/calculator/model_generator.py rename to caimira/apps/calculator/model_generator.py index 9f9dbce3..254ae02c 100644 --- a/cara/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -8,13 +8,13 @@ import json import numpy as np -from cara import models -from cara import data -import cara.data.weather -import cara.monte_carlo as mc +from caimira import models +from caimira import data +import caimira.data.weather +import caimira.monte_carlo as mc from .. import calculator -from cara.monte_carlo.data import activity_distributions, virus_distributions, mask_distributions, short_range_distances -from cara.monte_carlo.data import expiration_distribution, expiration_BLO_factors, expiration_distributions, short_range_expiration_distributions +from caimira.monte_carlo.data import activity_distributions, virus_distributions, mask_distributions, short_range_distances +from caimira.monte_carlo.data import expiration_distribution, expiration_BLO_factors, expiration_distributions, short_range_expiration_distributions LOG = logging.getLogger(__name__) @@ -330,7 +330,7 @@ class FormData: """ month = MONTH_NAMES.index(self.event_month) + 1 - timezone = cara.data.weather.timezone_at( + timezone = caimira.data.weather.timezone_at( latitude=self.location_latitude, longitude=self.location_longitude, ) # We choose the first of the month for the current year. @@ -351,7 +351,7 @@ class FormData: month = MONTH_NAMES.index(self.event_month) + 1 wx_station = self.nearest_weather_station() - temp_profile = cara.data.weather.mean_hourly_temperatures(wx_station[0], month) + temp_profile = caimira.data.weather.mean_hourly_temperatures(wx_station[0], month) _, utc_offset = self.tz_name_and_utc_offset() @@ -359,7 +359,7 @@ class FormData: # result the first data value may no longer be a midnight, and the hours # no longer ordered modulo 24). source_times = np.arange(24) + utc_offset - times, temp_profile = cara.data.weather.refine_hourly_data( + times, temp_profile = caimira.data.weather.refine_hourly_data( source_times, temp_profile, npts=24*10, # 10 steps per hour => 6 min steps @@ -418,9 +418,9 @@ class FormData: else: return models.MultipleVentilation((ventilation, infiltration_ventilation)) - def nearest_weather_station(self) -> cara.data.weather.WxStationRecordType: + def nearest_weather_station(self) -> caimira.data.weather.WxStationRecordType: """Return the nearest weather station (which has valid data) for this form""" - return cara.data.weather.nearest_wx_station( + return caimira.data.weather.nearest_wx_station( longitude=self.location_longitude, latitude=self.location_latitude ) diff --git a/cara/apps/calculator/report_generator.py b/caimira/apps/calculator/report_generator.py similarity index 99% rename from cara/apps/calculator/report_generator.py rename to caimira/apps/calculator/report_generator.py index 7ed38634..1a7cdf02 100644 --- a/cara/apps/calculator/report_generator.py +++ b/caimira/apps/calculator/report_generator.py @@ -11,8 +11,8 @@ import zlib import jinja2 import numpy as np -from cara import models -from cara.apps.calculator import markdown_tools +from caimira import models +from caimira.apps.calculator import markdown_tools from ... import monte_carlo as mc from .model_generator import FormData, _DEFAULT_MC_SAMPLE_SIZE from ... import dataclass_utils diff --git a/cara/apps/calculator/static/css/form.css b/caimira/apps/calculator/static/css/form.css similarity index 100% rename from cara/apps/calculator/static/css/form.css rename to caimira/apps/calculator/static/css/form.css diff --git a/cara/apps/calculator/static/css/report.css b/caimira/apps/calculator/static/css/report.css similarity index 96% rename from cara/apps/calculator/static/css/report.css rename to caimira/apps/calculator/static/css/report.css index fb0ff142..dd111aa5 100644 --- a/cara/apps/calculator/static/css/report.css +++ b/caimira/apps/calculator/static/css/report.css @@ -53,11 +53,6 @@ p.notes { font-size: 13px; } -#cara_logo { - height: 150px; - margin: 1% -} - #pdf_qrcode_aref { margin-right: 1%; width: 100pt; @@ -86,11 +81,7 @@ p.notes { border-radius: 5px; } -/* @media (width: 1200px) { */ @media print { - /* #body { - min-width: 1200px; - } */ #results, #rules, #data { diff --git a/cara/apps/calculator/static/images/disclaimer.jpg b/caimira/apps/calculator/static/images/disclaimer.jpg similarity index 100% rename from cara/apps/calculator/static/images/disclaimer.jpg rename to caimira/apps/calculator/static/images/disclaimer.jpg diff --git a/cara/apps/calculator/static/images/warning_scale/green-1.png b/caimira/apps/calculator/static/images/warning_scale/green-1.png similarity index 100% rename from cara/apps/calculator/static/images/warning_scale/green-1.png rename to caimira/apps/calculator/static/images/warning_scale/green-1.png diff --git a/cara/apps/calculator/static/images/warning_scale/orange-3.png b/caimira/apps/calculator/static/images/warning_scale/orange-3.png similarity index 100% rename from cara/apps/calculator/static/images/warning_scale/orange-3.png rename to caimira/apps/calculator/static/images/warning_scale/orange-3.png diff --git a/cara/apps/calculator/static/images/warning_scale/red-4.png b/caimira/apps/calculator/static/images/warning_scale/red-4.png similarity index 100% rename from cara/apps/calculator/static/images/warning_scale/red-4.png rename to caimira/apps/calculator/static/images/warning_scale/red-4.png diff --git a/cara/apps/calculator/static/images/warning_scale/yellow-2.png b/caimira/apps/calculator/static/images/warning_scale/yellow-2.png similarity index 100% rename from cara/apps/calculator/static/images/warning_scale/yellow-2.png rename to caimira/apps/calculator/static/images/warning_scale/yellow-2.png diff --git a/cara/apps/calculator/static/images/window_opening.png b/caimira/apps/calculator/static/images/window_opening.png similarity index 100% rename from cara/apps/calculator/static/images/window_opening.png rename to caimira/apps/calculator/static/images/window_opening.png diff --git a/cara/apps/calculator/static/images/window_type.PNG b/caimira/apps/calculator/static/images/window_type.PNG similarity index 100% rename from cara/apps/calculator/static/images/window_type.PNG rename to caimira/apps/calculator/static/images/window_type.PNG diff --git a/cara/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js similarity index 100% rename from cara/apps/calculator/static/js/form.js rename to caimira/apps/calculator/static/js/form.js diff --git a/cara/apps/calculator/static/js/report.js b/caimira/apps/calculator/static/js/report.js similarity index 100% rename from cara/apps/calculator/static/js/report.js rename to caimira/apps/calculator/static/js/report.js diff --git a/cara/apps/calculator/user.py b/caimira/apps/calculator/user.py similarity index 100% rename from cara/apps/calculator/user.py rename to caimira/apps/calculator/user.py diff --git a/cara/apps/expert.py b/caimira/apps/expert.py similarity index 99% rename from cara/apps/expert.py rename to caimira/apps/expert.py index d61365d5..d3740bbf 100644 --- a/cara/apps/expert.py +++ b/caimira/apps/expert.py @@ -11,7 +11,7 @@ import matplotlib.patches as patches from matplotlib import pyplot as plt import numpy as np -from cara import data, models, state +from caimira import data, models, state def collapsible(widgets_to_collapse: typing.List, title: str, start_collapsed=False): @@ -850,7 +850,7 @@ baseline_model = models.ExposureModel( ) -class CARAStateBuilder(state.StateBuilder): +class CAIMIRAStateBuilder(state.StateBuilder): # Note: The methods in this class must correspond to the *type* of the data classes. # For example, build_type__VentilationBase is called when dealing with ConcentrationModel # types as it has a ventilation: _VentilationBase field. @@ -928,7 +928,7 @@ class ExpertApplication(Controller): def build_new_model(self) -> state.DataclassInstanceState[models.ExposureModel]: default_model = state.DataclassInstanceState( models.ExposureModel, - state_builder=CARAStateBuilder(), + state_builder=CAIMIRAStateBuilder(), ) default_model.dcs_update_from(baseline_model) # For the time-being, we have to initialise the select states. Careful diff --git a/cara/apps/expert/cara.ipynb b/caimira/apps/expert/caimira.ipynb similarity index 79% rename from cara/apps/expert/cara.ipynb rename to caimira/apps/expert/caimira.ipynb index 31bcabf5..747ab1e9 100644 --- a/cara/apps/expert/cara.ipynb +++ b/caimira/apps/expert/caimira.ipynb @@ -7,7 +7,7 @@ "
\n", "
\n", "

\n", - "Please see the CARA homepage for details on the methodology, assumptions and limitations of CARA.

" + "Please see the CAiMIRA homepage for details on the methodology, assumptions and limitations of CAiMIRA.

" ] }, { @@ -21,9 +21,9 @@ }, "outputs": [], "source": [ - "import cara.apps\n", + "import caimira.apps\n", "\n", - "app = cara.apps.ExpertApplication()\n", + "app = caimira.apps.ExpertApplication()\n", "app.widget" ] } diff --git a/caimira/apps/expert/static/images/header_image.png b/caimira/apps/expert/static/images/header_image.png new file mode 100644 index 00000000..5f2a2702 Binary files /dev/null and b/caimira/apps/expert/static/images/header_image.png differ diff --git a/cara/apps/static/css/style.css b/caimira/apps/static/css/style.css similarity index 98% rename from cara/apps/static/css/style.css rename to caimira/apps/static/css/style.css index f619877f..fa7d0d11 100644 --- a/cara/apps/static/css/style.css +++ b/caimira/apps/static/css/style.css @@ -81,7 +81,7 @@ body { } .logo { - height: 6em; + height: 4em; } .logo_form { @@ -92,7 +92,7 @@ body { height: 10em; } -.cara_home_image { +.caimira_home_image { height: 18rem; padding: 1rem; border-radius: 1.25rem!important; @@ -258,11 +258,11 @@ footer img { font-size:1rem; font-weight:bold; } - .cara_version { + .caimira_version { float:left; font-size:1rem; } - .cara_home_image { + .caimira_home_image { float: right; } @@ -314,7 +314,7 @@ footer img { font-size:.75rem; font-weight:bold; } - .cara_version { + .caimira_version { float:left; font-size:.75rem; } diff --git a/cara/apps/static/icons/calculator.svg b/caimira/apps/static/icons/calculator.svg similarity index 100% rename from cara/apps/static/icons/calculator.svg rename to caimira/apps/static/icons/calculator.svg diff --git a/cara/apps/static/icons/expert.svg b/caimira/apps/static/icons/expert.svg similarity index 100% rename from cara/apps/static/icons/expert.svg rename to caimira/apps/static/icons/expert.svg diff --git a/cara/apps/static/images/CARA_1_Vs3_Colour.jpg b/caimira/apps/static/images/CAiMIRA_1_Vs3_Colour.jpg similarity index 100% rename from cara/apps/static/images/CARA_1_Vs3_Colour.jpg rename to caimira/apps/static/images/CAiMIRA_1_Vs3_Colour.jpg diff --git a/caimira/apps/static/images/caimira_full_logo.png b/caimira/apps/static/images/caimira_full_logo.png new file mode 100644 index 00000000..002529eb Binary files /dev/null and b/caimira/apps/static/images/caimira_full_logo.png differ diff --git a/caimira/apps/static/images/caimira_full_text.png b/caimira/apps/static/images/caimira_full_text.png new file mode 100644 index 00000000..5f2a2702 Binary files /dev/null and b/caimira/apps/static/images/caimira_full_text.png differ diff --git a/cara/apps/static/images/cara_logo.200x200.png b/caimira/apps/static/images/caimira_logo.200x200.png similarity index 100% rename from cara/apps/static/images/cara_logo.200x200.png rename to caimira/apps/static/images/caimira_logo.200x200.png diff --git a/caimira/apps/static/images/caimira_logo_white_text.png b/caimira/apps/static/images/caimira_logo_white_text.png new file mode 100644 index 00000000..82269b7f Binary files /dev/null and b/caimira/apps/static/images/caimira_logo_white_text.png differ diff --git a/cara/apps/static/images/long_range_anim.png b/caimira/apps/static/images/long_range_anim.png similarity index 100% rename from cara/apps/static/images/long_range_anim.png rename to caimira/apps/static/images/long_range_anim.png diff --git a/cara/apps/static/images/masks/ffp2.png b/caimira/apps/static/images/masks/ffp2.png similarity index 100% rename from cara/apps/static/images/masks/ffp2.png rename to caimira/apps/static/images/masks/ffp2.png diff --git a/cara/apps/static/images/masks/t1.png b/caimira/apps/static/images/masks/t1.png similarity index 100% rename from cara/apps/static/images/masks/t1.png rename to caimira/apps/static/images/masks/t1.png diff --git a/cara/apps/static/images/nat_vent_dimensions.png b/caimira/apps/static/images/nat_vent_dimensions.png similarity index 100% rename from cara/apps/static/images/nat_vent_dimensions.png rename to caimira/apps/static/images/nat_vent_dimensions.png diff --git a/cara/apps/static/images/short_range_anim.png b/caimira/apps/static/images/short_range_anim.png similarity index 100% rename from cara/apps/static/images/short_range_anim.png rename to caimira/apps/static/images/short_range_anim.png diff --git a/cara/apps/static/js/ScrollMagic.min.js b/caimira/apps/static/js/ScrollMagic.min.js similarity index 100% rename from cara/apps/static/js/ScrollMagic.min.js rename to caimira/apps/static/js/ScrollMagic.min.js diff --git a/cara/apps/static/js/jquery.colorbox-min.js b/caimira/apps/static/js/jquery.colorbox-min.js similarity index 100% rename from cara/apps/static/js/jquery.colorbox-min.js rename to caimira/apps/static/js/jquery.colorbox-min.js diff --git a/cara/apps/static/js/js_packaged_for_theme.js b/caimira/apps/static/js/js_packaged_for_theme.js similarity index 100% rename from cara/apps/static/js/js_packaged_for_theme.js rename to caimira/apps/static/js/js_packaged_for_theme.js diff --git a/cara/apps/static/js/usage-tracking.js b/caimira/apps/static/js/usage-tracking.js similarity index 91% rename from cara/apps/static/js/usage-tracking.js rename to caimira/apps/static/js/usage-tracking.js index 60ac23c5..830b9894 100644 --- a/cara/apps/static/js/usage-tracking.js +++ b/caimira/apps/static/js/usage-tracking.js @@ -1,4 +1,4 @@ -if (document.location.hostname == "test-cara.web.cern.ch") { +if (document.location.hostname == "caimira-test.web.cern.ch") { var _paq = _paq || []; if (typeof AuthUserDomain !== 'undefined') { _paq.push(["setCustomVariable", 1, "AuthUserDomain", AuthUserDomain, "visit"]); @@ -18,7 +18,7 @@ if (document.location.hostname == "test-cara.web.cern.ch") { g.src = u + "piwik.js"; s.parentNode.insertBefore(g, s); })(); -} else if (document.location.hostname == "cara.web.cern.ch") { +} else if (document.location.hostname == "caimira.web.cern.ch") { var _paq = _paq || []; if (typeof AuthUserDomain !== 'undefined') { _paq.push(["setCustomVariable", 1, "AuthUserDomain", AuthUserDomain, "visit"]); diff --git a/cara/apps/templates/about.html.j2 b/caimira/apps/templates/about.html.j2 similarity index 81% rename from cara/apps/templates/about.html.j2 rename to caimira/apps/templates/about.html.j2 index a35c1158..2ecce51d 100644 --- a/cara/apps/templates/about.html.j2 +++ b/caimira/apps/templates/about.html.j2 @@ -10,16 +10,16 @@ This pandemic clearly raised increased awareness on airborne transmission of res Out of the main modes of viral transmission, the airborne route of SARS-CoV-2 seems to have a significant importance to the spread of COVID-19 infections world-wide, hence proper guidance to building engineers or facility managers, on how to prevent on-site transmission, is essential.
For information on the Airborne Transmission of SARS-CoV-2, feel free to check out the special issue on the Interface Focus journal from Royal Society publishing: Interface Focus: Volume 12, Issue 2 and an CERN HSE Seminar: https://cds.cern.ch/record/2743403.


-

What is CARA?


-CARA stands for COVID Airborne Risk Assessment and was developed in the spring of 2020 to better understand and quantify the risk of long-range airborne spread of SARS-CoV-2 virus in workplaces. -Since then, the model has evolved and now is capable of simulating the short-range component. CARA comes with different applications that allow more or less flexibility in the input parameters: +

What is CAiMIRA?


+CAiMIRA stands for CERN Airborne Model for Indoor Risk Assessment, previously known as CARA - COVID Airborne Risk Assessment, developed in the spring of 2020 to better understand and quantify the risk of long-range airborne spread of SARS-CoV-2 virus in workplaces. +Since then, the model has evolved and now is capable of simulating the short-range component. CAiMIRA comes with different applications that allow more or less flexibility in the input parameters: The mathematical and physical model simulate the airborne spread of SARS-CoV-2 virus in a finite volume, assuming a homogenous mixture and a two-stage exhaled jet model, and estimates the risk of COVID-19 airborne transmission therein. The results DO NOT include other known modes of SARS-CoV-2 transmission. Hence, the output from this model is only valid when the other recommended public health & safety instructions are observed, such as good hand hygiene and other barrier measures.
-

The methodology, mathematical equations and parameters of the model are published here in the CARA paper: Modelling airborne transmission of SARS-CoV-2 using CARA: risk assessment for enclosed spaces.

+

The methodology, mathematical equations and parameters of the model are published here in a peer-reviewed paper: Modelling airborne transmission of SARS-CoV-2 using CARA: risk assessment for enclosed spaces.

The short-range component of the model was adapted from Jia et al. (2022) Exposure and respiratory infection risk via the short-range airborne route .

The model used is based on scientific publications relating to airborne transmission of infectious diseases, virology, epidemiology and aerosol science. It can be used to compare the effectiveness of different airborne-related risk mitigation measures. @@ -34,8 +34,8 @@ The methodology of the model is divided into five parts:
  • Estimating the probability of a COVID-19 infection (or secondary transmission) and the expected number of new cases arising from the event

  • -

    What is the aim of CARA?


    -Although the user is able to calculate the infection probability of a stand-alone event with a pre-defined set of protection measures, the main utility of CARA is to compare the relative impact of different measures and/or combination of measure. For example: +

    What is the aim of CAiMIRA?


    +Although the user is able to calculate the infection probability of a stand-alone event with a pre-defined set of protection measures, the main utility of CAiMIRA is to compare the relative impact of different measures and/or combination of measure. For example: - Refer to COVID Calculator App user guide + Refer to Calculator App user guide for more detailed explanations on how to use this tool.
    diff --git a/cara/apps/templates/base/calculator.report.html.j2 b/caimira/apps/templates/base/calculator.report.html.j2 similarity index 99% rename from cara/apps/templates/base/calculator.report.html.j2 rename to caimira/apps/templates/base/calculator.report.html.j2 index 7f270e86..17d219ca 100644 --- a/cara/apps/templates/base/calculator.report.html.j2 +++ b/caimira/apps/templates/base/calculator.report.html.j2 @@ -4,7 +4,7 @@ - Report | CARA (COVID Airborne Risk Assessment) + Report | CAiMIRA (CERN Airborne Model for Indoor Risk Assessment) @@ -16,7 +16,7 @@ - diff --git a/cara/apps/templates/base/index.html.j2 b/caimira/apps/templates/base/index.html.j2 similarity index 79% rename from cara/apps/templates/base/index.html.j2 rename to caimira/apps/templates/base/index.html.j2 index e24eb618..68727548 100644 --- a/cara/apps/templates/base/index.html.j2 +++ b/caimira/apps/templates/base/index.html.j2 @@ -4,8 +4,8 @@ {% block main %}
    - - + +
    @@ -18,19 +18,19 @@

    Introduction


    - CARA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. + CAiMIRA is a risk assessment tool developed to model the concentration of viruses in enclosed spaces, in order to inform space-management decisions. It does this by simulating the airborne spread SARS-CoV-2 virus in a finite volume, assuming homogenous mixing for the long-range component and a two-stage jet model for short-range, and estimates the risk of COVID-19 airborne transmission therein. - Please see the About page for more details on the methodology, assumptions and limitations of CARA. + Please see the About page for more details on the methodology, assumptions and limitations of CAiMIRA.

    - The full CARA source code can be accessed freely under an Apache 2.0 open source license from our code repository. + The full CAiMIRA source code can be accessed freely under an Apache 2.0 open source license from our code repository. It includes detailed instructions on how to run your own version of this tool.


    - +

    @@ -46,14 +46,14 @@
    - {% block cara_at_cern %} - {% endblock cara_at_cern %} + {% block caimira_at_cern %} + {% endblock caimira_at_cern %}

    Reference & Citation


    - For use of the CARA model:
    + For use of the CAiMIRA model:

    - For use of the CARA web app:
    + For use of the CAiMIRA web app: