Skip to content

[POC] Multi-platform in dagger europa#1467

Closed
TomChv wants to merge 6 commits intodagger:mainfrom
TomChv:poc/push-multi-platform
Closed

[POC] Multi-platform in dagger europa#1467
TomChv wants to merge 6 commits intodagger:mainfrom
TomChv:poc/push-multi-platform

Conversation

@TomChv
Copy link
Copy Markdown
Member

@TomChv TomChv commented Jan 20, 2022

Changes

Related to #1371, this PR is a working PoC of multi-platform in Europa that we can use to choose a final design

This PR improve #Push to push multi-platform image using new inputs field.
It will push all image one by one and then return the digest of the manifest list. The user can then use it to pull a specific platform using the new platform field in #Pull.
Indeed, I've also update #Dockerfile to supports only one platform instead of an array.

@shykes @aluzzardi IMO we should maybe create a specific definition to push multi-platform image, this way we can split the code and improve the maintainability.

List of improvement

Push

  • Update #Push definition to supports multiple inputs
  • Update push task to push multi-platform image
  • Update Solver to expose an Image interface that store every data required to push an image
  • Update Solver with a Exports method to push multi-platform

Dockerfile

  • Update #Dockerfile to supports only one platform instead of an array
  • Update dockerfile task to only parse one platform

Pull

  • Update #Pull with a field platform to specify a specific platform to pull for multi-platform digest
  • Update pull task to parse and use this platform field

Tests

  • Test multi-platform build & push image
  • Test pull with a targeted platform

Should we test failure case?

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 20, 2022

✔️ Deploy Preview for devel-docs-dagger-io ready!

🔨 Explore the source changes: 055669adf7867eded823353edf6bc2e611dd4fc3

🔍 Inspect the deploy log: https://app.netlify.com/sites/devel-docs-dagger-io/deploys/61f2c4a974231a000863c4fe

😎 Browse the preview: https://deploy-preview-1467--devel-docs-dagger-io.netlify.app

@aluzzardi
Copy link
Copy Markdown
Contributor

Great POC, @TomChv!

Now we have a much better visibility on how the low-level platform stuff works with buildkit.

I didn't review in depth the code yet, I think first we need to figure out how the high level API looks like and answer the questions in #1371

@TomChv
Copy link
Copy Markdown
Member Author

TomChv commented Jan 21, 2022

@aluzzardi Actually the PR will always fail because our buildkit image do not support binfmt

Here is logs

# 10:32PM INF actions."test-linux/arm64".printArch | computing
646
# 10:32PM INF actions."test-linux/amd64".printArch | completed    duration=100ms
647
# 10:32PM INF actions."test-linux/arm64".printArch | #7 0.113 standard_init_linux.go:228: exec user process caused: exec format error
648
# 10:32PM INF actions."test-linux/amd64".test | computing
649
# 10:32PM INF actions."test-linux/amd64".test | completed    duration=0s
650
# 10:32PM ERR actions."test-linux/arm64".printArch | failed: process "/bin/sh -c uname -m >> /arch.txt" did not complete successfully: exit code: 1    duration=200ms
651
# 10:32PM ERR actions."test-linux/s390x".image | canceled    duration=300ms
652
# 10:32PM FTL system | failed to up environment: task failed: actions."test-linux/arm64".printArch: process "/bin/sh -c uname -m >> /arch.txt" did not complete successfully: exit code: 1

We get the troubleshooting explained : here

@dubo-dubon-duponey Already has a working Dockerfile but it's huge so I'll try to create an simpler image

@TomChv
Copy link
Copy Markdown
Member Author

TomChv commented Jan 27, 2022

CI fixed thanks QEMU action (more details here)

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants