Skip to content

No build clause in root level skaffold.yaml inserts local.Builder, messing up GCB Concurrency #8494

@dhodun

Description

@dhodun

Expected behavior

When I run skaffold dev on resources that all use Google Cloud Build and have default concurrency of parallel (0), they run in parallel.

Actual behavior

Our builds run serially.

Fix

Add the following clause to the base skaffold.yaml

build:
  googleCloudBuild: {}

Information

skaffold version: v1.39.3
OS: Mac

yaml setup:

base skaffold.yaml that looks like this:

# Master Skaffold
apiVersion: skaffold/v2beta12
kind: Config
metadata:
  name: backends
requires:
- path: ./common
  configs: [common]

- path: ./microservices/service1
  configs: [service1]

- path: ./microservices/service2
  configs: [service2]

Service yaml (we are targeting a build that uses custom profile and GCB).

apiVersion: skaffold/v2beta12
kind: Config
metadata:
  name: service1
requires:
  - path: ../../common
    configs: [common]
build:
  tagPolicy:
    gitCommit: {}
  local:
    concurrency: 0
  artifacts:
  - image: service1
    requires:
      - image: common
        alias: BASE_IMG
    sync:
      infer:
        - '**/*.py'
        - '**/*.json'
portForward:
- resourceType: service
  resourceName: service1
  port: 80
  localPort: 9031
deploy:
  kustomize:
    paths:
    - ./kustomize/minikube
profiles:
- name: custom
  build:
    googleCloudBuild:
      concurrency: 0
    artifacts:
    - image: service1
      requires:
      - image: common
        alias: BASE_IMG
  deploy:
    kustomize:
      paths:
      - ./kustomize/custom

When we don't target a group of services with -m service1,service2 and instead run just skaffold dev, a local builder gets inferred for the base skaffold.yaml even there there isn't a build clause, bringing concurrency to 1:

From logs:

time="2023-03-04T10:30:07-05:00" level=debug msg="parsed 1 configs from configuration file /Users/dhodun/developer/cloud-learning-platform/skaffold.yaml" subtask=-1 task=DevLoop
time="2023-03-04T10:30:07-05:00" level=debug msg="Defaulting build type to local build" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency first set to 0 parsed from *gcb.Builder[0]" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[1] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[2] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[3] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[4] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[5] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency value 0 parsed from *gcb.Builder[6] is ignored since it's not less than previously set value 0" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="build concurrency updated to 1 parsed from *local.Builder[7]" subtask=-1 task=DevLoop
time="2023-03-04T10:30:10-05:00" level=info msg="final build concurrency value is 1" subtask=-1 task=DevLoop
Listing files to watch...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions