-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
157 lines (144 loc) · 3.4 KB
/
docker-compose.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: "3.7"
services:
mysql-srv: # the -srv is to distinguish between the service name and the hostname. See https://stackoverflow.com/a/76966725/3949036
image: mysql:5.7
hostname: mysql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: slurm_acct_db
MYSQL_USER: slurm
MYSQL_PASSWORD: password
volumes:
- var_lib_mysql:/var/lib/mysql
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- "node.labels.slurm_role==head_node"
slurmdbd-srv:
image: cfiddle-cluster:latest
build:
context: .
command: ["slurmdbd"]
hostname: slurmdbd
volumes:
- etc_munge:/etc/munge
- var_log_slurm:/var/log/slurm
depends_on:
- mysql-srv
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- "node.labels.slurm_role==head_node"
slurmctld-srv:
image: cfiddle-cluster:latest
command: ["slurmctld"]
hostname: slurmctld
volumes:
- etc_munge:/etc/munge
- slurm_jobdir:/data
- var_log_slurm:/var/log/slurm
depends_on:
- slurmdbd-srv
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- "node.labels.slurm_role==head_node"
userhost-srv:
build:
context: .
dockerfile: ./user.Dockerfile
image: cfiddle-user:latest
environment:
DELEGATE_FUNCTION_DEBUG_ENABLED: "yes"
DOCKER_STACKS_JUPYTER_CMD: "notebook"
hostname: userhost
command: ["start-notebook.sh", "--NotebookApp.token='slurmify'" ]
user: root
# working_dir: /home/jovyan
init: true
ports:
- "8888:8888"
volumes:
- home_nfs:/home
- etc_munge:/etc/munge
depends_on:
- slurmctld-srv
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- "node.labels.slurm_role==head_node"
c1-srv: &worker
image: cfiddle-cluster:latest
command: ["slurmd"]
environment:
DELEGATE_FUNCTION_DEBUG_ENABLED: "yes"
hostname: c1
volumes:
- etc_munge:/etc/munge
- var_log_slurm:/var/log/slurm
- home_nfs:/home
- cfiddle_scratch:/cfiddle_scratch
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
cap_add:
- ALL
depends_on:
- slurmctld-srv
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- "node.labels.slurm_role==worker"
c2-srv: &c2
<<: *worker
hostname: c2
sandbox-dummy: # this is just here to build the image. It'll get spawned by the worker node.
image: cfiddle-sandbox:latest
environment:
DELEGATE_FUNCTION_DEBUG_ENABLED: "yes"
build:
context: .
dockerfile: ./sandbox.Dockerfile
deploy:
replicas: 0
# c3: &c3
# <<: *worker
# hostname: c3##
# c4: &c4
# <<: *worker
# hostname: c4
# c6: &c6
# <<: *worker
# hostname: c6
# c5: &c5
# <<: *worker
# hostname: c5
volumes:
etc_munge:
driver: local
driver_opts:
type: nfs
o: addr=${HEAD_ADDR},nolock,soft,ro
device: :/etc/munge
etc_slurm:
slurm_jobdir:
cfiddle_scratch:
var_lib_mysql:
var_log_slurm:
home_nfs:
driver: local
driver_opts:
type: nfs
o: addr=${HEAD_ADDR},nolock,soft,rw
device: :/home
#mount nfs-server:/users_home /tmp/mnt -o nolock