Skip to content

fix(ci): build+push image in release flow #3838

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

Merged
merged 3 commits into from
Jul 29, 2021
Merged

fix(ci): build+push image in release flow #3838

merged 3 commits into from
Jul 29, 2021

Conversation

oxy
Copy link

@oxy oxy commented Jul 22, 2021

Previously, we would build docker images on each CI run, export them, then re-import them and push them on release. However, there appears to be a bug in buildx's export flow, and images can't be re-imported into Docker.

To fix this, I've moved to building and publishing with buildx in the release workflow in one step, and removed the image build step from the main CI flow. I also moved the docker publish process to its own workflow instead of release.yml so that it can be re-run independently of the npm+homebrew step.

Partially adresses #3814, though a new release needs to be made for the workflow to kick in.

@oxy oxy requested a review from a team as a code owner July 22, 2021 17:10
@codecov
Copy link

codecov bot commented Jul 22, 2021

Codecov Report

Merging #3838 (3fb4470) into main (7a5c457) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3838   +/-   ##
=======================================
  Coverage   63.40%   63.40%           
=======================================
  Files          36       36           
  Lines        1872     1872           
  Branches      379      379           
=======================================
  Hits         1187     1187           
  Misses        582      582           
  Partials      103      103           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a5c457...3fb4470. Read the comment docs.

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

As someone who is less familiar with Docker/buildx, I don't think I have enough exp to approve this.

However from a general standpoint,

  • great PR description
  • this approach feels clean and maintainable
  • i appreciate you taking extra precautions and separating into it's own workflow

@@ -1,12 +1,37 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

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

Should we rename this file? Maybe build-and-push-docker-image.sh?

Copy link
Author

Choose a reason for hiding this comment

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

I did consider this but felt it was a bit of a mouthful - though am not opposed to it!

Copy link
Member

Choose a reason for hiding this comment

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

It does seem a bit long haha but I don't want to mislead anyone who might try to run this!

Copy link
Member

Choose a reason for hiding this comment

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

Could maybe shorten to docker-buildx-push.sh or something.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds great!

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi

docker buildx bake -f ci/release-image/docker-bake.hcl --push
Copy link
Member

Choose a reason for hiding this comment

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

Legend! So much better.

@code-asher
Copy link
Member

Maybe we should rename the publish workflow as well since it's not the full publish process anymore.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 26, 2021

@oxy just checking in on this. Anything we can do to help you move this forward?

@oxy
Copy link
Author

oxy commented Jul 27, 2021

@jsjoeio @code-asher ready for a second look and merge!

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

LGTM! Great work on keeping it clean and easy to follow 👏

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

🎉

@oxy oxy merged commit 93c89ba into main Jul 29, 2021
@oxy oxy deleted the oxy/docker-buildx branch July 29, 2021 18:01
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.

3 participants