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

Modernize Docker workflow #38

Merged
merged 14 commits into from
Nov 5, 2020
Merged

Conversation

felddy
Copy link
Member

@felddy felddy commented Oct 30, 2020

🗣 Description

This PR updates the workflows to use more recent methods:

  • It uses the suite of Docker GitHub Actions (from CrazyMax).
  • It builds Docker images for more than one platform.
  • It handles making builds for branches, and tags them correctly.
  • It detects a release by the name of the git tag.
  • Nightly builds.

💭 Motivation and Context

I've been building this workflow based on some of the best-practices of the docker actions repos.

See here: https://github.com/docker/build-push-action#complete-workflow

Basically: If you change something in the repo, an image is going to pop out. This is a good thing. It makes testing branches a piece of cake.

🧪 Testing

Tested for a few months in my personal project.
CI.

📷 Screenshots (if appropriate)

🚥 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (causes existing functionality to change)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@felddy felddy self-assigned this Oct 30, 2020
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

I think that these are great improvements, so strong work there @felddy!

That said, I think there are a few minor issues that should be cleared up before emerging. Please see my inline comments.

In addition to that, and given that this is a skeleton repo that external folks may want to study before using, I think it might make sense to add more comments in .github/workflows/build.yml. The intent is less to detail what is being done by the code and more to guide the eye and help break up the giant workflow into digestible chunks (or "functions") that each perform a particular function. That file is a little overwhelming at first glance, and it's difficult to find one's place again if one looks away at an email and comes back to it.

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@jsf9k
Copy link
Member

jsf9k commented Nov 2, 2020

WRT commits 905799f, 3e7033b, and c506a21...I think GitHub gives you the option to combine multiple suggestions into a single commit. I haven't had a chance to confirm that yet, but this would have been an excellent place to use that feature (assuming it exists).

Also, we should strive to use a better commit comment than the default offered by GitHub. "Update .github/workflows/build.yml" is not very informative.

Not criticizing, just pointing out how we can better use our tools.

@jsf9k
Copy link
Member

jsf9k commented Nov 2, 2020

🎶 Workin' on my night builds 🎶
Night moves

@felddy
Copy link
Member Author

felddy commented Nov 2, 2020

WRT commits 905799f, 3e7033b, and c506a21...I think GitHub gives you the option to combine multiple suggestions into a single commit. I haven't had a chance to confirm that yet, but this would have been an excellent place to use that feature (assuming it exists).

Also, we should strive to use a better commit comment than the default offered by GitHub. "Update .github/workflows/build.yml" is not very informative.

Not criticizing, just pointing out how we can better use our tools.

I saw the "add to batch" button after I got through a couple of the suggestions. I agree, those defaults suxors.

Also see my comment in the description that I plan on squash-merging this PR since the commits are too exploratory (for my liking) due to the need to debug the workflow github-side. I put that in there as I am open to preserving the individual commits if the team things there is value there.

@mcdonnnj
Copy link
Member

mcdonnnj commented Nov 2, 2020

WRT commits 905799f, 3e7033b, and c506a21...I think GitHub gives you the option to combine multiple suggestions into a single commit. I haven't had a chance to confirm that yet, but this would have been an excellent place to use that feature (assuming it exists).
Also, we should strive to use a better commit comment than the default offered by GitHub. "Update .github/workflows/build.yml" is not very informative.
Not criticizing, just pointing out how we can better use our tools.

I saw the "add to batch" button after I got through a couple of the suggestions. I agree, those defaults suxors.

Also see my comment in the description that I plan on squash-merging this PR since the commits are too exploratory (for my liking) due to the need to debug the workflow github-side. I put that in there as I am open to preserving the individual commits if the team things there is value there.

Maybe do a rebase, mark the fluff as fixup, and force push to keep useful commits? That way we can avoid squashing the whole thing down, but also trim the fat so to speak.

@jsf9k
Copy link
Member

jsf9k commented Nov 2, 2020

Maybe do a rebase, mark the fluff as fixup, and force push to keep useful commits? That way we can avoid squashing the whole thing down, but also trim the fat so to speak.

100% agree with @mcdonnnj here.

@felddy
Copy link
Member Author

felddy commented Nov 2, 2020

In addition to that, and given that this is a skeleton repo that external folks may want to study before using, I think it might make sense to add more comments in .github/workflows/build.yml. The intent is less to detail what is being done by the code and more to guide the eye and help break up the giant workflow into digestible chunks (or "functions") that each perform a particular function. That file is a little overwhelming at first glance, and it's difficult to find one's place again if one looks away at an email and comes back to it.

This is a good suggestion. I'll add some detailed documentation about what is going on. Mainly for future-me. Because I'm sure this will run for six months then fail, and I'll come back all Gandalf-in-Moria when it breaks.

@felddy
Copy link
Member Author

felddy commented Nov 2, 2020

Maybe do a rebase, mark the fluff as fixup, and force push to keep useful commits? That way we can avoid squashing the whole thing down, but also trim the fat so to speak.

You like it when GitHub goes down?! Cause this is how GitHub goes down. 😉
I'll attempt this! Keep an eye on: https://www.githubstatus.com/

@jsf9k
Copy link
Member

jsf9k commented Nov 2, 2020

You like it when GitHub goes down?! Cause this is how GitHub goes down.
I'll attempt this! Keep an eye on: https://www.githubstatus.com/

I do this sort of thang tous les temps. C'est une chose quotidienne pour moi. You and GitHub will be OK! 🇫🇷

@felddy felddy force-pushed the improvement/modern_docker_workflow branch from 223e3d5 to 247a201 Compare November 2, 2020 18:33
@felddy
Copy link
Member Author

felddy commented Nov 2, 2020

Interactive rebase == Great Success!!

Jesus H. Christ we're still here!
https://www.youtube.com/watch?v=ir5bTic17k4

@felddy felddy force-pushed the improvement/modern_docker_workflow branch from 247a201 to f1e097a Compare November 2, 2020 18:44
@felddy felddy requested a review from jsf9k November 2, 2020 21:38
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

This PR looks great. Thanks for resolving all the thangs.

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Super sweet improvements- can't wait to get this sauce cooking! ⚙️

I discovered a lone typo in a comment, but everything else looks grand!

.github/workflows/build.yml Outdated Show resolved Hide resolved
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

I am requesting one minor change, for clarity.

.github/workflows/build.yml Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
Add some additional comments in case anyone is confused about the nature of the solidus and its place within our tagging system.

Co-authored-by: Shane Frasier <jeremy.frasier@trio.dhs.gov>
@felddy felddy force-pushed the improvement/modern_docker_workflow branch from a0208f7 to da037f5 Compare November 5, 2020 18:10
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Thank you for elaborating upon the solidus. We must educate the masses!

@felddy felddy merged commit 9e993fb into develop Nov 5, 2020
@felddy felddy deleted the improvement/modern_docker_workflow branch November 5, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants