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

Inconsistent (redundant?) bundle builds #2503

Closed
tamirkamara opened this issue Dec 26, 2022 · 7 comments · Fixed by #2719
Closed

Inconsistent (redundant?) bundle builds #2503

tamirkamara opened this issue Dec 26, 2022 · 7 comments · Fixed by #2719
Assignees
Labels
bug Oops, sorry!

Comments

@tamirkamara
Copy link
Contributor

Describe the bug

It looks like porter decides to rebuild a bundle for no consistent reason.
I see this when calling publish right after a build which is rebuilding everything. I also see it with explain...

To Reproduce

Steps to reproduce the behavior:

  1. Run the following script: porter build && for i in {1..9}; do porter explain -oyaml > $i.yaml; done
  2. Review the files created and notice that some include the "build prints" which shouldn't be there if every explain command used an existing built bundle.

Expected behavior

  1. All explain in the script above should use the initial built bundle
  2. When calling publish right after a build, the bundle isn't rebuilt

Version

Copy the output of porter version below

porter v1.0.4 (e3a2a5e)

@tamirkamara tamirkamara added the bug Oops, sorry! label Dec 26, 2022
@joshuabezaleel
Copy link
Contributor

I assume this issue is related to #2391 as well (?)

@tamirkamara
Copy link
Contributor Author

Looks like the underlining JIT build issue is the same, although there's no build-arg involved here.

@carolynvs
Copy link
Member

@tamirkamara This doesn't reproduce as easily as your reproduction steps show. Are there any characteristics about your bundles that rebuild at the wrong times? Do you pass any flags to the build command? Do you run out of disk space and sometimes prune your local Docker cache?

@tamirkamara
Copy link
Contributor Author

tamirkamara commented Feb 22, 2023

@carolynvs Most of our bundles exhibit this behavior with porter v1.0.4. For example: https://github.com/microsoft/AzureTRE/tree/main/templates/workspaces/base
It uses Terraform & AZ cli mixin, plus installs a couple of utils via a custom dockerfile.

(porter v1.0.8 with autobuild disabled solves this issue for us so maybe we can close it?)

@carolynvs
Copy link
Member

It's to know that 1.0.8 with autobuild disabled is working for you. Yes, we can close for now and I'll keep an eye out for if I see it reproduce locally. Thanks!

@carolynvs
Copy link
Member

I was able to reproduce this while fixing a bug in today's release. Reopening!

The problem is that when we calculate the manifest digest on the bundle.json stamp, we don't consistently sort the mixins, so depending on how Go feels like sorting the mixin map, we can get a different digest, and trigger rebuild.

@carolynvs
Copy link
Member

Sorry this took so long to track down and reproduce! This will be included in this week's 1.0.13 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants