-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add GitHub workflow file to build/tag/push custom docker images #6525
Conversation
d7ba381
to
db33099
Compare
I'm not sure where the documentation for this workflow should live (the wiki for each repository, the hubs-docs repo, somewhere else?), so for now I'm just going to post it here in this comment: Building Custom Docker ImagesIn each repository there is a GitHub Workflow/Action named custom-docker-build-push for building custom docker images and pushing them to a docker/container registry of your choice. Simply run this Action on any branch, with the appropriate details filled in (either through the predefined defaults or by the overrides), and you will end up with a docker image of that branch that can be used in any Community Edition instance. The Action allows you almost complete control over where your docker images are sent and how they are tagged. The details required for this to work can either be provided at runtime or by preset defaults that you set up. Options/SetupThe following properties can be configured/overridden. Any values that are manually specified for that run will always be used. Any fields not passed values will fall back on predefined variables/secrets (if they have been created). Options:
|
This allows docker images with a custom tag/name to be created on demand for any branch containing this workflow and pushed to the specified docker repository. Two versions of the docker image will always be pushed, one ending with -latest and one ending with the workflow run number, e.g. my-custom-image-name-latest and my-custom-image-name-42. The details required for the workflow to run can either be provided by predefined repository secrets/variables or specified manually when invoking the workflow. This should help make it easier to customize Community Edition instances, test pull requests/development branches, and to provide docker images of long running branches (large alpha/beta features) for community testing.
db33099
to
da8af27
Compare
@mikemorran I've credited Brandon Patterson as mentioned here: https://github.com/Hubs-Foundation/hubs-blender-files/blob/main/creator-labs-files/CL-archive/ghost-to-md-output/2023-10-16-community-edition-case-study-quick-start-on-gcp-w-aws-services.md, but should I be crediting you as well? Also, I see there are two steps for the |
Adds a new page in the developer section for GitHub workflows with documentation for the Custom Docker Build Push GitHub workflow. This provides docs for the GitHub workflow introduced here: Hubs-Foundation/hubs#6525
@DougReeder @hrithikwins I've added a docs PR for this to the hubs-docs repository: Hubs-Foundation/hubs-docs#198 While it would be nice to get the answers to the questions I asked @mikemorran I don't think they affect the functionality so we can update stuff later, if needed. |
@Exairnous I originally wrote all of the tutorial steps and @zfox23 wrote the introductory stuff. @pattersonbl2 was an advisor and great help on all of the information, but I am not aware that he wrote anything in the document. I'm trying to see what you are referencing with "two steps for |
@mikemorran In your article/tutorial you wrote: "When you have made your customizations and are ready to deploy, go to
Here and here seem to be duplicates/perform the same job. I have kept both those |
LGTM |
Gotcha, Brandon was the one who produced the code, for ce-build.yml, but not the article itself IIRC. I'm actually not sure why the setup-buildx-action step is included twice |
Remove duplicate steps. Reorganize the steps into discrete sections. Both the checkout and docker buildx setup steps were present in the workflow file twice and while this didn't cause any problems running the workflow file it was confusing, unneeded (the buildx step is like installing a dependency and can happen anytime before the docker build/push step, as for the checkout step, everything was configured to use the code from the second checkout step thus making the first unnecessary), and probably slowed down its execution slightly. Removing the duplicate steps and reorganizing the rest makes everything simpler and clearer.
Thanks @mikemorran. I think everything's good then. I did some testing and it seems that the setup-buildx-action step basically just installs dependencies and can be done at any point before the docker/build-push-action step. I also noticed that there was a duplicate checkout step, but it seems that everything is set up to use the second checkout step, so the first checkout step is not needed. I have removed the duplicate steps and reorganized whats left into discrete sections, and tested the modified workflow file on Docker Hub, Scaleway, and GitHub and everything still works. To everyone: |
This allows docker images with a custom tag/name to be created on demand for any branch containing this workflow and pushed to the specified docker repository. Two versions of the docker image will always be pushed, one ending with -latest and one ending with the workflow run number, e.g. my-custom-image-name-latest and my-custom-image-name-42.
This should help make it easier to customize Community Edition instances, test pull requests/development branches, and to provide docker images of long running branches (large alpha/beta features) for community testing.
Once this is finalized, it will be added to the other repositories that can benefit from it as well.