Skip to content

Commit

Permalink
Merge pull request #205 from datmo/env-examples
Browse files Browse the repository at this point in the history
Add README + example code for environment and workspace examples
  • Loading branch information
asampat3090 committed Jun 19, 2018
2 parents fae1e1b + a61ab3e commit 9c2251d
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 10 deletions.
10 changes: 0 additions & 10 deletions docs/examples.md

This file was deleted.

37 changes: 37 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Examples
=================================

In order to run the examples, make sure that you have datmo properly installed with the latest
stable or development version. You can install the latest stable version with the following command:


``$ pip install datmo``


Listed below are actions you might want to take with Datmo. For each
we have listed if there are any example for each type of flow. You can
navigate to the specific flow folder to find the exact instructions for
each example.

Creating a Snapshot
-----------------------

- `CLI flow <https://github.com/datmo/datmo/tree/master/examples/cli>`_
- snapshot_create_iris_sklearn
- `CLI + Python flow <https://github.com/datmo/datmo/blob/master/examples/python>`_
- snapshot_create_iris_sklearn
- `CLI + Jupyter Notebook flow <https://github.com/datmo/datmo/blob/master/examples/jupyter_notebook>`_
- snapshot_create_iris_sklearn
- `CLI + R flow <https://github.com/datmo/datmo/blob/master/examples/R>`_
- snapshot_create_iris_caret

Running a containerized task (with option to create Snapshot)
--------------------------------------------------------------------

- `CLI + Python flow <https://github.com/datmo/datmo/blob/master/examples/python>`_
- task_run_iris_sklearn_basic
- task_run_iris_sklearn_compare



You can view the latest examples on `the master branch on Github <https://github.com/datmo/datmo/tree/master/examples>`_
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,11 @@ each example.
* task_run_iris_sklearn_basic
* task_run_iris_sklearn_compare

#### Environment setup
* Setting up a project environment [(CLI)](/examples/cli/environment_setup.sh)
* From fresh repository
* From existing datmo project
* Bringing your own
* Initializing a workspace [(CLI)](/examples/cli/workspace_setup.sh)
* opening a Jupyter notebook
* open RStudio
2 changes: 2 additions & 0 deletions examples/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ $ pip install datmo
| feature | filename(s) | Instructions |
| ------------- |:-------------:| :-----|
| Create Snapshot | `snapshot_create_iris_sklearn.py`, <br> `snapshot_create_iris_sklearn.sh` | (1) Read `snapshot_create_iris_sklearn.py` <br> (2) Run the command `bash snapshot_create_iris_sklearn.sh` or run all of the commands one-by-one |
| Create Environment | `environment_setup.sh` | (1) Read `environment_setup.sh` <br> (2) Follow one of the scenarios listed in the file |
| Start a Workspace | `workspace_setup.sh` | (1) Read `workspace_setup.sh` <br> (2) For Jupyter notebook: `$ datmo notebook` or <br> RStudio: `$ datmo rstudio` |
23 changes: 23 additions & 0 deletions examples/cli/environment_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# This script will show the multiple different ways to setup your environment using Datmo

## SCENARIO A: Starting from an uninitialized Datmo Project
# Step 1: Initialize the datmo repository with
$ datmo init
# Step 2: Answer the following prompts for project name and description
# Step 3: When asked if you want to set up an environment, say yes
# Step 4: Type the number corresponding to the environment you want to use from the list


## SCENARIO B: Adding an environment to an existing Datmo Project
# Step 1: begin environment setup with
$ datmo environment setup
# Step 2: Type the number corresponding to the environment you want to use from the list


## SCENARIO C: Adding your own environment to be logged in your Datmo Project
# Step 1: begin environment setup with
$ datmo environment setup
# Step 2: Choose the option corresponding to bringing your own environment
# Step 3: Type the directory containing your environment files in the prompt (Dockerfile, requirements.txt, etc)
16 changes: 16 additions & 0 deletions examples/cli/workspace_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# This script will show the multiple different ways to setup your workspace using Datmo
# Note, these require a relevant environment chosen from the /examples/cli/environment_setup.sh workflows.

## SCENARIO A: Jupyter Notebook
# Step 1: Initialize the notebook with
$ datmo notebook
# Step 2: Go to the localhost address in your browser
# Step 3: If applicable, sign in using the token from your terminal

## SCENARIO B: RStudio
# Step 1: Initialize RStudio with
$ datmo rstudio
# Step 2: Go to the localhost address in your browser
# Step 3: Sign in using the default credentials (rstudio/rstudio)

0 comments on commit 9c2251d

Please sign in to comment.