Skip to content

RANGER-5246: Add workflow to build multi-platform ranger images and push to DockerHub and GitHub Container Registry #613

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kumaab
Copy link
Contributor

@kumaab kumaab commented Jul 18, 2025

What changes were proposed in this pull request?

A new workflow to build ranger images: ranger, ranger-db, ranger-solr and ranger-zk with multi-arch support and publish them to GitHub Container Registry and optionally to DockerHub.

  • Publish to DockerHub requires the workflow to be run manually by providing branch name and OAuth token
  • OAuth Token is generated after successful authentication against ASF OAuth, more details here: https://idm.apache.org/api.html
  • Workflow checks for PMC level permissions to authorize publishing to DockerHub
  • Workflow can be conveniently used from the release branch at the end of a release to publish images.

How was this patch tested?

CI Run with successful build stage: https://github.com/kumaab/ranger/actions/runs/16375834642

@kumaab kumaab self-assigned this Jul 18, 2025
@kumaab
Copy link
Contributor Author

kumaab commented Jul 18, 2025

@adoroszlai, Could you please review as well, thanks.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @kumaab for the patch.

Comment on lines 136 to 135
response=$(curl https://oauth.apache.org/token\?code\=${{ github.event.inputs.token }})
echo "$response" | jq -e . >/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

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

  • curl will output download progress to std.out, jq will fail to parse it. Use -LSs
  • Token shown in log in plain text.

Comment on lines 57 to 58
cp ranger-*-admin.tar.gz dev-support/ranger-docker/dist
cp version dev-support/ranger-docker/dist
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not mv, is the original file used later?

runs-on: ubuntu-latest
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
IMAGE_ID: ${{ needs.build.outputs.image-id }}
Copy link
Contributor

Choose a reason for hiding this comment

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

build job should define this output to allow tag to use it, something like:

https://github.com/apache/ozone-docker-runner/blob/1aa8dee3e97d870106b61736d78030e64ebe71b6/.github/workflows/build.yaml#L41-L42

Also, image-id will contain only ranger image, the other 3 images will not be tagged by this job.

BTW, in the long run, we should avoid building these 3 additional images.

  • zookeeper image can be used directly.
  • postgres and solr images can also be used, with Ranger-specific files (and password for Postgres) provided by users at runtime (in Docker Compose service definition).

In addition to simplifying the workflow, this would also avoid the problem of hard-coded password in the DB image (which makes it unusable for "production").

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.

2 participants