Hello World in Datmo

Datmo's 3 minute 'Hello World' walkthrough is designed to show you the powerful functionality and ease of use of the CLI (command line interface).

Follow along below, and feel free to copy and paste the commands into your terminal to breeze through them.

Let's get started!

Step 1: Login using Datmo CLI

First check if the Datmo CLI is properly installed.

$ datmo help

Let's login into using CLI,

$ datmo login

You can learn more about these login commands here

Step 2: Clone Your First Datmo model

Cloning a Datmo model means you get all of the benefits of tracking, orchestration, and deployment with just one command.

Try it out yourself -- we'll explore the power of this in the next few steps.

For your first command we will be cloning the public Hello World model created by the Datmo Team

Use the command below to clone

$ datmo clone hello-world
$ cd datmo-hello-world

This Datmo model solves a classic machine learning problem where a flower's type is predicted from a combination of its attributes. You can see that we have already created a number of Snapshots here and you can check them out in the CLI when you clone them.

Here you'll see that it looks just like any other repository except for a hidden .datmo directory as well as the datmo.json file which includes synced metadata about your Datmo model.

Optional:If you'd like, you can open up the files in your favorite code editor or file navigator and take a look!

Step 3: Compare Snapshots

Now that you have cloned your first Datmo model, you also have a fully versioned history of the Datmo model going back to the original version. When we say a version of a Datmo model, what exactly do we mean? Learn more about these checkpoints, which we refer to as snapshots, here.

Optional:Now that you understand what a Snapshot is, you can check out the snapshots page for the Iris Classification model that we've already made.

You can also check it out on the CLI by entering the default Session and listing all of the Snapshots.

$ datmo snapshot ls

Step 4: Run your first Task

$ datmo task run "python3 classifier.py"

Congratulations! You just ran your first Datmo Task!

Now, since you do not own this Datmo model you won't be able to sync it with Datmo, but you can see your unstaged work.

$ datmo status

Time to push those changes to a Snapshot!

Step 5: Create a Snapshot

Now it's time to create your first Snapshot. Much like a commit for code, after you have run some tasks you will now have "unstaged changes" which you can view with datmo status. When you want to create a Snapshot you can use the create command to make it happen.

$ datmo snapshot create -m "my initial snapshot" -l "classifier"

Tip: the -m flag designates the message name for the commit, and the -l flag designates the label that will be visible on the web platform.

$ datmo snapshot ls -a

You just created your first Datmo Snapshot :)

Feel free to track changes to your Datmo Model by creating more Snapshots.

Step 6: Checkout to a Snapshot

Now that you have created your own Snapshot, let's say you want to go back to different Snapshot to reproduce your work. You can do that by checking back to any previous Snapshot in the Datmo Model history. Let's commit the current changes before we revert to a different snapshot.

Let's go to one of the Snapshots we saw in the datmo snapshot ls command above. In this example we will checkout to the Snapshot with id ge7m1s3idwze, but you can choose any one of the ids you saw in the datmo snapshot ls output.

$ datmo snapshot checkout --id ge7m1s3idwze

Check that you are now on the previous Snapshot.

$ datmo status

You can go back to your original work after you checkout to continue iterating

$ datmo snapshot home

Finished

You did it! You're now a Datmo pro. Let's quickly go over what you learned:

  • Login to the Datmo CLI using $ datmo login
  • Clone an existing Datmo model with $ datmo clone
  • Compare snapshots from the cloned Datmo model with $ datmo snapshot ls
  • Run your first task with $ datmo task run
  • Create your first snapshot with $ datmo snapshot create
  • Checkout to a prior snapshot with $ datmo snapshot checkout
  • Go back to your original work with $ datmo snapshot home

Now it's time to get building your own Datmo model!

results matching ""

    No results matching ""