diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffae54a2a051a379e1e07b0df051f6a6356aa142..f371db0ad9a35fdefe8ebe779814ac82dc70761d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ test: - airflow dags test testdag 2021-08-18 - nosetests -full-deploy-test: +full-deploy-testing: stage: deploy environment: Testing only: @@ -61,6 +61,22 @@ full-deploy-test: - openstack server add floating ip $INSTANCE_ID $TESTING_IP - echo "Done" +# TODO test light deployment +light-deploy-testing: + stage: deploy + # only run when master is updated, unless the pipeline was triggered via the web UI + only: + - master + - mptest + except: + - tags + - web + <<: *ssh_setup + environment: Testing + script: + - ssh -oStrictHostKeyChecking=accept-new airflow@$TESTING_IP "cd /home/airflow/data-logistics-service && sudo git stash && sudo git pull --all && sudo git checkout -f $CI_COMMIT_TAG && sudo git stash clear" + - ssh -oStrictHostKeyChecking=accept-new airflow@$TESTING_IP "sudo /home/airflow/data-logistics-service/scripts/deployment.sh /home/airflow /home/airflow/data-logistics-service" + test-testing_dags: cache: {} stage: test-deployment diff --git a/dockers/README.md b/dockers/README.md index 1cb752d4e3d406c64804060e72512cd31d2d0656..971d8d40abf060a4569eb0b687b22f7e76bfb317 100644 --- a/dockers/README.md +++ b/dockers/README.md @@ -3,11 +3,4 @@ ### Footer The DLS Service has a custom footer to contribute to the consortium image of the eFlows Project. The design of the custom footer is part of templates/main.html. This file is being injected as a volume in docker-compose.yaml, thus overriding the existing template from the public airflow image. For testing reasons, the path has been hard-coded in the docker-compose.yaml. -### Updates - Taking a hard-coded path approach means that with every update of the official airflow image, the currect main.html file has to be pulled anew from the official container. - - For example: - - ```docker exec airflow_airflow-webserver_1 find /home/airflow/ | grep main.html ``` - - Copy this file into the local repository and substitute the ```<footer>``` section with the custom DLS ```%footer%``` block. In case of a new python version in the official airflow image (and container) you will need to adjust the new path in the volume section of the docker-compose.yaml. \ No newline at end of file +**NOTE** When upgrading the airflow docker image, you have to make sure to correct the main.html by extracting and adjuting the latest version of the file from the airflow official repository. *For more details, please refer to the README file in the folder ```/templates```*. \ No newline at end of file diff --git a/dockers/docker-compose.yaml b/dockers/docker-compose.yaml index 24c78d4b44dc381c2382b39ca5ffea88c6c44a14..e5e483bf4b64d9d1604f5550cee63829df351510 100644 --- a/dockers/docker-compose.yaml +++ b/dockers/docker-compose.yaml @@ -44,7 +44,7 @@ x-airflow-common: # In order to add custom dependencies or upgrade provider packages you can use your extended image. # Comment the image line, place your Dockerfile in the directory where you placed the docker-compose.yaml # and uncomment the "build" line below, Then run `docker-compose build` to build the images. - image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.2.1} + image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.2.3} # build: . environment: &airflow-common-env diff --git a/scripts/deployment.sh b/scripts/deployment.sh index b17c3cd6491c949e127c6b814ffb35e935fb15f6..810e1adc739b08bced4930ff09213089a70f5b7e 100755 --- a/scripts/deployment.sh +++ b/scripts/deployment.sh @@ -2,7 +2,7 @@ # @author Maria Petrova & Christian Böttcher ## USAGE: # -# deployment.sh <project_directory> <git_directory> [API_URL] [SERVER_DOMAIN] +# deployment.sh <user_home_directory> <git_directory> [API_URL] [SERVER_DOMAIN] OLD_DIR=`pwd` GIT_REPO=$HOME/data-logistics-service @@ -19,8 +19,8 @@ echo "DEBUG_2 $0 $1 $2 $3 $4" echo "DEBUG values: OLD_DIR=$OLD_DIR, ENTRYPOINT_DIR=$ENTRYPOINT and GIT_REPO=$GIT_REPO" cd $ENTRYPOINT -mkdir -p airflow_proj -cd airflow_proj +mkdir -p eflows-airflow +cd eflows-airflow AIRFLOW_DIR=`pwd` #DEBUG prints echo "Project dir is set to: $AIRFLOW_DIR" diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c94ee42b0a2e219a740e22eff53f74e53b83f238 --- /dev/null +++ b/templates/README.md @@ -0,0 +1,14 @@ +# Maintenance for customizations + +### Footer +The DLS Service has a custom footer to contribute to the consortium image of the eFlows Project. The design of the custom footer is part of templates/main.html. This file is being injected as a volume in docker-compose.yaml, thus overriding the existing template from the public airflow image. For testing reasons, the path has been hard-coded in the docker-compose.yaml. + +### Updates + Taking a hard-coded path approach means that with every update of the official airflow image, or an upgrade of the python version for the official image, the currect main.html file has to be pulled anew from the official airflow repository with the corresponding version. For Version 2.2.3 that would be -> https://github.com/apache/airflow/blob/2.2.3/airflow/www/templates/airflow/main.html + You will also need the copy the script under ```<!-- CUSTOM FOOTER SCRIPT -->```, which assures the responsive display of the footer. + + *An example of how to locate the main.html file in a running docker webserver container:* + + ```docker exec airflow_airflow-webserver_1 find /home/airflow/ | grep main.html ``` + + Copy this file into the local repository and substitute the ```<footer>``` section with the custom DLS ```%footer%``` block. In case of a new python version in the official airflow image (and container) you will need to adjust the new path in the volume section of the docker-compose.yaml. \ No newline at end of file diff --git a/templates/main.html b/templates/main.html index 66297ddaef85744f91a03518498b5a0775ba1319..7321501dbd85efc9a5b4e4eaf96caf1b1a1e52b7 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,3 +1,4 @@ + {# Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -18,7 +19,7 @@ #} {% extends 'appbuilder/baselayout.html' %} -{% from 'airflow/_messages.html' import message %} +{% from 'airflow/_messages.html' import show_message %} {% block page_title -%} {% if title is defined -%} @@ -52,7 +53,7 @@ {% block messages %} {% include 'appbuilder/flash.html' %} {% if scheduler_job is defined and (not scheduler_job or not scheduler_job.is_alive()) %} - {% call message(category='warning', dismissable=false) %} + {% call show_message(category='warning', dismissible=false) %} <p>The scheduler does not appear to be running. {% if scheduler_job %} Last heartbeat was received @@ -67,7 +68,7 @@ {% endcall %} {% endif %} {% if triggerer_job is defined and (not triggerer_job or not triggerer_job.is_alive()) %} - {% call message(category='warning', dismissable=false) %} + {% call show_message(category='warning', dismissible=false) %} <p>The triggerer does not appear to be running. {% if triggerer_job %} Last heartbeat was received @@ -143,6 +144,7 @@ var csrfToken = '{{ csrf_token() }}'; $('time[title]').tooltip(); </script> + <!-- CUSTOM FOOTER SCRIPT --> <!-- Calculate the size of the dynamic footer to make sure that it doesn't cover the content of the page. Helps also on mobile devices. --> <script> function footerAlign() {