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

Suggestion to implement GitHub Actions #19

Closed
wants to merge 1 commit into from

Conversation

andyundso
Copy link
Member

The last feedback on #14 was that multi-arch images would be desired. This PR contains a GitHub Actions configuration that can build a multi-arch version of the pgautoupgrade container. In a nutshell:

  • To optimise resources, each version of Postgres from which an upgrade should be possible gets its own build job. Generally, the ARM build is done with QEMU, so compile-times of 25 minutes are usual. So the previous sequential approach did not scale. Subsequent runs of this build step should be cached.
  • Then each final version (v13 to v16) gets build, tested and pushed.

Example workflow run and result on my Docker Hub page.

At this point, I would consider this a WIP, as the following points need to be clarified.

  1. I renamed the image name to simpliandy/pgautoupgrade to test things, this needs to be reverted.
  2. I would recommend to always push an image when pushing / merging to main. The -dev could be pushed when manually starting a run of the workflow from any branch not named main.
  3. To optimise image size, separate stages for each final version (v13 to v16) could be introduced.
  4. Credentials to log into Docker Hub need to be added.
  5. I did not adapt anything in the Makefile yet. However, I assume I broke it since I adapted the test.sh file.

if [[ $(echo "$version < $PGTARGET" | bc) -eq 1 ]]; then
test_run "$version" "$PGTARGET"
fi
done
Copy link
Member

@justinclift justinclift Jan 5, 2024

Choose a reason for hiding this comment

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

Yeah, that's a better approach rather than my copy-and-edit one so far. 😄

@justinclift
Copy link
Member

justinclift commented Jan 5, 2024

Cool! Looks like you're putting solid time and effort into getting that working @andyundso.

If I send you a team invite so you can do stuff in the repo directly, would that be useful?

I'm thinking it'll let you make changes to get things working without me needing to be a gatekeeper (I'm kind of knocking myself out on another project atm 😉).


Actually, I just sent an invite anyway so feel free to accept it if it's of interest. 😄

@justinclift
Copy link
Member

@ateuber @dtcooper @wuast94 Anyone have time to review this? 😄

@wuast94
Copy link
Member

wuast94 commented Jan 5, 2024

had a look and thanks for this awesome work 😊 looks fine to me so far

overall it could be an option to use github instead of dockerhub

if using Dockerhub @justinclift you need to enter your Dockerhub credentials in this repo.

@justinclift
Copy link
Member

@wuast94 Thanks. I've just added a DOCKERHUB_USERNAME variable and DOCKERHUB_PASSWORD secret to the organisation settings, so things can be done with the Docker Hub repo. 😄

@andyundso
Copy link
Member Author

thanks for the feedback, I also accepted the invite for the organization.

I'll create a new branch directly in the repository to address the remaining points.

uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
Copy link

@dtcooper dtcooper Jan 5, 2024

Choose a reason for hiding this comment

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

It appears the Postgres base container supports all of the following architectures: linux/amd64, linux/arm32v5, linux/arm32v6, linux/arm32v7, linux/arm64v8, linux/i386, linux/mips64le, linux/ppc64le, and linux/s390x... so why not go buck wild and support them all? :)

Copy link
Member

Choose a reason for hiding this comment

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

I guess we might as well give it a shot and see how it goes.

@andyundso You up for that? (maybe later, after you're happy with the other bits? 😄)

@dtcooper
Copy link

dtcooper commented Jan 5, 2024

Looks fantastic to me! Thanks for doing this. :)

@andyundso
Copy link
Member Author

replaced by #26.

@andyundso andyundso closed this Apr 23, 2024
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.

4 participants