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

build: Parallelize the CI image builds (continued) #26698

Merged
merged 19 commits into from
Jan 23, 2024

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jan 19, 2024

new approach

originally started from #25564, but got tangled in intricate changes around release tag management that conflicted with the approach used originally, so I started over by

  1. refactoring scripts/docker_build_push.sh, that originally generated a bunch of docker build commands to be executed sequentially, here I move to this bash script running a single command given the parameters, so it can be reused to run multiple build commands in parallel while orchestrating in GitHub actions. I tried to DRY what was in there cautiously
  2. changed GitHub actions to generate a matrix of commands for each "target" (dev, lean, lean39, lean310, ...) and "platform" (linux/amd64, linux/arm64), similar to build: Parallelize the CI image builds #25564

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f8f5c54) 69.48% compared to head (49a6f9b) 69.49%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #26698   +/-   ##
=======================================
  Coverage   69.48%   69.49%           
=======================================
  Files        1894     1894           
  Lines       74151    74151           
  Branches     8243     8243           
=======================================
+ Hits        51527    51528    +1     
+ Misses      20555    20554    -1     
  Partials     2069     2069           
Flag Coverage Δ
hive 53.80% <ø> (ø)
javascript 56.86% <ø> (ø)
mysql 77.98% <ø> (+<0.01%) ⬆️
postgres 78.08% <ø> (ø)
presto 53.75% <ø> (ø)
python 83.02% <ø> (+<0.01%) ⬆️
sqlite 77.66% <ø> (ø)
unit 56.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for recovering this!
just a comment

if: needs.config.outputs.has-secrets
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is secrets.DOCKERHUB_USER


on:
release:
types: [ published ]
push:
branches:
- 'master'
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment: pull_request trigger will use the PR SHA and run any changes made on any PR. PRs from forks don't contain secrets

type=sha,prefix=,format=long
type=ref,event=pr
type=raw,value=master,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
Copy link
Member

@eschutho eschutho Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mistercrunch I updated the docker build at the same time that @sebastianliebscher was writing his initial PR so he didn't have a chance to capture the changes from this PR, but @sfirke and I had updated the docker image latest tag to point to the latest official release image only and not the latest production master image so that subsequent docker deployments would run from the latest official release instead of master. There's a script that you can use from the PR to get the value for latest, or feel free to update the way that runs, too.

@mistercrunch
Copy link
Member Author

Ok, starting over and try a different approach

@mistercrunch
Copy link
Member Author

Request for comments here, given this docker build matrix:

    strategy:
      matrix:
        target: ["dev", "lean", "lean310", "lean39", "websocket", "dockerize"]
        platform: ["linux/amd64", "linux/arm64"]
      fail-fast: false

Do we need every combination for each PR and each SHA in master? Seems a bit crazy. I get that people are on Apple hardware and that's why we need arm as a base platform, but 2 versions of python too? @craig-rueda @rusackas @dpgaspar

Dockerfile Outdated Show resolved Hide resolved
@eschutho
Copy link
Member

Request for comments here, given this docker build matrix:

    strategy:
      matrix:
        target: ["dev", "lean", "lean310", "lean39", "websocket", "dockerize"]
        platform: ["linux/amd64", "linux/arm64"]
      fail-fast: false

Do we need every combination for each PR and each SHA in master? Seems a bit crazy. I get that people are on Apple hardware and that's why we need arm as a base platform, but 2 versions of python too? @craig-rueda @rusackas @dpgaspar

We can probably remove lean39. I added that version as a request from someone in the community who later found a workaround, and it's probably not needed. We can maybe check with @rusackas on data around who is using it, but I don't think we really need to have docker images based on multiple versions of python.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with or without the lean39 image. 👍

@dpgaspar
Copy link
Member

dpgaspar commented Jan 23, 2024

Request for comments here, given this docker build matrix:

    strategy:
      matrix:
        target: ["dev", "lean", "lean310", "lean39", "websocket", "dockerize"]
        platform: ["linux/amd64", "linux/arm64"]
      fail-fast: false

Do we need every combination for each PR and each SHA in master? Seems a bit crazy. I get that people are on Apple hardware and that's why we need arm as a base platform, but 2 versions of python too? @craig-rueda @rusackas @dpgaspar

We can probably remove lean39. I added that version as a request from someone in the community who later found a workaround, and it's probably not needed. We can maybe check with @rusackas on data around who is using it, but I don't think we really need to have docker images based on multiple versions of python.

I may be missing some requirements, but totally agree, I actually don't see the point on building every flavour on every PR SHA, also on a PR from a fork, images are just built and not pushed so we are just testing them. My take would be to just leave lean, linux/amd64 and websocket, linux/amd64 on every PR SHA, should be enough for testing purposes then build push all of them when merging to master

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mistercrunch mistercrunch merged commit 363a8e6 into master Jan 23, 2024
63 checks passed
@mistercrunch mistercrunch deleted the parallelize_image_builds_2 branch January 23, 2024 21:44
eschutho pushed a commit to preset-io/superset that referenced this pull request Jan 31, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants