-
Notifications
You must be signed in to change notification settings - Fork 12
/
nims.tmux.sample
57 lines (48 loc) · 2.07 KB
/
nims.tmux.sample
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
#!/bin/bash
SESSION="SESSION-NAME"
POSTGRES_USER="db_user"
POSTGRES_PW="password"
POSTGRES_HOST="postgres.example.com"
POSTGRES_PORT="5432"
POSTGRES_DB="db_name"
POSTGRES="postgresql://${POSTGRES_USER}:${POSTGRES_PW}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
UNSORTABLE_PATH="/scratch/example/unsortable" # where to place unsortable files
STAGE_PATH="/scratch/example/upload" # where uploads are placed, where sorter looks for new files
NIMS_PATH="/examplefs/nims" # base path where files get sorted
PHYSIO_PATH="/examplefs/nims/physio" # where physio files are unpacked into
# create
cd /var/local/nims
tmux new-session -s "$SESSION" -n bash -d
# sorter
tmux new-window -t "$SESSION:1" -n "sorter"
tmux send-keys -t "$SESSION:1" \
"source /var/local/tg2env/bin/activate" C-m
tmux send-keys -t "$SESSION:1" \
"nimsproc/sorter.py -p ${UNSORTABLE_PATH} ${POSTGRES} ${STAGE_PATH} ${NIMS_PATH}" C-m
# scheduler
tmux new-window -t "$SESSION:2" -n "scheduler"
tmux send-keys -t "$SESSION:2" \
"source /var/local/tg2env/bin/activate" C-m
tmux send-keys -t "$SESSION:2" \
"nimsproc/scheduler.py ${POSTGRES} ${NIMS_PATH}" C-m
# processor
tmux new-window -t "$SESSION:3" -n "processor"
tmux send-keys -t "$SESSION:3" \
"source /var/local/tg2env/bin/activate" C-m
tmux send-keys -t "$SESSION:3" \
"nimsproc/processor.py -j8 -t /scratch_spinning -e \"~Epoch.psd.contains(u'mux')\" ${POSTGRES} ${NIMS_PATH} ${PHYSIO_PATH}" C-m
# mux processor
tmux new-window -t "$SESSION:4" -n "mux_proc"
tmux send-keys -t "$SESSION:4" \
"source /var/local/tg2env/bin/activate" C-m
tmux send-keys -t "$SESSION:4" \
"nimsproc/processor.py -j1 -k32 -t /scratch_spinning -e \"Epoch.psd.contains(u'mux')\" ${POSTGRES} ${NIMS_PATH} ${PHYSIO_PATH}" C-m
# QA
tmux new-window -t "$SESSION:5" -n "qa"
tmux send-keys -t "$SESSION:5" \
"source /var/local/tg2env/bin/activate" C-m
tmux send-keys -t "$SESSION:5" \
"nimsproc/qa_report.py -j8 ${POSTGRES} ${NIMS_PATH}" C-m
# attach to session
tmux select-window -t "$SESSION:0"
tmux attach-session -t "$SESSION"