Skip to content
Set up a Jupyter notebook on Clevergrid using Cellar as data storage
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bucket-management @ 1eaded6
.gitmodules
README.md
jupyter_notebook_config.py
requirements.txt
start.sh

README.md

Clever Grid : launch a jupyter server

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

prerequisites

  • You need a Clever-cloud or a Clever Grid account

  • We will use the Clever CLI Clever cloud CLI

Steps by steps jupyter setting up

  1. 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
  2. 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 at 8080

    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
    • Set PYTHON_VERSION at 3.6

    We want use python3.6

    • Set the path to your starting script by setting up CC_MLPYTHON_START_SCRIPT environment variable to start.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 a PASSWORD 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)

  3. Create a Cellar Add-on

    • Go to your Clever Grid dashboard
    • click on add a storage service and choose Cellar 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

  4. 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

  5. Deploy your application

    • clever deploy
  6. You have logs from the clever deploy command or from the overview application page on Clever Grid dashboard

    If you have not provide a TOKEN or PASSWORD environment variable, find the automatically set token at the end of these logs and copy-paste it into your jupyter application

  7. 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

You can’t perform that action at this time.