Skip to content

GraphQL: Add ProvisionGoogleCloudRunner mutation

Pedro Pombeiro requested to merge pedropombeiro/438316/2-create-mutation into master

What does this MR do and why?

This MR builds on !143214 (merged) to add a ProvisionGoogleCloudRunner mutation that can output instructions for setting up a runner in Google Cloud. The goal is in the future for this mutation to trigger all the automation required to provision the runner without further user intervention.

The mutation will validate that the arguments passed in are valid by calling to Google Cloud APIs, and then return a Terraform script. The final form of the Terraform script hasn't yet been decided, but nothing prevents us from reviewing and merging this alpha-state mutation in parallel with that work.

EE: true

Part of #438316 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

scenario screenshot
valid query image
invalid arguments image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Ensure you have an Ultimate license attached to your GDK

  2. Simulate a SaaS GitLab instance by running:

    export GITLAB_SIMULATE_SAAS=1
    gdk restart
  3. Run the following query (with the specified JSON variables) in http://gdk.test:3000/-/graphql-explorer:

    mutation provisionGoogleCloudRunner($input: ProvisionGoogleCloudRunnerInput!) {
      provisionGoogleCloudRunner(input: $input) {
        provisioningSteps {
          title
          languageIdentifier
          instructions
        }
        errors
      }
    }
    {
      "input": {
        "dryRun": true,
        "projectPath": "gitlab-org/playground",
        "provisioningProjectId": "my-identity-management-project",
        "provisioningMachineType": "n2d-standard-2",
        "provisioningRegion": "us-central1",
        "provisioningZone": "us-central1-a",
        "runnerToken": "glrt-xyz"
      }
    }
  4. If you don't have a working connection to a GLGO service (see !143214 (merged)), you'll see an error such as:

    {
      "errors": [
        {
          "message": "Internal server error: Unable to retrieve Identity Pool subject token {\"error\":\"unknown input token issuer \\\"http://gdk.test:3000\\\"\"}\n",
          "raisedAt": "..."
        }
      ]
    }
Edited by Pedro Pombeiro

Merge request reports