Skip to content

Commit

Permalink
add assignxl queue
Browse files Browse the repository at this point in the history
  • Loading branch information
hector-baez committed Nov 30, 2023
1 parent 4c04276 commit cc9e725
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
7 changes: 4 additions & 3 deletions js2-autoscaling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,6 +31,7 @@ MAXVM_MAP=(
["tronko"]=$MAX_TRONKO
["qc"]=$MAX_QC
["assign"]=$MAX_ASSIGN
["assignxl"]=$MAX_ASSIGNXL
)

MAXVM="${MAXVM_MAP[${VMNAME}]}"
Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion scheduler/ben.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scheduler/main_ben_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions scheduler/servers/ben-assignxl-server.service
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion vm_vars.sh.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ MAX_AC=5
MAX_NEWICK=5
MAX_TRONKO=5
MAX_QC=5
MAX_ASSIGN=5
MAX_ASSIGN=5
MAX_ASSIGNXL=2

0 comments on commit cc9e725

Please sign in to comment.