Valohai Logo

Get Started

Get started with your project in less than 5 minutes 🚀

Run local code Run code from Git Run Jupyter Notebooks code

Run your local code in the cloud

In this section, we’ll cover sending code from our local machine to be executed in the cloud. Valohai makes it super simple, letting you develop locally and execute remotely on any on-prem or cloud instance. You’ll discover how to push code to your preferred cloud environment, work asynchronously, while Valohai's automatic version control tracks all stages of every experiment you conduct.

1.

First, register and create a free account on app.valohai.com and install the command line interface (CLI):

pip3 install valohai-cli

...then, log into Valohai with your account:

vh login

2.

To get going, set up your project defaults and hook your code on the local machine together with Valohai:

cd myproject
vh project create --name myproject

Next, create a file called valohai.yaml in the root of your project. In this case, we’ll just define what code to run (command) and in which docker container (image) as well as the name for it.

- step:
    name: mytest
    image: python:3.6
    command: python test.py

Congratulations! Your code is now runnable on Valohai!

3.

With these pieces in place, you can start executing experiments on the platform. Please note that although we just created only one step, you can define several steps in the YAML file. When starting an execution, you only need to select what step to run with the added --adhoc flag that let’s Valohai know you want us to version control the code for you (as opposed to running code from a Git repository).

vh execution run --adhoc mytest

Run local adhoc experiments with CLI

Feel free to start as many executions as you’d like in parallel.

4.

You can view a list of all of your experiments either from the command line (vh execution list) or the web UI, together with all their respective version control histories.

Execution list and other views in Valohai UI

You’ve come this far - now the only thing left for you to do is just rinse and repeat! For complete documentation on getting the most from the CLI, see Valohai Docs or ask for help in the website chat at the bottom right!

Run code in the cloud from a Git repository

In this getting started guide we will run code in the cloud from a Git repository. You will learn how to define re-usable ML pipeline steps, run them in your cloud / on-prem environment and roll back to previous experiments.

1.

Register and create a free tier account on app.valohai.com

2.

To get started with git-based projects, we need to first define your ML pipeline steps. This is done with the valohai.yaml file that we’ll add to the project. In this case we will just define one ML pipeline step, called “mytest”. For the step we’ll also define what code to run (command) and which docker container (image in hub.docker.com) to run it on (any). Feel free to add as many steps as you like! Commit and push the YAML file to the root of your Git project. For a more advanced example of the YAML see our tensorflow-mnist example.

- step:
    name: mytest
    image: python:3.6
    command: python test.py

3.

Now, you can connect the Git project to Valohai. We will copy the URL of your git repository, create a new Valohai project and hook them together, allowing you to commit new code to the repo and run it on Valohai.

Create a machine learning project

4.

Next, we’ll run one of the pipeline steps we have defined in the project YAML file, on our choice of cloud/onprem hardware. Notice how Valohai launches the machines, installs the docker container, fetches your code, data and runs the code. (Cool, huh?) It also stores any outputs in your file bucket of choice and finally shuts down the machines automatically when the run is complete.

Create execution in Valohai UI

5.

The only thing left to do now is just rinse and repeat. You can now jump into any completed or running experiment, view its results or start new experiments.

Version control for experiments

For the complete documentation on core concepts, how to define data sources in the YAML and more, see the Valohai Docs or ask for help in the chat window on the webpage!

Run Jupyter Notebooks in the cloud

In this getting started guide we will write our code in Jupyter Notebooks on our local machine and run the cells in our cloud instance. This way we don't pay for an expensive cloud unit while coding – only when executing code. And you get automatic free version control for every experiment! Valohai is built for private-cloud and on-prem installations but for simplicity's sake we're using a public cloud in the demo.

1.

Register and create a free tier account on app.valohai.com

2.

Install Valohai Jupyter notebooks on your local machine.

docker pull valohai/jupyhai
docker run -p 8888:8888 -v "$PWD":/home/jovyan/work valohai/jupyhai

Start up your local notebook at http://127.0.0.1:8888 and copy the token from your console to the notebook (see docs for more details).

3.

Log into your notebook with your Valohai credentials from the Valohai-logo in the notebook tab bar.

Log in with Valohai credentials

4.

Write your code as you normally would inside Jupyter notebooks – whenever you want to run it, select “Create execution” from the Valohaimenu to send your code to your cloud computing instance (configurable under the Settings menu). At this point, Valohai always takes a snapshot of your code, letting you roll back to any older experiment at any point in time.

Run machine learning experiments straight form notebook

5.

View, re-run or stop all of your experiments within Valohai – even without a notebook instance running!

View ML experiments from Valohai user interface

Did you know that you can also use Valohai through our open API?

Answers to your questions

What if I need help in setting up my project in Valohai?

Running either a new or an existing machine learning project in Valohai is very simple! The technologies you use for training your models are the same as they are outside Valohai. If you need assistance in setting up your project, shoot us a message in the chat box or write email to info@valohai.com!

How much does it cost?

We have fixed monthly billing based on the number of users but we also offer free accounts with limited features. See the pricing tiers and find the best option for you.