Skip to content

Add option to verify patches without running daemons #362

@labkode

Description

@labkode

Context:

Downstream packagers, like for example in CMS (but probably applies to anyone), we build our own docker images, based on upstream, for example, this is the rucio-daemons cms Docker:
https://github.com/dmwm/CMSRucio/tree/master/docker/rucio-daemons/Dockerfile.

The upstream daemon container runs the start-daemons.shscript as ENTRYPOINT.
This command apply patches AND start the daemon.

When using CI (or manually) building new images, one cannot verify the validity of the patches without running the daemon.

For example, while preparing new CMS releases, the build is successful but it fails at runtime because the patches conflict with each other.
See dmwm/CMSRucio#872.

I've added a new envar RUCIO_DAEMON_ONLY_CHECK_PATCHES, that can be used to verify the patches when building the image without impacting the existing runtime patching.

Downstream packagers, can use this environment variable to make sure their builds (incorporating patches) are valid (no conflicts) without having to run the daemons.

Example for CI, adding an extra step here to verify the patches before pushing the Docker image into repositories:
https://github.com/dmwm/CMSRucio/blob/master/.github/workflows/rucio-release-images.yml#L39

The example below shows the issue:

$ git clone https://github.com/dmwm/CMSRucio
$ cd CMSRucio
$ docker build --build-arg RUCIO_VERSION=36.0.0 --build-arg CMSRUCIO_GITTAG=release-36.0.0.cms3  --file docker/rucio-daemons/Dockerfile . --tag cms-rucio
$ docker run cms-rucio
=================== installing davix with openssl 3.1 ============================
rucio.cfg not found. will generate one.
INFO:root:Merged 74 configuration values from /tmp/rucio.config.default.cfg
INFO:root:Merged 0 configuration values from ENV
INFO:root:Writing /opt/rucio/etc/rucio.cfg
Patches found. Trying to apply them
Applying patch /patch/1.patch
patching file transfertool/fts3.py
Hunk #1 succeeded at 686 (offset 1 line).
Patch /patch/1.patch/lib applied.
Applying patch /patch/7170.patch
patching file core/replica.py
Hunk #1 succeeded at 3249 (offset 228 lines).
Patch /patch/7170.patch/lib applied.
Applying patch /patch/token.patch
patching file core/oidc.py
Hunk #1 succeeded at 152 (offset 1 line).
patching file core/rse.py
Hunk #1 FAILED at 13.
Hunk #2 succeeded at 52 (offset 2 lines).
Hunk #3 succeeded at 1876 (offset 32 lines).
Hunk #4 FAILED at 1858.
Hunk #5 FAILED at 1873.
3 out of 5 hunks FAILED -- saving rejects to file core/rse.py.rej
patching file daemons/reaper/reaper.py
Hunk #1 succeeded at 46 (offset 2 lines).
Hunk #2 succeeded at 619 (offset 2 lines).
patching file transfertool/fts3.py
Hunk #1 succeeded at 38 (offset 1 line).
Hunk #2 succeeded at 1028 (offset 1 line).
Patch /patch/token.patch/lib could not be applied successfully (exit code 1). Exiting setup.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions