Build multi-arch images if PLATFORMS env var is set#143
Build multi-arch images if PLATFORMS env var is set#143hashhar merged 11 commits intotrinodb:masterfrom
Conversation
6a17490 to
b4fff74
Compare
b7675e0 to
6ba28ce
Compare
|
The only images that we can't build for arm64 are CDH, HDP, and Greenplum. I guess Greenplum is not critical, but we should look for replacements for CDH and HDP. |
|
@nineinchnick What do you mean by replacements for CDH and HDP? Also note that it'll always be the case when some software either can't be compiled for ARM or has different behaviour on ARM. |
I'm not sure TBH. My next step is to go over all product tests in Trino, see which ones work and what's the coverage of those that don't. I'm open to suggestions and only wanted to start a discussion. |
|
Sorry, I just meant to say that even when we have ARM images it should be limited to developer workflow only and CI shouldn't use those (unless the software is usually deployed on ARM instances). |
|
Agreed, I have no plans on trying to run anything in the CI with emulation. |
|
Approach seems sound to me and it's not very invasive. It might help if you could point out in the commit message + PR description why I'll review the wrappers later in the week. |
34edc7a to
7a88064
Compare
|
@hashhar I updated the commit message. I also added another commit with the necessary changes in the release workflow. I don't like how it needs to keep track of which images are multi-arch and which are not, but the alternative is to keep them in separate directories, and this is worse, because:
I think it's ok as is, as manual releases are discouraged anyway. I don't want to mess with the Makefile any more than necessary. |
|
We were discussing about how to better support ARM/M1 and some issues were pointed out. Since we won't actually test using the ARM images on CI we can never guarantee that the ARM images work correctly. e.g. it's possible that someone uses ARM image to test and then sees a test failure but the actual cause of failure is in the software being run on ARM instead of Trino itself. Another issue was that not everything can be built for ARM anyway. I'm unclear how we want to proceed here - cc: @wendigo @lukasz-walkiewicz |
|
I'd prefer to work out remote M1 to X86 testing rather than building and maintaining a large set of images for ARM64. I guess that having a basic |
ARM64 is going to become, increasingly, the main development platform for most Trino developers, so it needs to be possible to run those tests locally. |
|
@martint not every system we integrate with will run on arm. How can we workaround that? |
|
I think we should split this in two:
|
|
@martint @hashhar @wendigo @mdesmet I'm sorry but I'm not sure if there's any action for me to do in this PR. Would it be sufficient to test images with emulation? Currently, only the Until GitHub adds public runners for arm64, emulation is the only option. There's an option of using free arm64 instances from other cloud providers and configuring self-hosted runners in GitHub Actions, but using self-hosted runners for public repositories is highly discouraged by GitHub for security reasons. |
138c96e to
9610081
Compare
|
I'm ok with adding images provided we are all aware that images may or may not work as expected. i.e. tests may fail locally which run fine on CI. |
Why would that happen? Or did you mean trino tests? But it's clear which images are provided for which architecture, so I'm not sure why there would be unexpected behavior. |
7efeb3d to
ebffe28
Compare
ebffe28 to
1cb2330
Compare
|
@hashhar rebased and ready for another round. |
|
@hashhar ping |
1 similar comment
|
@hashhar ping |
|
@hashhar ping, could you suggest other maintainers that could review it? |
| make release | ||
| exit 0 | ||
| fi | ||
| single_arch=( |
There was a problem hiding this comment.
Now is there some way to make sure that all images get released. Looks like now anything no in either list gets skipped silently.
Is it not reasonable to assume anything not in multi_arch list is single-arch?
Also seems like we now have moved responsibility of images to release and build for in two places (leading to this question).
There was a problem hiding this comment.
I'll try to figure out how to get a list of all available images and add some validation here to throw an error if there are any not mentioned in any of these two lists. I wouldn't make any assumptions about them being single or multi-arch.
Also see this old comment: #143 (comment)
There was a problem hiding this comment.
One idea I had was to place a marker file in each directory for the multi-arch supported ones and both ci.yml and release.yml can use that to decide what needs to be done. (Very hacky and I feel dirty for even suggesting it but I don't see better ways yet to be honest).
There was a problem hiding this comment.
Done! While testing this, I noticed we were missing the recently added centos7-oj11 and spark3-hudi, so it was a great idea, thanks!
| ) | ||
| images=("${single_arch[@]}" "${multi_arch[@]}") | ||
| make require-clean-repo require-on-master require-release-version | ||
| make prepare-release |
There was a problem hiding this comment.
" Extract prepare-release target from release " - should this come before others (or maybe even together with the change which allows releasing multi-arch images)? Also some context is useful.
There was a problem hiding this comment.
If I'd put them into a single commit, you'd ask me to extract it :-) I moved it so it's before the commit that adds multi-arch releases, but now it adds a target that's unused until the next commit.
There was a problem hiding this comment.
Can you suggest something for more context?
There was a problem hiding this comment.
adds a target that's unused until the next commit.
Sorry I has misordered commits while reviewing. It's all good here.
There was a problem hiding this comment.
For context I'd probably say:
With multi-arch releases images for all platforms must be built before they can be published - which requires decoupling prepare-release from release goal.
There was a problem hiding this comment.
Sorry I has misordered commits while reviewing. It's all good here.
But I moved it, so are you sure?
3b89a50 to
bb66ea9
Compare
Calling `docker build` is wrapped in a shell script, that recognizes when PLATFORMS is set and runs `docker build` for every requested platform. This is needed because `--load` currently doesn't work with multiple arguments in `--platform`.
With multi-arch releases images for all platforms must be built before they can be published - which requires decoupling prepare-release from release goal.
bb66ea9 to
ed20f91
Compare
|
I'll release docker-images version 70 so that we can start to test the upgrade in Trino. |
This is an alternative to #138
This PR wrap calls to
docker build,docker tag, anddocker pushwith scripts that recognize thePLATFORMSenv var. If it's set, a separate image for every architecture is used. After pushing all images, a manifest is created.