For gcloud:
- Specified protocols and ports > Enter
tcp:<PORT-NUMBER>
for this field if this is the page you see. - Targets > All instances in the network.
- Allowed protocols and ports
For others:
- Specify ip port if you want to expose one
- If not, just put public IP
a@A:~> ssh-keygen -t rsa
a@A:~> ssh b@B mkdir -p .ssh
a@A:~> cat .ssh/your_key_name.pub | ssh b@B 'cat >> .ssh/authorized_keys'
a@A:~> ssh b@B
Edit password:
sudo su
passwd your_username
gtar --exclude="*.h5" -cvzf your-directory.tgz your-directory
scp -i ~/.ssh/your_key_name your-directory.tgz username@99.11.000.252:/home/username/
ssh username@99.11.000.252 -i ~/.ssh/your_key_name
We'll be using the easy way
wget -O - -q 'https://gist.githubusercontent.com/dte/8954e405590a360614dcc6acdb7baa74/raw/d1b5a01ed0b9252654016d2a9a435dc8b4c045e7/install-CUDA-docker-nvidia-docker.sh' | sudo bash
sudo shutdown -r now
sudo nvidia-docker run --rm --name your-notebook-name -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow:latest-gpu jupyter notebook --allow-root
Note: we use the name but if you want to use id docker ps
to see the id
sudo docker cp your-directory.tgz your-notebook-name:/notebooks
docker exec -it your-notebook-name /bin/bash
tar -xzvf your-directory.tgz
apt-get update
apt-get upgrade -y
apt-get install wget
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
pip3 install virtualenv virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
source ~/.bashrc
mkvirtualenv your-venv-name
workon your-venv-name
python -m ipykernel install --user --name myenv --display-name "your-display-name"
ls ~/.jupyter/jupyter_notebook_config.py
jupyter notebook --generate-config
nano ~/.jupyter/jupyter_notebook_config.py
Edit and replace
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = <PORT-NUMBER>
jupyter-notebook --no-browser --port=<PORT-NUMBER>
You want to do this to save what we've done so far.
sudo docker ps
sudo docker commit your-notebook-name leonmak/ubuntu-cuda
# Create your repo on hub.docker.com
sudo docker login # if you haven't
sudo docker images
sudo docker push leonmak/ubuntu-cuda