Skip to content

Commit

Permalink
Creating playbook for filling file server
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Apr 18, 2024
1 parent 9cec3c1 commit b20640d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@ Each collaborative organization should run a single file server. This file serve
3. Restart samba server with `systemctl restart smbd`
7. Populate `/data/volume_2/samba-share/` directory with training material. This directory will be shared with other machines.

Populating can be done with a Ansible playbook (this could be run during workspace creation, but downloads are very flaky and time consuming).

```shell
sudo -i
git clone -b grader-samba https://github.com/eWaterCycle/infra.git /opt/infra
ansible-playbook /opt/infra/playbooks/shared-data-disk.yml
```

This will:
0. Harden the share, so only root can write in /data/volume_2/samba-share/ and its readonly
1. Download Apptainer images for models
2. Downloads Camels dataset (https://data.4tu.nl/datasets/ca13056c-c347-4a27-b320-930c2a4dd207)
3. Setup era5cli to download era5 data
4. Setup cds to download cmip data
5. Setup rclone for copying data from dcache to file server
6. Create a ewatercycle.yaml which can be used on the Jupyter machines.
7. Create a esmvaltool config file which can be used on the Jupyter machines.

## eWaterCycle machine

1. Create a new workspace
Expand Down
33 changes: 23 additions & 10 deletions shared-data-disk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@
# dCache token for uploading files
dcache_rw_token: null # Must be filled from command line
tasks:
- name: apptainer
include_role:
name: apptainer
- name: Harden share
file:
path: '/data/volume_2/samba-share/'
state: directory
mode: 0755

- name: Install conda
include_role:
name: conda
- name: Read-only share
lineinfile:
path: /etc/samba/smb.conf
line: "read only = yes"
regexp: "^\s+read only ="
insertafter: '[samba-share]'
notify: restart samba

- name: Create eWaterCycle conda env
# Apptainer is need to build apptainer images from Docker
- name: apptainer
include_role:
name: ewatercycle
name: apptainer

- name: Prepare shared data
include_role:
Expand All @@ -33,7 +40,13 @@
include_role:
name: grdc

- name: Upload to dcache with rclone
- name: Install rclone
include_role:
name: rclone
tasks_from: upload
tasks_from: install

handlers:
- name: restart samba
service:
name: smbd
state: restarted

0 comments on commit b20640d

Please sign in to comment.