Set up GitLab Duo Workflow

Use the following guide to set up GitLab Duo Workflow.

Prerequisites

Before you can use Workflow:

  1. Ensure you have an account on GitLab.com.
  2. Ensure that the GitLab.com project you want to use with Workflow meets these requirements:
  3. Install Visual Studio Code (VS Code).
  4. Install and set up the GitLab Workflow extension for VS Code. Minimum version 5.16.0.
  5. Install Docker and set the socket file path.

Install Docker and set the socket file path

Workflow needs an execution platform like Docker where it can execute arbitrary code, read and write files, and make API calls to GitLab.

If you are on macOS or Linux, you can either:

If you are not on macOS or Linux, follow the manual setup.

Automated setup

The automated setup script:

  • Installs Docker and Colima.
  • Sets Docker socket path in VS Code settings.

You can run the script with the --dry-run flag to check the dependencies that get installed with the script.

  1. Download the setup script.

    wget https://gitlab.com/gitlab-org/duo-workflow/duo-workflow-executor/-/raw/main/scripts/install-runtime
  2. Run the script.

    chmod +x install-runtime
    ./install-runtime

Manual setup

  1. Install a Docker container engine, such as Rancher Desktop.
  2. Set the Docker socket path in VS Code:
    1. Open VS Code, then open its settings:

      • On macOS: Cmd + ,
      • On Windows and Linux: Ctrl + ,
    2. In the upper-right corner, select the Open Settings (JSON) icon.

    3. Add the Docker socket path setting gitlab.duoWorkflow.dockerSocket, according to your container manager, and save your settings file. Some examples for common container managers on macOS, where you would replace <your_user> with your user’s home folder:

      • Rancher Desktop:

        "gitlab.duoWorkflow.dockerSocket": "/Users/<your_user>/.rd/docker.sock",
      • Colima:

        "gitlab.duoWorkflow.dockerSocket": "/Users/<your_user>/.colima/default/docker.sock",

Next steps

Try using GitLab Duo Workflow in your IDE.