forked from arunoda/fastai-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-instance.sh
44 lines (35 loc) · 1.11 KB
/
setup-instance.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Install the driver
sudo /opt/deeplearning/install-driver.sh
# Modify jupyter to use notebook instead of labs
cat > /tmp/jupyter.service <<EOL
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/bin/bash --login -c 'jupyter notebook --config=/home/jupyter/.jupyter/jupyter_notebook_config.py'
User=jupyter
Group=jupyter
WorkingDirectory=/home/jupyter
Restart=always
[Install]
WantedBy=multi-user.target
EOL
sudo mv /tmp/jupyter.service /lib/systemd/system/jupyter.service
## Add the update fastai script
cat > /tmp/update-fastai.sh <<EOL
#!/bin/bash
/opt/anaconda3/bin/conda update -y -c pytorch pytorch-nightly cuda92
/opt/anaconda3/bin/conda update -y -c fastai torchvision-nightly fastai
cd /home/jupyter/tutorials/fastai/course-v3
git checkout .
git checkout master
git pull origin master
EOL
sudo mv /tmp/update-fastai.sh /home/jupyter/update-fastai.sh
sudo chown jupyter /home/jupyter/update-fastai.sh
sudo chmod +x /home/jupyter/update-fastai.sh
## Update fastai
sudo /home/jupyter/update-fastai.sh
sudo chown -R jupyter /home/jupyter/tutorials/fastai/course-v3