-
Notifications
You must be signed in to change notification settings - Fork 2
/
coldwarm_pretask.yml
50 lines (50 loc) · 1.94 KB
/
coldwarm_pretask.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
- hosts: all
tasks:
- name: Stop Pulsar
service:
name: pulsar
state: stopped
become: yes
- name: Create old-folder for old _conda folders
file:
path: "{{tool_dependency_dir}}/old"
state: directory
- name: Check if base dependencies folder already exists
stat:
path: "{{tool_dependency_dir}}/_conda-base"
register: conda_base_directory
- name: Check if _conda folder already exists
stat:
path: "{{tool_dependency_dir}}/_conda"
register: conda_directory
- name: Move _conda to old-folder, so it can be removed at the end of benchmark (to speedup benchmark)
command: "mv {{tool_dependency_dir}}/_conda {{tool_dependency_dir}}/old/_conda-{{ansible_date_time.iso8601_basic_short}}"
when: conda_directory.stat.exists and conda_directory.stat.isdir
- name: Delete conda.lock in tool_dependency_dir
file:
path: "{{tool_dependency_dir}}/conda.lock"
state: absent
- name: Copy _conda-base to _conda (to speed up Pulsar-Startup)
command: "cp {{tool_dependency_dir}}/_conda-base/ {{tool_dependency_dir}}/_conda/ -R"
when: conda_base_directory.stat.exists and conda_base_directory.stat.isdir
- name: Delete persisted_data-folder
file:
path: "{{persistence_dir}}"
state: absent
- name: Delete staging-folder
file:
path: "{{jobs_directory_dir}}"
state: absent
ignore_errors: yes
- name: Start Pulsar
service:
name: pulsar
state: started
become: yes
- name: Pause for 10 minutes, so Pulsar has time to install all base dependencies
pause:
minutes: 10
when: conda_base_directory.stat.exists == False
- name: Copy _conda to _conda-base to speedup future Pulsar-Startups
command: "cp {{tool_dependency_dir}}/_conda/ {{tool_dependency_dir}}/_conda-base/ -R"
when: conda_base_directory.stat.exists == False