Command Line
The lev
command line application that is used to submit API commands, retrieve the results, and check the status of running jobs.
Installation
Below are specific instructions for installing the application in Windows, MacOS, and Linux
Windows
- Download the Windows executable
- Move
lev
into%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
- Open PowerShell by opening the Windows menu and typing “PowerShell”
- Run
lev help
- If the application is correctly installed you should see a usage message like this:
Mac OS
- Download the appropriate binary for your machine by running the following command in a terminal
- Intel Macs
curl -LO https://storage.googleapis.com/levitate-engine/latest/external/darwin/amd64/lev
- Apple Silicon Macs (M1, M2, etc)
curl -LO https://storage.googleapis.com/levitate-engine/latest/external/darwin/arm64/lev
- Intel Macs
- Copy the binary with the following command:
sudo cp lev /usr/local/bin/lev
- If you do not have permission to write to
/usr/local/bin
you can copy the binary to any directory (e.g.$HOME/bin
) and add that directory to yourPATH
variable by adding a line like this to your.bashrc
or.zshrc
file:export PATH=$HOME/bin:$PATH
- If you do not have permission to write to
- Make the file executable with
chmod +x /usr/local/bin/lev
(or the path you copied the file to in step 2.1 above) - Run
lev help
- If the application is installed correctly you should see a usage message describing the use of the application.
If you do not have permission to run sudo or write to /usr/local/bin/lev
you can instead copy lev to your home directory
Linux
- Download the Linux binary by running the following command in a terminal:
curl -LO https://storage.googleapis.com/levitate-engine/latest/external/linux/amd64/lev
- Copy the binary with the following command:
sudo cp <binary-name> /usr/local/bin/lev
- If you do not have permission to write to
/usr/local/bin
you can copy the binary to any directory (e.g.$HOME/bin
) and add that directory to yourPATH
variable by adding a line like this to your.bashrc
or.zshrc
file:export PATH=$HOME/bin:$PATH
- If you do not have permission to write to
- Make the file executable with
chmod +x /usr/local/bin/lev
(or the path you copied the file to in step 2.1 above) - Run
lev help
- If the application is installed correctly you should see a usage message describing the use of the application.
Upgrading
Once the command line application has been initially installed, it can be upgraded to the latest version by running the command lev upgrade
. If an upgrade is available, you will be prompted to install it.
Initial Configuration
Before using the command line application for the first time, you need to initialize the configuration. To do this, run
lev init
You will be asked to enter your server address, which is the domain name you were given during onboarding (engine.<codename>.levitate.bio). Once that is entered a web browser window will be opened with a dialog box. Click ‘Confirm’, log in using your Levitate Bio username and password if prompted, and Engine should be ready to use.
If you are prompted for a client ID, secret, and port after running lev init
your account is set up using the legacy auth system. You can get your client ID and secret from api-authorization.levitate.bio and for the port you should enter 443
.
Submitting Jobs
A job can be submitted with a command like this:
lev engine submit <job type> <job options>
Where <job type>
and <job options>
vary depending on the job being submitted. See the specific documentation section for details.
The command will return a job ID and the username that the job was submitted under. The job ID is a unique ID which can be used to retrieve the results later.
the option --comment
can be used to add a human readable comment to your job, this can be used to annotate jobs with information about the experiment being run, to make them easier to track.
Retrieving Results
To get the results of a completed job, run the following command:
lev engine get <job id> --output-dir <output directory>
Where <job id>
is the ID of the job and <output directory>
is the directory results should be output to. The output directory will be created if it does not already exist. If the job is still Running, you cannot get the results yet and the command will exit.
Listing running jobs
To list the currently running jobs, run the following command:
lev engine list
This will result in a table listing the Job ID, status, age of the job, comments, and the options the job was run with.
Deleting jobs
To delete completed jobs, run the following command:
lev engine delete <job id>
where <job id>
is the ID of a submitted job.