Bashir Gulistani
commited on
Create deploy_second_part.sh
Browse files- deploy_second_part.sh +28 -0
deploy_second_part.sh
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! /bin/bash
|
2 |
+
|
3 |
+
PORT=22040
|
4 |
+
MACHINE=paffenroth-23.dyn.wpi.edu
|
5 |
+
|
6 |
+
# Change to the temporary directory
|
7 |
+
cd tmp
|
8 |
+
|
9 |
+
# Add the key to the ssh-agent
|
10 |
+
eval "$(ssh-agent -s)"
|
11 |
+
ssh-add mykey
|
12 |
+
|
13 |
+
# check that the code in installed and start up the product
|
14 |
+
COMMAND="ssh -i tmp/mykey -p ${PORT} -o StrictHostKeyChecking=no student-admin@${MACHINE}"
|
15 |
+
|
16 |
+
${COMMAND} "ls background_remover"
|
17 |
+
${COMMAND} "sudo apt install -qq -y python3-venv"
|
18 |
+
${COMMAND} "cd background_remover && python3 -m venv venv"
|
19 |
+
${COMMAND} "cd background_remover && source venv/bin/activate && pip install -r requirements.txt"
|
20 |
+
${COMMAND} "nohup background_remover/venv/bin/python3 background_remover/app.py > log.txt 2>&1 &"
|
21 |
+
|
22 |
+
# nohup ./whatever > /dev/null 2>&1
|
23 |
+
|
24 |
+
# debugging ideas
|
25 |
+
# sudo apt-get install gh
|
26 |
+
# gh auth login
|
27 |
+
# requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta/v1/chat/completions
|
28 |
+
# log.txt
|