forked from ubccr/hpc-toolset-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpcts
executable file
·47 lines (40 loc) · 1010 Bytes
/
hpcts
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
#!/bin/bash
log_info() {
printf "\n\e[0;35m $1\e[0m\n\n"
}
start() {
log_info "Fetching latest HPC Toolset Images.."
docker-compose pull
log_info "Starting HPC Toolset Cluster.."
docker-compose up -d --no-build
log_info "Coldfront URL: https://localhost:2443"
log_info "OnDemand URL: https://localhost:3443"
log_info "XDMoD URL: https://localhost:4443"
log_info "Login to frontend: ssh -p 6222 hpcadmin@localhost"
}
stop() {
log_info "Stopping and removing HPC Toolset Cluster containers and volumes.."
docker-compose stop && \
docker-compose rm -f -v && \
docker-compose down -v
}
cleanup() {
log_info "Cleaning up HPC Toolset containers and images.."
stop
docker rmi $(docker images -f "reference=ubccr/hpcts*" -q)
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'cleanup')
cleanup
;;
*)
log_info "Usage: $0 { start | stop | cleanup}"
exit 1
;;
esac