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

Add option to verify patches without running daemons #362

Open
labkode opened this issue Jan 21, 2025 · 0 comments · May be fixed by #363
Open

Add option to verify patches without running daemons #362

labkode opened this issue Jan 21, 2025 · 0 comments · May be fixed by #363
Assignees

Comments

@labkode
Copy link
Member

labkode commented Jan 21, 2025

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.
labkode added a commit to labkode/rucio-containers that referenced this issue Jan 21, 2025
labkode added a commit to labkode/rucio-containers that referenced this issue Jan 21, 2025
@labkode labkode self-assigned this Jan 21, 2025
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 a pull request may close this issue.

1 participant