-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from glormph/deploy-change-to-different-setup-vms
Deploy change to different setup
- Loading branch information
Showing
51 changed files
with
665 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
--- | ||
- import_playbook: analysis_stop.yml | ||
- import_playbook: analysis_update.yml | ||
- import_playbook: analysis_start.yml | ||
- hosts: analysis | ||
remote_user: "{{ analysis_connect_user }}" | ||
tasks: | ||
- name: Stop running workers | ||
ansible.builtin.import_tasks: | ||
file: stop_celery.yml | ||
|
||
- name: Specific analysis tasks | ||
ansible.builtin.import_tasks: | ||
file: analysis_tasks.yml | ||
|
||
- name: General kantele/celery updates | ||
ansible.builtin.import_tasks: | ||
file: update_analysis_storage_tasks.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
# Tasks to only run once when you get a provisioned VM | ||
# Installs packages, nextflow and prepares directories. | ||
# | ||
# Upgrading of these can later be done in another playbook (or in code) | ||
|
||
- hosts: analysis | ||
remote_user: '{{ analysis_connect_user }}' | ||
become: yes | ||
tasks: | ||
- name: Install packages | ||
ansible.builtin.apt: | ||
pkg: | ||
- git | ||
- docker.io | ||
- docker-compose-v2 | ||
- default-jre-headless | ||
- python3-venv | ||
- libpq-dev | ||
- python3-dev | ||
- build-essential | ||
- cifs-utils | ||
- slurm-wlm | ||
- slurm-client | ||
- slurmdbd | ||
- munge | ||
- mariadb-server | ||
- python3-mysqldb | ||
state: present | ||
update_cache: yes | ||
|
||
- name: Create kantele group | ||
ansible.builtin.group: | ||
name: "{{ kantelegroup }}" | ||
state: present | ||
|
||
- name: Create kantele user | ||
ansible.builtin.user: | ||
name: "{{ kanteleuser }}" | ||
group: "{{ kantelegroup }}" | ||
create_home: yes | ||
|
||
- name: Download nextflow | ||
become_user: "{{ kanteleuser }}" | ||
ansible.builtin.shell: | ||
cmd: "curl -s https://get.nextflow.io | bash" | ||
chdir: "/home/{{ kanteleuser }}" | ||
|
||
- name: Put NF in path | ||
ansible.builtin.copy: | ||
src: "/home/{{ kanteleuser }}/nextflow" | ||
dest: /usr/local/bin/nextflow | ||
mode: u=rwx,g=rx,a=rx | ||
owner: kanteleadmin | ||
group: kanteleadmin | ||
remote_src: yes |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
--- | ||
# Tasks for analysis node | ||
# | ||
- name: Create scratch dir for running | ||
become: yes | ||
ansible.builtin.file: | ||
path: "{{ baserun_dir }}" | ||
state: directory | ||
owner: "{{ kanteleuser }}" | ||
group: "{{ kanteleuser }}" | ||
|
||
- name: Mount storages | ||
become: yes | ||
mount: | ||
path: "{{ item.0 }}" | ||
src: "{{ item.1 }}" | ||
state: mounted | ||
fstype: cifs | ||
opts: "credentials={{ mount_cred }},uid={{ kanteleuser }},domain={{ mount_domain }}" | ||
loop: "{{ storagedirs | zip(storageservers) | list }}" | ||
|
||
- name: Set mariaDB root password | ||
become: yes | ||
community.mysql.mysql_user: | ||
name: root | ||
host: "{{ item }}" | ||
password: "{{ slurm_mysql_root_passwd }}" | ||
with_items: | ||
- localhost | ||
# Default is no remote access, so do not set root password for below interfaces | ||
#- 127.0.0.1 | ||
#- ::1 | ||
|
||
- name: Set ~/.my.cnf file with root pass so prev task does not error on idempotent multiple runs | ||
become: yes | ||
template: | ||
src: slurm_mariadb_my.cnf.j2 | ||
dest: /root/.my.cnf | ||
mode: 0600 | ||
|
||
- name: Slurm config file | ||
become: yes | ||
ansible.builtin.template: | ||
src: slurm_conf.j2 | ||
dest: /etc/slurm/slurm.conf | ||
mode: '755' | ||
owner: slurm | ||
|
||
- name: Slurm DBD config file | ||
become: yes | ||
ansible.builtin.template: | ||
src: slurmdbd.conf.j2 | ||
dest: /etc/slurm/slurmdbd.conf | ||
mode: '600' | ||
owner: slurm | ||
|
||
- name: Create Slurm dir in spool | ||
become: yes | ||
ansible.builtin.file: | ||
path: /var/spool/slurm | ||
state: directory | ||
owner: slurm | ||
group: slurm | ||
|
||
- name: Set Slurm user in mariaDB | ||
become: yes | ||
community.mysql.mysql_user: | ||
login_user: root | ||
login_password: "{{ slurm_mysql_root_passwd }}" | ||
host: localhost | ||
name: slurm | ||
password: "{{ slurm_mysql_user_passwd }}" | ||
priv: 'slurm_acct.*:ALL' | ||
|
||
- name: Start Slurm | ||
become: yes | ||
systemd: | ||
state: started | ||
enabled: true | ||
daemon_reload: yes | ||
name: "{{ item }}" | ||
with_items: | ||
- munge | ||
- slurmctld | ||
- slurmd | ||
- slurmdbd | ||
|
||
- name: Get QOS in slurm | ||
ansible.builtin.shell: | ||
cmd: "sacctmgr show qos filter name=qc" | ||
register: qos_qc | ||
|
||
- name: Set QOS in slurm if not set | ||
become: yes | ||
become_user: slurm | ||
ansible.builtin.shell: | ||
cmd: "{{ item }}" | ||
# 3 lines if exists: headerfields, header-separator-horizontal-line, row-with-qc-qos | ||
# so only run if 2 lines (no row-with-qc-qos) | ||
when: qos_qc.stdout_lines | length == 2 | ||
# -i is for immediate (no prompt y/n) | ||
with_items: | ||
- "sacctmgr -i add qos qc" | ||
- "sacctmgr -i modify qos qc set priority=100" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
celery_env_template_file: celery_analysis_env.j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
celery_env_template_file: celery_storage_env.j2 | ||
|
||
tivoli_client_url: "https://aix.software.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/LinuxX86_DEB/BA/v8122/8.1.22.0-TIV-TSMBAC-LinuxX86_DEB.tar" | ||
|
||
dsm_dir: "{{ homedir }}/dsmc_conf" |
Oops, something went wrong.