Spaces:
Sleeping
Sleeping
Kaitlin Kartsen
commited on
Commit
•
089e773
1
Parent(s):
f3eb29f
Create automated_deployment
Browse files- automated_deployment +48 -0
automated_deployment
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#! /bin/bash
|
2 |
+
|
3 |
+
PORT=21003
|
4 |
+
MACHINE=paffenroth-23.dyn.wpi.edu
|
5 |
+
STUDENT_ADMIN_KEY_PATH=kfkey
|
6 |
+
|
7 |
+
#insert key into list of authorized keys
|
8 |
+
cat kfkey.pub > authorized_keys
|
9 |
+
|
10 |
+
#set permissions
|
11 |
+
chmod 600 authorized_keys
|
12 |
+
|
13 |
+
#remove default key
|
14 |
+
rm -f student-admin_key*
|
15 |
+
|
16 |
+
# Copy the authorized_keys file to the server
|
17 |
+
scp -i student-admin_key -P ${PORT} -o StrictHostKeyChecking=no authorized_keys student-admin@${MACHINE}:~/.ssh/
|
18 |
+
|
19 |
+
# Add the key to the ssh-agent
|
20 |
+
eval "$(ssh-agent -s)"
|
21 |
+
ssh-add mykey
|
22 |
+
|
23 |
+
# Check the key file on the server
|
24 |
+
echo "checking that the authorized_keys file is correct"
|
25 |
+
ssh -p ${PORT} -o StrictHostKeyChecking=no student-admin@${MACHINE} "cat ~/.ssh/authorized_keys"
|
26 |
+
|
27 |
+
# clone the repo
|
28 |
+
git clone https://github.com/rcpaffenroth/CS553_example
|
29 |
+
|
30 |
+
# Copy the files to the server
|
31 |
+
scp -P ${PORT} -o StrictHostKeyChecking=no -r CS553_example student-admin@${MACHINE}:~/
|
32 |
+
|
33 |
+
# check that the code in installed and start up the product
|
34 |
+
# COMMAND="ssh -p ${PORT} -o StrictHostKeyChecking=no student-admin@${MACHINE}"
|
35 |
+
|
36 |
+
# ${COMMAND} "ls CS553_example"
|
37 |
+
# ${COMMAND} "sudo apt install -qq -y python3-venv"
|
38 |
+
# ${COMMAND} "cd CS553_example && python3 -m venv venv"
|
39 |
+
# ${COMMAND} "cd CS553_example && source venv/bin/activate && pip install -r requirements.txt"
|
40 |
+
# ${COMMAND} "nohup CS553_example/venv/bin/python3 CS553_example/app.py > log.txt 2>&1 &"
|
41 |
+
|
42 |
+
# nohup ./whatever > /dev/null 2>&1
|
43 |
+
|
44 |
+
# debugging ideas
|
45 |
+
# sudo apt-get install gh
|
46 |
+
# gh auth login
|
47 |
+
# requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta/v1/chat/completions
|
48 |
+
# log.txt
|