skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Gradle build concurrency can result in deadlocks

Open sergeykad opened this issue 1 year ago • 0 comments

Expected behavior

Running Skaffold with Gradle + Jib build with concurrency enabled (or maybe always?) will offload all the concurrency implementation to Gradle. In other words, building multiple images in a Gradle multimodule project will execute Gradle once with multiple tasks. For example ./gradlew module1:jib module2:jib

Actual behavior

It appears that Skaffolds executes multiple Gradle instances if build.local.concurrency: 0 is set leading to occasional deadlocks.

Information

  • Skaffold version: 2.12.0
  • Operating system: Ubuntu 22.04.4
  • Installed via: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \ sudo install skaffold /usr/local/bin/
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta11
kind: Config

metadata:
  name: core-services

build:
  local:
    concurrency: 0
  tagPolicy:
    sha256: { }
  artifacts:
    - image: service1
      jib:
        project: service1 
      sync:
        auto: true
    - image: service2
      jib:
        project: service2
      sync:
        auto: true
    - image: service3
      jib:
        project: service3
      sync:
        auto: true
    
deploy:
  helm:
    releases:
      - name: services
        namespace: my-namespace
        repo: http://helm.server.com/repository/helm-hosted/
        chartPath: simple-service-template
        version: 3.2.x
        setValueTemplates:
          services.service1.image.tag: "{{.IMAGE_TAG_service1}}@{{.IMAGE_DIGEST_service1}}"
          services.service2.image.tag: "{{.IMAGE_TAG_service2}}@{{.IMAGE_DIGEST_service2}}"
          services.service3.image.tag: "{{.IMAGE_TAG_service3}}@{{.IMAGE_DIGEST_service3}}"
       

        valuesFiles:
          - helm/services-values.yaml
        skipBuildDependencies: true 
  kubeContext: minikube

Steps to reproduce the behavior

  1. Change each of the services to trigger rebuild
  2. Execute scaffold run
  3. Repeat the steps above until skaffold run hangs

sergeykad avatar Aug 01 '24 13:08 sergeykad