Skip to main content

init: Creating and writing a workflow file.

Using as a CLI

  1. You can initialize a basic YAML workflow by running:

    dps init
    job.<random>.yaml
    # yaml-language-server: $schema=/tmp/.job.schema.json
    ## See: https://docs.deepsquare.run/workflow/workflow-api-reference/job

    ## Allow DeepSquare logging
    enableLogging: true

    ## Allocate resources
    resources:
    tasks: 1
    cpusPerTask: 1
    memPerCpu: 200
    gpus: 0

    ## The job content
    steps:
    ## The steps of the jobs which are run sequentially.
    - name: 'hello-world'
    run:
    container:
    image: ubuntu:latest
    command: echo "hello world"
  2. You can edit it with your favorite YAML IDE that supports the yaml-language-server by RedHat. Or, you can use the online editor of the Nexus.

  3. The YAML language server should detect the JSON schema and show the documentation for each field:

image-20231016200613507

image-20231016200716863

(Example with VSCode)

If you need help in writing a workflow file, you can consult the Getting Started or consult the workflow reference API.

To submit a job, follow the steps indicated in the next page.

Using as a TUI

  1. Start the TUI by running dps:

    image-20231016202849709

  2. Press s to create a workflow file and open the workflow editor. Based on your environment variables, it will open your default visual text editor. On Linux, it is possible to change the visual text editor by changing the VISUAL environment variable. On Windows, the TUI will try to open nano.exe, vim.exe, notepad++.exe or notepad.exe. If none of these editors suits your needs, you can quit the editor and open the workflow file that has been created in the working directory with your favorite text editor.

  3. If your text editor supports the yaml-language-server by RedHat, the YAML language server should detect the JSON schema and show the documentation for each field:

image-20231016203757649

(Example with Helix)

If you need help in writing a workflow file, you can consult the Getting Started or consult the workflow reference API.

To submit a job, follow the steps indicated in the next page.