Skip to content

Instantly share code, notes, and snippets.

@fomightez
Last active July 6, 2017 16:42
Show Gist options
  • Save fomightez/66f29505a5e4d1f064926da85e8ae37f to your computer and use it in GitHub Desktop.
Save fomightez/66f29505a5e4d1f064926da85e8ae37f to your computer and use it in GitHub Desktop.
Using current scripts on Domino Data Science Platform

Scripts will run with VPython on the full-featured Domino Data Science Platform.
You need to remember to conclude session to have generated files be saved to your account, plus stop the company from complaining in your email. All final results of each session are archived for easy retrieval.

How to prepare to run

  • Sign in to your Domino Data Lab account.
    Sirotkin lab accounts can sign in here. (Older accounts can sign in here.)

  • After login, your page will look like below.
    Select the /main one that will show previous runs by clicking in the box with the /main name the -> arrow to the right.

upon_login_with_hl.png

  • On the next screen, click Runs in the panel on the left

runs_with_hl.png

until your screen looks something like below with a list of previous jobs in the middle with Run and Notebook buttons at the top.

runs_page_domino.png

  • At the top of the middle panel, click the Notebook button and select Jupyter.

pulldown_with_jupyter_with_hl.png

  • It should start running with a spinning icon on the left panel.

shows_session_running_with_hl.png

  • To trigger the browser to open the running session, scroll down in panel on right after it starts running, and eventually you'll see a green button to Open Session. Click on it.

open_session__with_hl.png

  • You'll be presented with a Jupyter Session Dashobard. Now you can click on an old notebook to open it or launch a new one like you would on the dashboard at tmpnb.org or other Jupyter sites. jupyter_session_dashboard_with_hl.png

For example, click on New in the upper right corner and select VPython.

domino_notebook_options_sum2017_with_zoom_hl.png

  • A notebook will open and it you'll see a cell in it, like below.

notebook_open.png

  • Now you can paste your code in the cell and then you should be all set to run the cell. To run the cell you can hit shift-enter to run it. Alternatively, click on the "Play" button [►|] on the toolbar just above the notebook or select Cells > Run in the notebook menu.

  • If you get a note in the notebook about It doesn't appear your computer can support WebGL. when you try to run the script, the easiest thing is to change browsers. I find at home my version of Chrome inexplicably throws this error but Firefox doesn't. If you really wanto to address it and you are using Chrome, try activating graphics acceleration under advanced settings ( Menu > Settings > Show Advanced Settings > System menu), as instructed here. You'll need to restart the browser after this.

  • From the notebook, you can always go back to the Jupyter session dashboard by clicking the Jupyter logo at the top.

Concluding the Session

It is important on Domino to close your session. The stops your services and saves the data to the files in your Domino account. Otherwise the files are inaccessible while the session is running; you can verify files were created while the notebook session is running by typing ls in a cell of the notebook. They will be automatically migrated to an accessible location within your Domino Files when the session is concluded.

  • Click in your browser to get back to the Run screen and choose Stop in the upper right corner.

make_stop_with_hl.png

  • The Jupyter session will conclude and you'll see a green View Results button at the bottom of the pane on the left. The final versions of any files generated during the run of the simulation will be linked to there, and the recent results will be stored in your Files page as the most recent version. (Don't worry too much about managing old files because, as discussed below, the final ouput of any properly-concluded session always remains accessible via the results of individual runs.)

stopped_with_view_results_button_with_hl.png

  • You should also find the recently-generated files in your Files page, accessible from the left panel in the main Domino interface.

  • From the Files page, download to your local computer anything you want by checking the box to the left of it and clicking the Download button above the list of files. Feel free to delete any script-generated result from here after you download it because you can always get it from the results of previous runs as discussed in the next bullet item; leave the other files intact, such as requirements.txt. Or simply leave the Files page untouched and use the View Results route discussed next to access and download previous results.

files_view_with_hl.png

  • If you click on Runs in the panel on the right, you can bring up in the middle panel all past runs. Clicking one of them will bring up at the bottom of the panel on the right the option to View Results of that previous run. You can download the files for these old (archived), final results using the Download button in the upper right frame surrounding each result.

download_results_view_example_with_hl.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment