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

Skaffold always builds a new image when no file has been changed! #4793

Closed
oo00spy00oo opened this issue Sep 16, 2020 · 7 comments
Closed

Skaffold always builds a new image when no file has been changed! #4793

oo00spy00oo opened this issue Sep 16, 2020 · 7 comments
Labels
area/sync kind/bug Something isn't working needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug priority/p1 High impact feature/bug.

Comments

@oo00spy00oo
Copy link

oo00spy00oo commented Sep 16, 2020

Listing files to watch...

  • [REDACT]
    Generating tags...
  • [REDACT] -> [REDACT]:v1.0.3-44-ga3593b2-dirty
    Checking cache...
  • [REDACT] Not found. Building

Expected behavior

In case sync mode is enabled, we should have an option to disable auto-build mode when changing the content of any files!

Actual behavior:

Skaffold always builds the new image while I didn't change anything in my project.

Information

  • Skaffold version: version: v1.14.0
  • Operating system: MacOSX 10.16
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta7
kind: Config
build:
  artifacts:
    - image: [REDACT]
      sync:
        infer:
          - "**/*.go"
      kaniko:
        dockerfile: Dockerfile.kaniko
  cluster:
    namespace: [REDACT]
    dockerConfig:
      secretName: kaniko-secret
deploy:
  kustomize: {}
@nkubala
Copy link
Contributor

nkubala commented Sep 21, 2020

hey @oo00spy00oo thanks for the issue. I want to make sure I understand exactly what's going on here - is skaffold continuously rebuilding your image even when you change no files? or is skaffold rebuilding when it's supposed to just be syncing, since you have sync configured in your skaffold.yaml? it sounds like there could be a bug here so I want to make sure we're investigating the right thing.

in the meantime, if you'd like you can use the --auto-build=false flag to disable automatic rebuilding. you can then hit the skaffold API to trigger builds when you're ready - the port is automatically assigned and given through the logs if you don't provide one, or you can specify it explicitly using the --rpc-port or --rpc-http-port flag.

skaffold dev --auto-build=false --rpc-http-port=12345
<make some code changes>
curl http://localhost:12345/v1/execute -d '{"build": true}' <- do this in a different terminal window

@nkubala nkubala added the needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug label Sep 21, 2020
@NixBiks
Copy link

NixBiks commented Sep 21, 2020

I’ll chip in since I have a similar issue if I understand @oo00spy00oo correctly.

My issue is when I run skaffold build (or run) in my GitHub action then it rebuilds every artifact - also the ones that are already available in my remote repo (and haven’t been changed). So it doesn’t use the remote repo as cache.

@oo00spy00oo
Copy link
Author

oo00spy00oo commented Sep 30, 2020

hey @oo00spy00oo thanks for the issue. I want to make sure I understand exactly what's going on here - is skaffold continuously rebuilding your image even when you change no files? or is skaffold rebuilding when it's supposed to just be syncing, since you have sync configured in your skaffold.yaml? it sounds like there could be a bug here so I want to make sure we're investigating the right thing.

in the meantime, if you'd like you can use the --auto-build=false flag to disable automatic rebuilding. you can then hit the skaffold API to trigger builds when you're ready - the port is automatically assigned and given through the logs if you don't provide one, or you can specify it explicitly using the --rpc-port or --rpc-http-port flag.

skaffold dev --auto-build=false --rpc-http-port=12345
<make some code changes>
curl http://localhost:12345/v1/execute -d '{"build": true}' <- do this in a different terminal window

I meant when sync mode is enabled, Skaffold is continuously rebuilding the image, it isn't necessary or it makes sync mode become non-sensical.

@tejal29 tejal29 added the priority/p1 High impact feature/bug. label Oct 5, 2020
@briandealwis
Copy link
Member

@oo00spy00oo could you please attach your logs from running with skaffold dev -v debug? I'm wondering if the sync is being attempted but is failing, and so the image is being rebuilt.

@tejal29
Copy link
Member

tejal29 commented Oct 13, 2020

This could be related to #4898
Can you please confirm if your Dockerfile has a Copy . ?

@MarlonGamez MarlonGamez removed the triage/discuss Items for discussion label Nov 2, 2020
@briandealwis
Copy link
Member

Closing, but will re-open if @oo00spy00oo can provide more detail.

@medkbadri
Copy link

I have a similar problem. Once my deployment becomes healthy, skaffold rebuilds it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync kind/bug Something isn't working needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug priority/p1 High impact feature/bug.
Projects
None yet
Development

No branches or pull requests

7 participants