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

Image too large; split extras to separate tag? #52

Open
lutzky opened this issue Dec 30, 2024 · 1 comment
Open

Image too large; split extras to separate tag? #52

lutzky opened this issue Dec 30, 2024 · 1 comment

Comments

@lutzky
Copy link
Contributor

lutzky commented Dec 30, 2024

From #38 (comment):

I'm considering reverting this change, as fava-portfolio-returns depends on beangrow, which in turn depends on scipy. As the results of that dependency, the fava docker image is ballooning from ~60MiB to ~150MiB (with the uncompressed image to ~500MiB when inspected using https://github.com/wagoodman/dive).

Maybe it's better to build with this dependency with vxxx-extras and latest-extras labels, so that people can choose between a minimum setup and a full-featured setup. But I'm not sure how to do that the best with a combination of the Dockerfile and the actions workflow....

I like it! Here's what I'm thinking: We can use build variables for this.

  • In the github workflow, add a matrix for two build_variant options - normal and extras.
  • In the Build and push Docker image step:
    • Set the tags to conditionally add -extras as appropriate.
    • Add build-args: [BUILD_VARIANT=${{ matrix.build_variant }}]
  • Split requirements.txt so some of it is in requirements-extra.txt.
  • In Dockerfile, add ARG BUILD_VARIANT. Only perform the extra pip3 install steps for the extra variant.

What do you think?

@yegle
Copy link
Owner

yegle commented Dec 30, 2024

Oh thanks for the tip on the matrix! I'll give it a go.

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

No branches or pull requests

2 participants