diff --git a/autoscale.sh b/autoscale.sh index e030a96..688bc46 100755 --- a/autoscale.sh +++ b/autoscale.sh @@ -4,7 +4,7 @@ JS2AUTOSCALING="/home/ubuntu/t-rex-monitor/js2-autoscaling.sh" CONFIG="/home/ubuntu/crux/crux/vars/crux_vars.sh" SETUP_CONFIG="/home/ubuntu/t-rex-monitor/vm_vars.sh" -QUEUES=("/etc/ben/queue/qc.ini" "/etc/ben/queue/assign.ini" "/etc/ben/queue/ecopcr.ini" "/etc/ben/queue/blast.ini" "/etc/ben/queue/ac.ini" "/etc/ben/queue/newick.ini" "/etc/ben/queue/tronko.ini") +QUEUES=("/etc/ben/queue/qc.ini" "/etc/ben/queue/assign.ini" "/etc/ben/queue/assignxl.ini" "/etc/ben/queue/ecopcr.ini" "/etc/ben/queue/blast.ini" "/etc/ben/queue/ac.ini" "/etc/ben/queue/newick.ini" "/etc/ben/queue/tronko.ini") cd /home/ubuntu/t-rex-monitor diff --git a/js2-autoscaling.sh b/js2-autoscaling.sh index 6068fcd..c65aa4b 100755 --- a/js2-autoscaling.sh +++ b/js2-autoscaling.sh @@ -17,8 +17,8 @@ while getopts "b:c:d" opt; do esac done -source $CONFIG -# gets JSCRED, SSHKEY, NETWORK, SECURITY, SSHCONFIG +source $CONFIG # gets JSCRED, SSHKEY, NETWORK, SECURITY, SSHCONFIG + VMNAME="${BENSERVER##*/ben-}" declare -A MAXVM_MAP @@ -31,6 +31,7 @@ MAXVM_MAP=( ["tronko"]=$MAX_TRONKO ["qc"]=$MAX_QC ["assign"]=$MAX_ASSIGN + ["assignxl"]=$MAX_ASSIGNXL ) MAXVM="${MAXVM_MAP[${VMNAME}]}" @@ -117,7 +118,7 @@ else # Scale Up n="$availVM" fi - if [[ $BENSERVER == *assign* ]]; then + if [[ $BENSERVER == *assignxl* ]]; then FLAVOR="m3.xl" # need more RAM for tronko assign fi diff --git a/main/setup_instance.sh b/main/setup_instance.sh index 29323ef..874c6f4 100755 --- a/main/setup_instance.sh +++ b/main/setup_instance.sh @@ -11,7 +11,6 @@ SECURITY="" VOLUME="" VMNAME="chunk" VMNUMBER=0 -SETUP_CONFIG="/home/ubuntu/t-rex-monitor/vm_vars.sh" while getopts "u:f:i:k:j:n:m:b:s:w:v:c:" opt; do case $opt in u) USER="$OPTARG" @@ -57,7 +56,6 @@ START=$VMNUMBER END=$(( VMNUMBER + NUMINSTANCES)) source $JSCRED -source $SETUP_CONFIG # create and start an instance diff --git a/scheduler/ben.sh b/scheduler/ben.sh index 6a2c9e3..5e586c3 100755 --- a/scheduler/ben.sh +++ b/scheduler/ben.sh @@ -55,7 +55,13 @@ do if [[ -v SERVER_MAP[${BENSERVER}] ]]; then # add socket connection to add job after BENSERVERSECOND="${SERVER_MAP[${BENSERVER}]}" - /etc/ben/ben client -r $host -n 0 --remote-path $REMOTE_PATH -s $BENSERVERSECOND --remote-socket $BENSERVERSECOND -d + /etc/ben/ben client -r "$host" -n 0 --remote-path "$REMOTE_PATH" -s "$BENSERVERSECOND" --remote-socket "$BENSERVERSECOND" -d + + # add assign XL socket + if [[ $BENSERVERSECOND == *assign* ]]; then + BENSERVERSECOND="${BENSERVERSECOND}xl" + /etc/ben/ben client -r "$host" -n 0 --remote-path "$REMOTE_PATH" -s "$BENSERVERSECOND" --remote-socket "$BENSERVERSECOND" -d + fi fi counter=$(( 10#$counter + 1 )) done diff --git a/scheduler/main_ben_setup.sh b/scheduler/main_ben_setup.sh index 8b50f51..9e2ef07 100755 --- a/scheduler/main_ben_setup.sh +++ b/scheduler/main_ben_setup.sh @@ -24,6 +24,7 @@ sudo cp jobs/ben-jobs.service jobs/ben-jobs.timer supabase/ben-supabase.service /etc/ben/ben server --snapshot /etc/ben/queue/tronko.ini -s /tmp/ben-tronko -d /etc/ben/ben server --snapshot /etc/ben/queue/qc.ini -s /tmp/ben-qc -d /etc/ben/ben server --snapshot /etc/ben/queue/assign.ini -s /tmp/ben-assign -d +/etc/ben/ben server --snapshot /etc/ben/queue/assignxl.ini -s /tmp/ben-assignxl -d sudo systemctl enable ben-logs.service sudo systemctl enable ben-jobs.service diff --git a/scheduler/servers/ben-assignxl-server.service b/scheduler/servers/ben-assignxl-server.service new file mode 100644 index 0000000..bac6e7a --- /dev/null +++ b/scheduler/servers/ben-assignxl-server.service @@ -0,0 +1,16 @@ +[Unit] +Description=Ben Assign XL Job Scheduler Server +After=network-online.target + +[Service] +User=ubuntu +Type=forking +WorkingDirectory=/home/ubuntu/t-rex-monitor/scheduler/servers +Environment="PATH=/usr/local/bin:/usr/bin:/bin:/home/ubuntu/miniconda/envs/webhook/bin" +ExecStart=/bin/bash ./ben-servers.sh "assignxl" "/tmp/ben-assignxl" +TimeoutSec=600 +Restart=no +RestartSec=5s + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/vm_vars.sh.sample b/vm_vars.sh.sample index 69d10ac..4803bb9 100644 --- a/vm_vars.sh.sample +++ b/vm_vars.sh.sample @@ -23,4 +23,5 @@ MAX_AC=5 MAX_NEWICK=5 MAX_TRONKO=5 MAX_QC=5 -MAX_ASSIGN=5 \ No newline at end of file +MAX_ASSIGN=5 +MAX_ASSIGNXL=2 \ No newline at end of file