This repository aims to create a GPU instance with Jupyter, Tensorflow and Keras on google cloud platform in an instant.
- make
- Google Cloud SDK
- Docker
- Create an instance with
make create-instance
- Run jupyter on the instance with
make run-jupyter
- It may takes 5 minutes or so.
- Install python libraries with
make pip-install
- Put libraries you want to install in
./requirements.txt
- Upload files to the instance with
make upload-files
. - Make ssh tunnel to the instance with
make ssh-tunnel
- Access jupyter via your web browser
- Default:
http://localhost:18888
- Download outputs with
make download-outputs
- Delete the instance with
make delete-instance
It may take 5 minutes or so to finish to execute the startup script to install the require environment in your instance.
make create-instance \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx
make run-jupyter \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx
In order to access the jupyter which you launched, you have to have a SSH tunnel.
When you got it, you can access http://localhost:18888
via a web browser on your local machine.
When you don't set any value with make ssh-tunnel
, the port is the default value.
The default of JUPYTER_PORT
is 18888
.
make ssh-tunnel \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx \
JUPYTER_PORT=18888
make delete-instance \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx
make pip-install \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx
make upload-files \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx \
FROM=/path/to/your/files
make download-outputs \
INSTANCE_NAME="test-gpu-instance" \
GCP_PROJECT_ID=xxx-xxx-xxx \
TO=/path/to/your/destination