-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision_optuna_cluster.ansible.yml
89 lines (77 loc) · 1.86 KB
/
provision_optuna_cluster.ansible.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
- name: provision cluster
hosts: all
tasks:
- name: add python repo
ansible.builtin.apt_repository:
repo: ppa:deadsnakes/ppa
update_cache: yes
become: true
- name: update packages
ansible.builtin.apt:
upgrade: yes
update_cache: no
become: true
- name: install python 3.11
ansible.builtin.apt:
pkg:
- python3.11
- python3.11-dev
become: true
- name: install utilities
ansible.builtin.apt:
pkg:
- screen
- python3-pip
- htop
- build-essential
- libmysqlclient-dev
- pkg-config
become: true
- name: copy code files to cluster
ansible.builtin.copy:
src: "{{item}}"
dest: code/
with_items:
- main_notebook.ipynb
- pipeline_pandas_utils.py
- requirements.txt
- performance_files
- submission_files
- submission-100.csv
- name: configure htop
ansible.builtin.copy:
src: htoprc
dest: ~/.config/htop/
- name: copy dataset to cluster
ansible.builtin.copy:
src: ../input
dest: ~/
- name: install pip for python 3.11
ansible.builtin.shell:
cmd: python3.11 -m pip install --upgrade --user pip
creates: ~/.local/bin/pip3.11
- name: install helper python modules
ansible.builtin.pip:
name:
- wheel
- setuptools
executable: ~/.local/bin/pip3.11
extra_args: --user
- name: install python modules
ansible.builtin.pip:
requirements: ~/code/requirements.txt
executable: ~/.local/bin/pip3.11
extra_args: --user
- name: create run script
ansible.builtin.template:
src: run_headless.sh
dest: ~/code/run_headless.sh
mode: 0755
tags:
- "run_code"
- name: run code
ansible.builtin.shell:
cmd: screen -dm -S notebook ./run_headless.sh
chdir: code
tags:
- "run_code"