We will run a jupyter notebook on a remote GPU server with the Clever Grid platform.
We have to remember some concepts in Clever Grid.
- All applications is stateless. That means no data is kept over the life of the application
- Add-ons are stateful. We will link a python runner application from Clever Grid to a Cellar add-on as storage
- We provide some environment variables as configuration
-
You need a Clever-cloud or a Clever Grid account
-
We will use the Clever CLI Clever cloud CLI
-
Create an application from the Clever Grid dashboard
- choose your organization
- click on
Create an application
- set up a name and choose
Python Webapp
We need a web application which stays up listening http requests
- choose the needed instance size. One node is probably enough for a jupyter application
-
Set up your application environment variables
- go to the
Environment variables
tabs from your application dashboar - Make sure that your Webapp has
PORT
environment variable set at8080
this is the default listening port by Clever Grid
- Provide a
BUCKET_NOTEBOOK_NAME
environment variable with the name you want give to your Cellar bucket. It must be unique accros all the Clever Cloud Cellar domain (Due to s3 specifications) - Set
PYTHON_VERSION
at3.6
We want use python3.6
- Set the path to your starting script by setting up
CC_MLPYTHON_START_SCRIPT
environment variable tostart.sh
- Make sure to click on
update changes
Security: Token is automatically set up and have to be find into logs during the deployment. Nonetheless, you can provide your own Token or Password as environment variable : Set a
TOKEN
or aPASSWORD
environment variable. Fill this variables by empty strings to disable security. Make sure to provide a sha1 processed PASSWORD in the environment variable ! (More informations here) - go to the
-
Create a Cellar Add-on
- Go to your Clever Grid dashboard
- click on
add a storage service
and chooseCellar S3 storage
- select a pricing and ink it to your application
- name it
Linking to your application set up some specific environment variables for you
-
Go to this cloned git repository
We will now use the Clever cloud CLI
- make sure you are login to your Clever Grid account :
clever login
- link the repository to your application :
clever link <Your App ID>
You can find your App Id from the application overview tab from Clever Grid dashboard
- make sure you are login to your Clever Grid account :
-
Deploy your application
clever deploy
-
You have logs from the
clever deploy
command or from the overview application page on Clever Grid dashboardIf you have not provided a
TOKEN
orPASSWORD
environment variable, find the automatically set token at the end of these logs and copy-paste it into your jupyter application -
Go to your Jupyter Application :
-
With the url :
<App Id>.cleverapps.io example : `app-5181525d-1111-1111-1111-7cb978be2539.cleverapp.io`
-
using the command line :
clever open
-