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

With buildpack & auto sync a full re-build happens unpredictably #5140

Open
etanshaul opened this issue Dec 11, 2020 · 7 comments
Open

With buildpack & auto sync a full re-build happens unpredictably #5140

etanshaul opened this issue Dec 11, 2020 · 7 comments
Labels
help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request kind/friction Issues causing user pain that do not have a workaround planning/Q4-21 Q4 2021 planning priority/p2 May take a couple of releases

Comments

@etanshaul
Copy link
Contributor

etanshaul commented Dec 11, 2020

Tested using skaffold 1.17.2

  1. Clone the Cloud Code Go hello-world k8s sample: https://github.com/GoogleCloudPlatform/cloud-code-samples/tree/master/golang/go-hello-world
  2. Configure your build to use buildpacks:
build:
  tagPolicy:
    sha256: {}
  artifacts:
  - image: go-hello-world
    context: .
    buildpack:
      builder: gcr.io/buildpacks/builder:v1
  1. Run skaffold dev
  2. Make a change in main.go

Expected: Skaffolds auto-sync for buildpacks would automtically sync the change without performing a full container rebuild.

Actual: The full build happens.

Note: This only seems to happen unpredictably; in my tests, some changes sync, others trigger a full rebuild (the changes are identical each time - e.g. a simple fmt.Println string modification in this case).

Example output (the first couple changes did a full rebuild, the last change synced).

@etanshaul etanshaul changed the title Buildpack auto sync performs a full re-build on first change With buildpack & auto sync a full re-build happens unpredictably Dec 11, 2020
@abbycar
Copy link

abbycar commented Dec 11, 2020

+1 here's a video of the same behavior

@tejal29 tejal29 self-assigned this Dec 14, 2020
@tejal29
Copy link
Member

tejal29 commented Dec 14, 2020

@briandealwis i am going to look into this as a starter bug for buildpacks :)

@tejal29
Copy link
Member

tejal29 commented Dec 15, 2020

Some notes from my debugging on command line

  1. First error i see, is .swp file is being detected as modified which triggers the re-build.
Deployments stabilized in 2.533034424s
Watching for changes...
DEBU[0148] Change detected notify.Create: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/4913" 
DEBU[0148] Change detected notify.Rename: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go~" 
DEBU[0148] Change detected notify.Create: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go" 
DEBU[0148] Change detected notify.Remove: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go~" 
DEBU[0148] Change detected notify.Rename: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go" 
DEBU[0148] Change detected notify.Write: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go" 
DEBU[0148] Change detected notify.Remove: "/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/4913" 
INFO[0149] files modified: [cmd/hello-world/.main.go.swp cmd/hello-world/main.go] 
DEBU[0149] Using default workdir '/' for go-hello-world:ac7fb047c293514cd108ed3851b1606d270efb5b0bbb809258e7964fa85346ae 
INFO[0149] Changed file cmd/hello-world/.main.go.swp does not match any sync pattern. Skipping sync 

@tejal29
Copy link
Member

tejal29 commented Dec 15, 2020

  1. For IDEs, i see .idea folder files are detected as changed
time="2020-12-15T10:16:00-08:00" level=debug msg="Change detected notify.Write: \"/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/cmd/hello-world/main.go\""
time="2020-12-15T10:16:01-08:00" level=debug msg="Change detected notify.Write: \"/Users/tejaldesai/workspace/cloud-code-samples/golang/go-hello-world/.idea/workspace.xml\""
time="2020-12-15T10:16:02-08:00" level=info msg="files modified: [.idea/workspace.xml cmd/hello-world/main.go]"
time="2020-12-15T10:16:02-08:00" level=debug msg="Using default workdir '/' for go-hello-world:6a7356664f6004e3636ee0ac5837750353d08ea79adafa9311f9b2afc5412a8a"
time="2020-12-15T10:16:02-08:00" level=info msg="Changed file .idea/workspace.xml does not match any sync pattern. Skipping sync"

@briandealwis briandealwis added area/sync build/buildpacks kind/bug Something isn't working priority/p1 High impact feature/bug. labels Dec 15, 2020
tejal29 added a commit to tejal29/skaffold that referenced this issue Dec 15, 2020
In preparation for GoogleContainerTools#5140,
1. Move fsNotifyTrigger into its own package.
2. Add a function `Ignore` to configure the fsNotifyWatcher to ignore
   - files belonging to predefined dirs like .idea .vscode & .git
   - hidden file like .somefile.swp

*Output change**
None.

*Future Work*
1. Configure the `Ignore` to ignore files mentioned above
tejal29 added a commit that referenced this issue Dec 21, 2020
* [Refactor] Move FSNotify trigger into a separate package

In preparation for #5140,
1. Move fsNotifyTrigger into its own package.
2. Add a function `Ignore` to configure the fsNotifyWatcher to ignore
   - files belonging to predefined dirs like .idea .vscode & .git
   - hidden file like .somefile.swp

*Output change**
None.

*Future Work*
1. Configure the `Ignore` to ignore files mentioned above

* override first, create later
@tejal29 tejal29 added this to the v1.18.0 milestone Jan 19, 2021
@briandealwis briandealwis modified the milestones: v1.18.0, v1.19.0 Jan 25, 2021
@gsquared94
Copy link
Collaborator

@tejal29 are you still working on this; or should we lower the priority (exceeded the threshold for P1s)?

@nkubala nkubala modified the milestones: v1.20.0-candidate, Backlog [P0/P1] Feb 9, 2021
@nkubala nkubala added help wanted We would love to have this done, but don't have the bandwidth, need help from contributors priority/p2 May take a couple of releases and removed priority/p1 High impact feature/bug. labels Feb 12, 2021
@tejal29 tejal29 modified the milestones: Backlog [P0/P1], Icebox [P2+], v1.21.0-rc Feb 16, 2021
@tejal29
Copy link
Member

tejal29 commented Feb 16, 2021

This is a P1 but i havent been actively working on it.

@tejal29 tejal29 added kind/feature-request and removed kind/bug Something isn't working labels May 17, 2021
@tejal29
Copy link
Member

tejal29 commented May 17, 2021

After discussing the issue with @briandealwis, We need to figure a way in skaffold to ignore files .skaffoldignore and add few expected files like .idea/, .vscode etc

Changing this to feature request

@tejal29 tejal29 removed this from the v1.27.0 milestone Jun 16, 2021
@tejal29 tejal29 assigned aaron-prindle and unassigned tejal29 Jun 16, 2021
@tejal29 tejal29 added planning/Q4-21 Q4 2021 planning kind/friction Issues causing user pain that do not have a workaround and removed planning/Q3-21 build/buildpacks area/sync labels Sep 13, 2021
@tejal29 tejal29 added this to the v1.38.0 milestone Oct 13, 2021
@tejal29 tejal29 removed this from the v1.38.0 milestone Mar 9, 2022
@aaron-prindle aaron-prindle removed their assignment Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request kind/friction Issues causing user pain that do not have a workaround planning/Q4-21 Q4 2021 planning priority/p2 May take a couple of releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants