forked from holger-jodel/sc2_predictor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAWS-Config.txt
39 lines (35 loc) · 1.8 KB
/
AWS-Config.txt
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
#!/bin/bash
# AWS Config/Help
# fill this in EC2 instance configuration
# in field 'User Data'
#cloud-config
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils htop
sudo apt-get install -y python3-venv
sudo apt-get install -y nfs-common
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'pyenv virtualenvwrapper' >> ~/.bash_profile
source ~/.bash_profile
pyenv install 3.5.2
pyenv global 3.5.2
pip install -U pip
mkdir -p /var/www/html/efs/data/
chown ubuntu:ubuntu /var/www/html/efs/
chown ubuntu:ubuntu /var/www/html/efs/data/
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-16d428df.efs.eu-west-1.amazonaws.com:/ efs
sudo reboot
# if script doesnt work:
# install nfs-common manually
# and mount to folder efs
# with this command:
# sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-16d428df.efs.eu-west-1.amazonaws.com:/ efs
echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-16d428df.efs.eu-west-1.amazonaws.com:/ /var/www/html/efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0" >> /etc/fstab
mount -a -t nfs4
# ssh config with ssh-key
# keras config