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

Heroku-24: Remove git from the run image #274

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 20, 2024

(This is stacked on top of #273.)

Since:

  • Most Git use-cases are for cloning dependencies during the build (and Git will still be in the build image).
  • On Heroku at runtime there is no .git/ metadata to query the local project's repo anyway (since the directory isn't preserved during the build).
  • It reduces the run image size by 17 MB, and in a CNB world image size is a much bigger concern, so we need to be more selective about what packages we include.
  • Once Heroku-24 GAs we can't remove packages (since it will break backwards compatibility given stack rebasing), however, we can add packages - so we should err on the side of trying out removing packages now.

Before (once #273 merges):

-----> Size breakdown...
       heroku/heroku:24         458MB
       heroku/heroku:24-build   1.13GB

After:

-----> Size breakdown...
       heroku/heroku:24         441MB  (17 MB reduction)
       heroku/heroku:24-build   1.13GB (unchanged)

Towards #266.
GUS-W-15159536.

@edmorley edmorley self-assigned this Mar 20, 2024
@edmorley edmorley marked this pull request as ready for review March 20, 2024 14:05
@edmorley edmorley requested a review from a team as a code owner March 20, 2024 14:05
Base automatically changed from edmorley/h24-gcc-build-only to main March 21, 2024 15:03
Since:
- Most Git use-cases are for cloning dependencies during the build.
- On Heroku at runtime there is no `.git/` metadata to query the
  local project's repo anyway (since the directory isn't preserved
  during the build).
- It saves 17 MB, and in a CNB world image size is a much bigger
  concern, so we need to be more selective about what packages
  we include.
- Once Heroku-24 GAs we can't remove packages (since it will break
  backwards compatibility given stack rebasing), however, we can add
  packages - so we should err on the side of removing packages now.

Before:

```
-----> Size breakdown...
       heroku/heroku:24         458MB
       heroku/heroku:24-build   1.13GB
```

After:

```
-----> Size breakdown...
       heroku/heroku:24         441MB
       heroku/heroku:24-build   1.13GB
```

Towards #266.
GUS-W-15159536.
@edmorley edmorley force-pushed the edmorley/h24-git-build-only branch from e5b3c4d to 75c7948 Compare March 21, 2024 15:12
@edmorley edmorley merged commit f177eea into main Mar 21, 2024
4 checks passed
@edmorley edmorley deleted the edmorley/h24-git-build-only branch March 21, 2024 16:25
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

Successfully merging this pull request may close these issues.

2 participants