diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 881bcbead8912eb027aed9e96b1f2b9b57366f1d..c3deb354b68c2ad39fe70542457009cc50d9bd3c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -139,6 +139,11 @@ msvc_16: build_singularity_image: stage: build + + tags: + - priviliged + - linux + rules: - if: $CI_COMMIT_TAG @@ -418,7 +423,7 @@ vf_to_phoenix: - pip3 install ansible script: - - ansible-playbook -i ansible/hosts.cfg -u $REMOTE_USER ansible/playbook.yml + - ansible-playbook -i ansible/hosts.cfg -u $REMOTE_USER ansible/playbook_vf_deploy.yml parallel: matrix: diff --git a/ansible/hosts.cfg b/ansible/hosts.cfg index 259f123d255fdf1979baf0df55eae986ef76749a..160b8a1967c07bf852daa35ae0704fd9a63a77ec 100644 --- a/ansible/hosts.cfg +++ b/ansible/hosts.cfg @@ -5,4 +5,6 @@ phoenix.hlr.rz.tu-bs.de ansible_ssh_private_key_file=./private_key [gitlab_ci_deploy_cppcheck] elladan.irmb.bau.tu-bs.de [gitlab_ci_deploy_gcov] -elladan.irmb.bau.tu-bs.de \ No newline at end of file +elladan.irmb.bau.tu-bs.de +[gitlab_ci_deploy_wheel] +finrod.irmb.bau.tu-bs.de \ No newline at end of file diff --git a/ansible/playbook_jupyter_update.yml b/ansible/playbook_jupyter_update.yml new file mode 100644 index 0000000000000000000000000000000000000000..4e5f6a9c53960e97f5157f874e4b2cad0641eb7a --- /dev/null +++ b/ansible/playbook_jupyter_update.yml @@ -0,0 +1,51 @@ +- hosts: local + vars: + host_home: "/home/{{ lookup('env', 'jupyter_host') }}" + + tasks: + + - name: Find container IDs with image name + become: yes + shell: docker ps -a --format {% raw %}'{{.ID}} {{.Image}}'{% endraw %} | grep pyfluids-jupyter | awk '{ print $1 }' + register: container_ids + + - name: Stop and remove docker spawner containers + become: yes + community.general.docker_container: + name: "{{ item }}" + state: absent + loop: "{{ container_ids.stdout_lines }}" + + - name: Remove old docker spawner image + become: yes + community.general.docker_image: + name: pyfluids-jupyter + state: absent + + - name: Find pyfluids wheel + find: + path: "{{ host_home }}/jupyterhub/DockerSpawnerImage/wheels/" + patterns: pyfluids*.whl + register: find_pyfluids + + - name: Remove old pyfluids wheel + file: + path: "{{ item }}" + state: absent + loop: "{{ find_pyfluids.files }}" + + - name: Copy new wheels to docker spawner image + synchronize: + src: ../dist/ + dest: "{{ host_home }}/jupyterhub/DockerSpawnerImage/wheels/" + rsync_opts: + - "--include='*.whl'" + + - name: Build docker spawner image again + become: yes + community.general.docker_image: + name: pyfluids-jupyter + source: build + build: + dockerfile: "{{ host_home }}/jupyterhub/DockerSpawnerImage/Dockerfile" + path: "{{ host_home }}/jupyterhub/DockerSpawnerImage/" diff --git a/ansible/playbook.yml b/ansible/playbook_vf_deploy.yml similarity index 100% rename from ansible/playbook.yml rename to ansible/playbook_vf_deploy.yml