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

Fix rust caching and duplicate buildpack compilation #91

Merged
merged 6 commits into from
Aug 1, 2023
Merged

Conversation

colincasey
Copy link
Contributor

@colincasey colincasey commented Jul 26, 2023

This is a restructuring of the whole release process to eliminate the issues outlines in #48 (buildpacks compiled multiple times could result in non-determinism) and #49 (rust caching isn't working due to non-unique keys).

Many of the overall steps are still the same but the detect job has been replaced by a compile job which front loads all the rust and buildpack compilation and cached the compiled buildpack folder for later use. Compilation was previously handled in the package job which is no longer needed.

To support this new flow, a buildpack_output_dir value had to be added to the generated buildpack matrix. This also allowed some simplification in terms of the assets cached since the OCI image and CNB file can be generated directly from the compiled buildpack_output_dir we don't need to store those values in the cache anymore.

Fixes #48 (W-13738777), fixes #49 (W-13738739)

Note - I discovered I was mistaken about how strategies and shared workflows interact. Turns out you can use them. The GitHub Actions docs make it sound like you can't and I must have messed up when I initially tried this. Using this new shared workflow should simplify the calling release.yml files in our buildpack repos 😄

We'll also need to be careful with changes to buildpack output locations like heroku/libcnb.rs#583 and ensure these still line up with expectations in our release process.

This is a restructuring of the whole release process to eliminate the issues outlines in #48 (buildpacks compiled multiple times could result in non-determinism) and #49 (rust caching isn't working due to non-unique keys).

Many of the overall steps are still the same but the `detect` job has been replaced by a `compile` job which front loads all the rust and buildpack compilation and cached the compiled buildpack folder for later use. Compilation was previously handled in the `package` job which is no longer needed.

To support this new flow, a `buildpack_output_dir` value had to be added to the generated buildpack matrix. This also allowed some simplification in terms of the assets cached since the OCI image and CNB file can be generated directly from the compiled `buildpack_output_dir` we don't need to store those values in the cache anymore.
@colincasey colincasey requested a review from a team as a code owner July 26, 2023 19:04
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this! I love the new combined shared workflow idea too - as you say, it should reduce the boilerplate in each buildpack's repo :-)

I presume the rollout plan for this is to merge this PR, switch the repos over to using the new workflow, then remove the old separated workflows afterwards? (If so, that sounds good to me - I was just initially wondering why the old workflows weren't deleted in this PR.)

.github/workflows/_buildpacks-release.yml Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Show resolved Hide resolved
.github/workflows/_buildpacks-release.yml Outdated Show resolved Hide resolved
@edmorley edmorley added the enhancement New feature or request label Jul 27, 2023
@colincasey
Copy link
Contributor Author

@edmorley re: rollout plan - you are correct. merge this PR, switch the repos over to using the new workflow, then remove the old separated workflows afterwards.

colincasey and others added 3 commits July 28, 2023 09:03
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
@colincasey colincasey merged commit fcfbb5b into main Aug 1, 2023
@colincasey colincasey deleted the issue_48_49 branch August 1, 2023 14:13
colincasey added a commit to heroku/buildpacks-nodejs that referenced this pull request Aug 1, 2023
colincasey added a commit to heroku/buildpacks-jvm that referenced this pull request Aug 1, 2023
colincasey added a commit to heroku/buildpacks-ruby that referenced this pull request Aug 1, 2023
colincasey added a commit to heroku/buildpacks-go that referenced this pull request Aug 1, 2023
colincasey added a commit to heroku/buildpacks-php that referenced this pull request Aug 1, 2023
edmorley pushed a commit to heroku/buildpacks-nodejs that referenced this pull request Aug 2, 2023
edmorley pushed a commit to heroku/buildpacks-jvm that referenced this pull request Aug 2, 2023
edmorley pushed a commit to heroku/buildpacks-ruby that referenced this pull request Aug 2, 2023
edmorley pushed a commit to heroku/buildpacks-go that referenced this pull request Aug 2, 2023
edmorley pushed a commit to heroku/buildpacks-php that referenced this pull request Aug 2, 2023
Switches to the new combined workflow approach added in:
heroku/languages-github-actions#91
colincasey added a commit that referenced this pull request Aug 3, 2023
colincasey added a commit that referenced this pull request Aug 4, 2023
* Post PR #91 Cleanup

We can remove these separated workflows now that the following PRs have been merged:

- heroku/buildpacks-jvm#554
- heroku/buildpacks-php#14
- heroku/buildpacks-go#123
- heroku/buildpacks-ruby#183
- heroku/buildpacks-nodejs#609
- heroku/buildpacks-python#58
- heroku/buildpacks-procfile#156

* PR feedback
colincasey added a commit that referenced this pull request Aug 4, 2023
* main:
  Post PR #91 Cleanup (#97)
  Post PR #88 Cleanup (#98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants