Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM on GCP can't be created when running build on Harness #281

Open
VolodymyrZavalinskyi opened this issue Apr 24, 2023 · 0 comments
Open

Comments

@VolodymyrZavalinskyi
Copy link

VolodymyrZavalinskyi commented Apr 24, 2023

Running configurations:

docker-compose.yml

version: "3.7"
services:
  harness-ng-delegate:
    restart: unless-stopped
    network_mode: "host"
    deploy:
      resources:
        limits:
          cpus: "1.0"
          memory: 2048M
    image: harness/delegate:latest
    environment:
      ...
  drone-runner-aws:
    restart: unless-stopped
    image: drone/drone-runner-aws:latest
    volumes:
      - /runner:/runner
      - /root/.config/gcloud/:/key
    entrypoint: ["/bin/drone-runner-aws", "delegate", "--pool", "pool.yml"]
    working_dir: /runner
    ports:
      - "3000:3000"

pool.yml

version: "1"
instances:
  - name: ubuntu-gcp
    default: true
    type: google
    pool: 1
    limit: 3
    platform:
      os: linux
      arch: amd64
    spec:
      account:
        project_id: xxxx
      image: projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1804-bionic-v20220510
      machine_type: e2-standard-4
      zone:
        - us-east1-b
      disk:
        size: 50
        type: "pd-ssd"

Errors:

time="2023-04-24T11:07:18Z" level=trace msg="starting the setup process" pool_id=ubuntu-gcp stage_runtime_id=PuDn1n8DSPmOaYfpnlvWNg

time="2023-04-24T11:07:18Z" level=trace msg="google: creating VM" cloud=google image=projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1804-bionic-v20220510 name=2839f4ce4bdf-ubuntu-gcp-orqhmdbs-z7gfs pool=ubuntu-gcp size=e2-standard-4 stage_runtime_id=PuDn1n8DSPmOaYfpnlvWNg zone=us-east1-b

time="2023-04-24T11:07:19Z" level=error msg="google: failed to provision VM" cloud=google error="googleapi: Error 400: Invalid value for field '[resource.name](https://app.harness.io/ng/account/xxxxx/home/orgs/global/projects/test/pipelines/test/executions/xxxxx/resource.name)': '2839f4ce4bdf-ubuntu-gcp-orqhmdbs-z7gfs'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid" image=projects/ubuntu-os-pro-cloud/global/images/ubuntu-pro-1804-bionic-v20220510 name=2839f4ce4bdf-ubuntu-gcp-orqhmdbs-z7gfs pool=ubuntu-gcp size=e2-standard-4 stage_runtime_id=PuDn1n8DSPmOaYfpnlvWNg zone=us-east1-b

time="2023-04-24T11:07:19Z" level=error msg="failed to provision instance" error="provision: failed to create instance: googleapi: Error 400: Invalid value for field '[resource.name](https://app.harness.io/ng/account/-xxxxx/home/orgs/global/projects/test/pipelines/test/executions/xxxxx/resource.name)': '2839f4ce4bdf-ubuntu-gcp-orqhmdbs-z7gfs'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid" pool_id=ubuntu-gcp stage_runtime_id=PuDn1n8DSPmOaYfpnlvWNg

GCP requires lowercase letters for the prefix of the VM name, and numbers are not allowed in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant