Skip to content

Commit

Permalink
Merge pull request #16 from CALeDNA/develop
Browse files Browse the repository at this point in the history
smart js2 flavor sizing
  • Loading branch information
hector-baez authored Dec 5, 2023
2 parents 942e95a + 1702060 commit 488b563
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion autoscale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
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
2 changes: 0 additions & 2 deletions main/setup_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -57,7 +56,6 @@ START=$VMNUMBER
END=$(( VMNUMBER + NUMINSTANCES))

source $JSCRED
source $SETUP_CONFIG


# create and start an instance
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 488b563

Please sign in to comment.