From 1e5f8e5c47a6dcd5b5477c8bf9958834cfe43267 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 14 Nov 2023 09:38:56 +1300 Subject: [PATCH 1/5] fix ansible command in redeploy ml102 --- .github/workflows/redeploy-ml102.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/redeploy-ml102.yml b/.github/workflows/redeploy-ml102.yml index d139d32..05d51d0 100644 --- a/.github/workflows/redeploy-ml102.yml +++ b/.github/workflows/redeploy-ml102.yml @@ -115,7 +115,7 @@ jobs: WILD_CERT_KEY_BASE64: "${{ secrets.WILD_CERT_KEY_BASE64 }}" - name: Redeploy ML102 - run: ansible-playbook redeploy-ml102.yml + run: ansible-playbook -i host.ini redeploy-ml102.yml -u "${TF_VAR_vm_user}" --key-file '${TF_VAR_key_file}' -e terraform_workspace="${GITHUB_BASE_REF:-$GITHUB_REF_NAME}" env: TF_VAR_key_file: "${{ runner.temp }}/my_ci_private_key" ANSIBLE_HOST_KEY_CHECKING: "False" From 8d12a24925c8497fc90ed986790ead93d4f1eabc Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 14 Nov 2023 11:18:31 +1300 Subject: [PATCH 2/5] redeploying ml102 playbook --- redeploy-ml102.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/redeploy-ml102.yml b/redeploy-ml102.yml index d25f64d..e77004f 100644 --- a/redeploy-ml102.yml +++ b/redeploy-ml102.yml @@ -1,8 +1,8 @@ # workflow to redploy ML102 on the training environment # # 1. Get the list of all training/trainer home directories -# 2. Delete any "ml102_workshop" directories in the homes -# 3. Delete the ML102 apptainer image +# 2. Remove any "ml102_workshop" directories in the homes +# 3. Remove the ML102 apptainer image # 4. Pull the apptainer image # # Following this, any user that starts a new ML102 session @@ -10,10 +10,10 @@ # # Note: this doesn't redeploy the OOD ML102 app --- -- name: Get list of home directories on ML102 node +- name: Redeploy ML102 become: yes hosts: webnode - tasks: + pre_tasks: - name: List home directories find: paths: /home/shared @@ -24,3 +24,17 @@ - debug: var: item.path with_items: "{{ homes_find.files }}" + + - name: Remove any ML102 directories in homes + anisble.builtin.file: + path: "{{ item.path }}/ml102_workshop" + state: absent + with_items: "{{ homes_find.files }}" + + - name: Remove the ML102 apptainer image + ansible.builtin.file: + path: /opt/ml102_workshop/ML102.sif + state: absent + + roles: + - ml102_workshop From d6fa41fadd0052f80027c1ebaae00397667ddde1 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 14 Nov 2023 11:20:22 +1300 Subject: [PATCH 3/5] typo --- redeploy-ml102.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redeploy-ml102.yml b/redeploy-ml102.yml index e77004f..68d4cef 100644 --- a/redeploy-ml102.yml +++ b/redeploy-ml102.yml @@ -26,7 +26,7 @@ with_items: "{{ homes_find.files }}" - name: Remove any ML102 directories in homes - anisble.builtin.file: + ansible.builtin.file: path: "{{ item.path }}/ml102_workshop" state: absent with_items: "{{ homes_find.files }}" From 7368a773efa475e3070e6c07da6b2cf85bcdaea3 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 14 Nov 2023 11:27:13 +1300 Subject: [PATCH 4/5] working on redeploy, recurse --- redeploy-ml102.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/redeploy-ml102.yml b/redeploy-ml102.yml index 68d4cef..bd06ea7 100644 --- a/redeploy-ml102.yml +++ b/redeploy-ml102.yml @@ -29,6 +29,7 @@ ansible.builtin.file: path: "{{ item.path }}/ml102_workshop" state: absent + recurse: yes with_items: "{{ homes_find.files }}" - name: Remove the ML102 apptainer image From 7aeafa7ace6a7c09a981cf84266b0079dd357103 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 14 Nov 2023 11:45:56 +1300 Subject: [PATCH 5/5] remove homes on servicesnode for redeploy --- redeploy-ml102.yml | 18 ++++++++---------- roles/nfs_homes_server/templates/exports.j2 | 3 +-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/redeploy-ml102.yml b/redeploy-ml102.yml index bd06ea7..fe48730 100644 --- a/redeploy-ml102.yml +++ b/redeploy-ml102.yml @@ -10,32 +10,30 @@ # # Note: this doesn't redeploy the OOD ML102 app --- -- name: Redeploy ML102 +- name: Clean ML102 directories in homes become: yes - hosts: webnode - pre_tasks: + hosts: servicesnode + tasks: - name: List home directories find: - paths: /home/shared + paths: /srv/homes file_type: directory recurse: no register: homes_find - - debug: - var: item.path - with_items: "{{ homes_find.files }}" - - name: Remove any ML102 directories in homes ansible.builtin.file: path: "{{ item.path }}/ml102_workshop" state: absent - recurse: yes with_items: "{{ homes_find.files }}" +- name: Redeploy ML102 image + become: yes + hosts: webnode + pre_tasks: - name: Remove the ML102 apptainer image ansible.builtin.file: path: /opt/ml102_workshop/ML102.sif state: absent - roles: - ml102_workshop diff --git a/roles/nfs_homes_server/templates/exports.j2 b/roles/nfs_homes_server/templates/exports.j2 index a257964..829f48a 100644 --- a/roles/nfs_homes_server/templates/exports.j2 +++ b/roles/nfs_homes_server/templates/exports.j2 @@ -8,5 +8,4 @@ # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # -# TODO: variable for hostname -{{ nfs_remote_homes }} 10.1.0.0/24(rw,sync,no_subtree_check) +{{ nfs_remote_homes }} 10.1.0.0/24(rw,sync,no_subtree_check,no_root_squash)