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

feat: Multi-arch Python base image #614

Merged
merged 10 commits into from
Dec 11, 2023
Merged

Conversation

mvgijssel
Copy link
Member

@mvgijssel mvgijssel commented Dec 5, 2023

ref #451

  • What happens if we run x86_64 on macbook M1? Can we validate this alternative arch works?
nix-build test.nix
docker load < result && docker run --rm -it --platform linux/amd64 myimage:latest
> uname -a
Linux db2e968516f1 6.4.16-linuxkit #1 SMP PREEMPT Thu Nov 16 10:49:20 UTC 2023 x86_64 GNU/Linux
  • Setup two separate nixpkgs workspaces, one for each arch
  • Use rules_oci to combine the images into a multi arch image
  • Remove host_python_container_platform
  • Create changesets

@mvgijssel
Copy link
Member Author

mvgijssel commented Dec 5, 2023

Because cross compiling is very slow try:

  1. Use cachix to cache derivations so subsequent compilations go faster (https://discourse.nixos.org/t/armv7l-builds-on-cachix/788)
  2. Use binary cache for aarch64 as mentioned here (https://nixos.wiki/wiki/Nix_on_ARM)
  3. Use trick from https://nixos.wiki/wiki/Cross_Compiling

@mvgijssel mvgijssel marked this pull request as draft December 5, 2023 20:23
@mvgijssel mvgijssel changed the title Trying to cross compile python base image Multi-arch Python base image Dec 11, 2023
@mvgijssel mvgijssel marked this pull request as ready for review December 11, 2023 19:27
@mvgijssel mvgijssel changed the title Multi-arch Python base image feat: Multi-arch Python base image Dec 11, 2023
@mvgijssel mvgijssel enabled auto-merge (squash) December 11, 2023 19:50
@mvgijssel mvgijssel mentioned this pull request Dec 11, 2023
17 tasks
@mvgijssel mvgijssel merged commit 2b3ea26 into master Dec 11, 2023
3 checks passed
@mvgijssel mvgijssel deleted the mg/451/multi-arch-bunq2ynab branch December 11, 2023 19:55
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.

1 participant