nx/docs/nx-cloud/reference/launch-templates.md
Isaac Mann 61436a64ef
docs(core): inferred targets (#21167)
Co-authored-by: Katerina Skroumpelou <mandarini@users.noreply.github.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
Co-authored-by: Victor Savkin <mail@vsavkin.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-02-03 00:14:05 -05:00

2.3 KiB

Launch Templates

You can find built-in launch templates here.

The easiest way to create a new custom launch template is to modify one of the built-in ones. To do that, create a file in the .nx/workflows folder and copy one of the built-in templates there. You can name the file any way you want (e.g., agents.yaml).

This is an example of a launch template using all built-in features:

launch-templates:
  my-linux-medium-js:
    resourceClass: ''
    image: 'ubuntu22.04-node20.9-v1'
    env: MY_ENV_VAR=shared
    init-steps:
      - name: Checkout # using a reusable step
        uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/checkout/main.yaml'
      - name: Restore Node Modules Cache
        uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/cache/main.yaml'
        env:
          KEY: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
          PATHS: 'node_modules'
          BASE_BRANCH: 'main'
      - name: Install Node Modules
        uses: 'nrwl/nx-cloud-workflows/v1.1/workflow-steps/install-node-modules/main.yaml'
      - name: Run a custom script
          git config --global user.email test@test.com
          git config --global user.name "Test Test"
      - name: Setting env # Redefine PATH for further steps
        script: echo "PATH=$HOME/my-folder:$PATH" >> $NX_CLOUD_ENV
      - name: Print path
        script: echo $PATH # will include my-folder
      - name: Define env var for a step
        env: MY_ENV_VAR=for-step
        script: echo $MY_ENV_VAR # will print for-step

Resource Classes

The following resource classes are available:

  • docker_linux_amd64/small
  • docker_linux_amd64/medium
  • docker_linux_amd64/medium+
  • docker_linux_amd64/large
  • docker_linux_amd64/large+
  • docker_linux_amd64/extra_large
  • docker_linux_amd64/extra_large+

See their detailed description and pricing at nx.app/pricing.

Image

The following images are available:

  • ubuntu22.04-node20.9-v1
  • ubuntu22.04-node20.9-withDind-v1
  • ubuntu22.04-node20.9-v2
  • ubuntu22.04-node20.9-withDind-v2

Enterprise accounts can use custom images.

Reusable Steps

You can find the list of reusable step here.