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

Publish script #25

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Publish script #25

wants to merge 6 commits into from

Conversation

joshuacurtiss
Copy link
Member

@joshuacurtiss joshuacurtiss commented Feb 27, 2025

The purpose of this PR is to introduce a publish script that simplifies the process of building and publish container images to our registry at ghcr.io/uicpharm, although it's extensible to allow other registry/org values.

This script will automatically handle the creation of a custom builder using the docker-container driver as outlined in Docker's Multi-platform build documentation. It also will handle the different syntax/logistics for building in Docker versus Podman, although in Podman it forces you to only build for your native architecture.

This PR also improves the installers so that they will install all *.sh helper scripts that are in the bin directories, for either the specific OS or the one in the shared directory. This will make it simpler to add a script to the bunch in the future, without having to edit the installers every time. Furthermore, the docker portion of the installer has been improved so it can be ran over again, which makes it easy to install the Docker-related helper scripts by just re-running the docker.sh installer.

Why??

Typically, building and publishing of images should happen in a GitHub Actions workflow when a version is tagged. However, if there is any reason why this is impossible/undesirable, this script could be used on a workstation that is capable of building and publishing the images.

For instance, the dcfs-summary project cannot currently build the linux/arm64 version of the image, because the standard linux/amd64 arch used by GHA throws errors when trying to build the linux/arm64 image in its emulation layer (https://github.com/uicpharm/dcfs-summary/issues/2). So, its workflow was adjusted to only publish linux/amd64 images. That way, at least the standard arch used by the server is built. If a linux/arm64 image is desired, a Mac user can rebuild the multi-arch image, since the Mac arch can successful build both, and then publish it to the repository.

How to test

After checking out this branch in your docker-host directory, execute the docker.sh script that is in the directory that matches your OS. Re-running docker.sh will install all scripts, including the new publish script.

View the Using the publish script docs in the readme. This will give examples of how to run it.

Whereas the typical workflow will be to allow GitHub Actions to handle the building and
publishing for container images to our registry, there may be times where it is preferable
or even required that we build the images on a local workstation and publish them.

This script will help us to accomplish local workstation building and publishing when it
is needed.
Rather than explicitly installing (via symbolic links) the shell scripts in the bin
directories, we enhance the installers to loop over all the *.sh files in those
directories and install all that are found.

This will more gracefully handle all future scripts that are added to the bin directory to
automatically be included in the installation process.
Minor tweaks to the docker installation script allow it to be ran again,
even if it has already been installed. By doing this, the user can
easily re-run the installer and thus install any new scripts.
Latest MacOS updates make `/usr/local/bin` require sudo access to write to it. So, we must
adjust our installer to use sudo.
@joshuacurtiss joshuacurtiss added the enhancement New feature or request label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants