VolSync Operator Product Build to build downstream VolSync via Konflux
The main branch for this repo contains the renovate config renovate.json used by renovate for all branches. Look at the release-X.Y branches for configuration related to building the related X.Y release downstream of VolSync via konflux.
This repo contains submodules in order to have all the dependencies to build the VolSync Operator.
Current submodules:
- volsync - points to https://github.com/volsync/volsync
- rclone - points to https://github.com/rclone/rclone
- syncthing - points to https://github.com/syncthing/syncthing
- diskrsync - points to https://github.com/dop251/diskrsync
- yq - points to https://github.com/mikefarah/yq - This submodule is only needed for editing the CSV yaml with custom edits for Red Hat in bundle-hack/update-bundle.sh during the bundle build
- drift-detection - points to https://github.com/arewm/drift-detection - This submodule is only needed for the bundle generation and detecting if volsync has diverged from our config.
To clone this repo and submodules it can be done in one step with:
git clone https://github.com/stolostron/volsync-operator-product-build.git --recurse-submodules
Or, after cloning the repo you can do this to pull the submodules:
cd volsync-operator-product-build
git submodule update --init --recursive
Submodules such as rclone, syncthing, diskrsync should not be updated unless the corresponding update is made in volsync itself.
When the volsync submodule is updated, the Dockerfile will need to be copied to Dockerfile.cached. The volsync build (building Dockerfile.rhtap) will fail if the Dockerfile.cached doesn't match the one in volsync. Not matching is usually an indicator something like one of the other submodules was updated.
If another submodule (rclone, syncthing, diskrsync) needs an update, make sure to update the proper GIT hashes in rhtap-buildargs.conf.
The rhtap-buildargs.conf file is also used during the bundle build and will contain the volsync image SHA to be packaged in the bundle image. Konflux nudges from the volsync component should keep this up-to-date.
To build locally and simulate/exercise what the konflux build will do, you can do the following:
Build the volsync container
podman build --build-arg-file rhtap-buildargs.conf -f Dockerfile.rhtap -t volsync-container:local-build-latest .
Build the volsync bundle
podman build --build-arg-file rhtap-buildargs.conf -f bundle.Dockerfile.rhtap -t volsync-bundle:local-build-latest .
If any dependencies are added or removed in the Dockerfiles then we will need to update rpms.in.yaml and rpms.lock.yaml
Using the rpm-lockfile-prototype tool
Steps to run it as a container (this has some manual steps as it seems we need to manually login to registry.redhat.io)
- First update the rpms.in.yaml
- Now start the container
container_dir=/work
podman run -it --entrypoint=/bin/bash -v ${PWD}:${container_dir} localhost/rpm-lockfile-prototype:latest
- Exec into the container and run the following:
skopeo login registry.redhat.io
...
rpm-lockfile-prototype --outfile=/work/rpms.lock.yaml /work/rpms.in.yaml