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

Should build command depend on Helm? #9225

Open
alewis001 opened this issue Dec 14, 2023 · 2 comments
Open

Should build command depend on Helm? #9225

alewis001 opened this issue Dec 14, 2023 · 2 comments

Comments

@alewis001
Copy link
Contributor

Expected behavior

Running skaffold build when doing a local Docker build does not require the pressence of the Helm command.

Actual behavior

When the Helm command is not present, a skaffold build fails with the following output...

creating runner: creating deployer: Helm not found. Please install helm via https://helm.sh/docs/intro/install.

Information

  • Skaffold version: v2.9.0
  • Operating system: macOS, linux
  • Installed via: skaffold.dev | Homebrew
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta8
kind: Config
metadata:
  name: xxx
build:
  artifacts:
    - image: xxx
      docker:
        dockerfile: ./src/main/docker/Dockerfile
  tagPolicy:
    customTemplate:
      template: '{{.COMMIT_SHA}}-{{.TREE_SHA}}'
      components:
        - name: COMMIT_SHA
          gitCommit:
            variant: AbbrevCommitSha
            ignoreChanges: true
        - name: TREE_SHA
          gitCommit:
            variant: AbbrevTreeSha
deploy:
  helm:
    flags:
      install:
        - --timeout
        - 10m
    releases:
      - name: xxx
        chartPath: src/main/helm
        createNamespace: true
        useHelmSecrets: true
        setValueTemplates:
          image:
            repository: "{{.IMAGE_REPO_xxx}}"
            tag: "{{.IMAGE_TAG_xxx}}@{{.IMAGE_DIGEST_xxx}}"
        valuesFiles:
          - src/main/helm/values.yaml
profiles:
  - name: linode
    patches:
      - op: add
        path: /deploy/helm/releases/0/valuesFiles
        value:
          - ./src/main/helm/values.d/XXX.yaml
          - ./src/main/helm/values.d/XXX-enc.yaml

Logs

Here's a snippet from where I think the call to Helm happens. If you need more detail I can do so but will take longer in order to redact the logs.

]  subtask=-1 task=DevLoop
DEBU[0000] setting Docker user agent to skaffold-v2.9.0  subtask=-1 task=DevLoop
INFO[0000] DOCKER_HOST env is not set, using the host from docker context.  subtask=-1 task=DevLoop
DEBU[0000] Running command: [docker context inspect --format {{.Endpoints.docker.Host}}]  subtask=-1 task=DevLoop
DEBU[0000] Command output: [unix:///Users/alewis/.docker/run/docker.sock
]  subtask=-1 task=DevLoop
INFO[0000] no kpt renderer or deployer found, skipping hydrated-dir creation  subtask=-1 task=DevLoop
DEBU[0000] Running command: [kubectl config view --minify -o jsonpath='{..namespace}']  subtask=-1 task=DevLoop
DEBU[0000] Command output: ['default']                   subtask=-1 task=DevLoop
DEBU[0000] Running command: [helm version --client]      subtask=-1 task=DevLoop
DEBU[0000] Running command: [tput colors]                subtask=-1 task=DevLoop
DEBU[0000] Command output: [256
]                        subtask=-1 task=DevLoop
creating runner: creating deployer: Helm not found. Please install helm via https://helm.sh/docs/intro/install.
DEBU[0000] exporting metrics                             subtask=-1 task=DevLoop
DEBU[0000] failed to create firelog exporter due to error: open assets/firelog_generated/key.txt: file does not exist  subtask=-1 task=DevLoop
DEBU[0000] did not create any log exporter               subtask=-1 task=DevLoop
@alewis001
Copy link
Contributor Author

I can see that this function doesn't take into account what command is being run; however, there is this this comment that suggests the deployer is required before the builder as it affects what the builder might do. Though I must admit I'm not entirely confident this code is relevant to the issue :)

@nathanperkins
Copy link

nathanperkins commented Jul 16, 2024

+1 to this, we are getting the same error in our CI when we are simply trying to build images. It would be nice if we can build images without installing him.

however, there is this this comment that suggests the deployer is required before the builder as it affects what the builder might do

That makes sense, but maybe a flag could be provided to just build all images in CI without regard for deployment.

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

2 participants