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 the release Docker image on Github #3673

Open
bschmalhofer opened this issue Aug 2, 2024 · 11 comments
Open

Build the release Docker image on Github #3673

bschmalhofer opened this issue Aug 2, 2024 · 11 comments
Labels
docker Docker related issues Github Actions Related to Github Actions
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Aug 2, 2024

Building of the devel Docker images seems to work. The next step is to also build the release images. This could be done in a separate workflow. Code duplication can maybe avoided by using reusable workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows .
Originally posted by @bschmalhofer in #3628 (comment)

@bschmalhofer bschmalhofer added docker Docker related issues Github Actions Related to Github Actions labels Aug 7, 2024
bschmalhofer added a commit that referenced this issue Aug 9, 2024
just for disambiguation as there will be new worklflow for release images
called docker_image_builder_rel.yml
bschmalhofer added a commit that referenced this issue Aug 9, 2024
bschmalhofer added a commit that referenced this issue Aug 9, 2024
@bschmalhofer
Copy link
Contributor Author

Triggering docker_image_builder_rel.yml when a tag is pushed is working. The next step is to set up an reusable workflow, see https://docs.github.com/en/actions/using-workflows/reusing-workflows .

@bschmalhofer
Copy link
Contributor Author

Turns out that reusable workflows are not a good solution for simply eliminating code duplication in workflows. Local composite actions are a better approach, https://docs.github.com/en/actions/creating-actions/creating-a-composite-action .

bschmalhofer added a commit that referenced this issue Aug 13, 2024
not sure whether this is passed to the composite action
bschmalhofer added a commit that referenced this issue Aug 13, 2024
for building devel and release images.
No need to pass input to the composite action as the contexts
env, matrix, and github are available there.

Log into Docker Hub outside the composite action.
bschmalhofer added a commit that referenced this issue Aug 13, 2024
No need to login to DockerHub twice
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Aug 15, 2024

This has been implemented. For activating the workflow the following steps must be taken:

  • Turn of the automated release builds on Docker Hub
  • Adapt the glob pattern in the on hash from 'test-' to 'rel-'
  • Add the workflow and the action to the other branches

bschmalhofer added a commit that referenced this issue Aug 15, 2024
Building of the release Docker images is inactive, because the glob pattern
still uses the prefix 'test-' instead of 'rel-'
bschmalhofer added a commit that referenced this issue Aug 15, 2024
Nothing is keeping us from including rel-11_1 in the on hash
bschmalhofer added a commit that referenced this issue Sep 20, 2024
and push the built Docker images to Docker Hub.
The activation was done be changing the watched tags to the release tags.
bschmalhofer added a commit that referenced this issue Sep 20, 2024
and push the built Docker images to Docker Hub.
The activation was done be changing the watched tags to the release tags.
@bschmalhofer
Copy link
Contributor Author

The changes have been made. The PR has been merged. Let's keep this issue open until we successfully made the next patch level release.

@bschmalhofer bschmalhofer added this to the OTOBO 10.0.22 milestone Sep 26, 2024
bschmalhofer added a commit that referenced this issue Sep 26, 2024
and push the built Docker images to Docker Hub.
The activation was done be changing the watched tags to the release tags.
@bschmalhofer
Copy link
Contributor Author

Applied the changes also to rel-10_0 and rel-10_1. This is needed because the tag updates use the actions for the current branch, not the default branch.

@svenoe
Copy link
Contributor

svenoe commented Oct 2, 2024

This should work now, so I'll close the issue. If anything comes up again, we'll reopen or add a more specific one.

@svenoe svenoe closed this as completed Oct 2, 2024
@svenoe
Copy link
Contributor

svenoe commented Oct 2, 2024

This did not yet work for OTOBO 10.0. I will push a small change and retry with 11.0, which, if it works, might have to be backported.

@svenoe
Copy link
Contributor

svenoe commented Oct 28, 2024

The latest images in the dockerhub building process were built via hooks/post_push. This unfortunately only seems to work for the builds being automated on dockerhub: https://docs.docker.com/docker-hub/builds/advanced/#custom-build-phase-hooks

For that reason I will change .github/workflows/docker_image_builder_rel.yml and the action to build the latest-tag depening on the branch.

@svenoe
Copy link
Contributor

svenoe commented Oct 28, 2024

The latest images in the dockerhub building process were built via hooks/post_push. This unfortunately only seems to work for the builds being automated on dockerhub: https://docs.docker.com/docker-hub/builds/advanced/#custom-build-phase-hooks

For that reason I will change .github/workflows/docker_image_builder_rel.yml and the action to build the latest-tag depening on the branch.

"if" construct works, push does not work, some more changes necessary.

svenoe pushed a commit that referenced this issue Oct 29, 2024
@svenoe
Copy link
Contributor

svenoe commented Oct 29, 2024

In the above commit the latest is now provided in the "tags". According to the documentation this can also be given a list of arguments, so it would definitely be nicer to push both tags in one statement if matrix.latest and else omit the latest tag, but that can be tested at a later point in time.

@svenoe
Copy link
Contributor

svenoe commented Oct 29, 2024

We decided to add an additional autobuild tag, which will automatically be built via cron upon base image change. This build can then be used to run tests and manually update the normal tags via workflow_dispatch.

This handling might change in future, the latest-x_xx-autobuild should not be used on productive systems.

svenoe pushed a commit that referenced this issue Oct 31, 2024
…e which ca be manually executed for the latest couple of patches.
svenoe pushed a commit that referenced this issue Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Docker related issues Github Actions Related to Github Actions
Projects
None yet
Development

No branches or pull requests

2 participants