Providers¶
NOTE:
The source code for the examples below can be found on GitHub.
Each workflow in the YAML file has to specify the provider
property. This property
defines the behaviour of the workflow and what parameters can be provided in the YAML file.
NOTE:
While each provider is unique, common functionalities such as Artifacts, Deps, Resources, Environment variables, Secrets, and Args are supported by most providers.
bash¶
The bash
provider is the most common. It allows to run arbitrary bash commands.
workflows:
- name: hello
provider: bash
commands:
- echo "Hello, world!"
If you run it, you'll see real-time output:
$ dstack run hello
RUN WORKFLOW SUBMITTED STATUS TAG BACKENDS
shady-1 hello now Submitted local
Provisioning... It may take up to a minute. ✓
To interrupt, press Ctrl+C.
Hello, world!
$
NOTE:
The bash
provider allows to use pip
, conda
, and python
executables from the commands.
See Python and Conda for more details.
Also, the bash
provider allows to expose ports. See Apps for more details.
For more details, check the reference.
docker¶
The docker
provider allows to run a user Docker image.
workflows:
- name: hello-docker
provider: docker
image: ubuntu
commands:
- echo "Hello, world!"
If you run it, you'll see real-time output:
$ dstack run hello
RUN WORKFLOW SUBMITTED STATUS TAG BACKENDS
shady-2 hello-docker now Submitted local
Provisioning... It may take up to a minute. ✓
To interrupt, press Ctrl+C.
Hello, world!
$
For more details, check the reference.
code¶
The code
provider runs a VS Code application.
workflows:
- name: ide-code
provider: code
If you run it, you'll see the URL:
$ dstack run ide-code
RUN WORKFLOW SUBMITTED STATUS TAG BACKEND
lionfish-1 ide-code now Submitted local
Provisioning... It may take up to a minute. ✓
To interrupt, press Ctrl+C.
Web UI available at http://127.0.0.1:51303/?tkn=f2de121b04054f1b85bb7c62b98f2de1
If you click the URL, it will open the VS Code application in the browser:
For more details, check the reference.
This is a great option if you'd like to run code interactively using a code editor and a terminal.
NOTE:
The code
provider allows to use pip
, conda
, and python
executables from the commands.
See Python and Conda for more details.
lab¶
Similar to code
, labs
allows to run a JupyterLabs application.
For more details, check the reference.
notebook¶
Similar to code
, labs
allows to run a Jupyter notebook.
For more details, check the reference.