Skip to content

fix: ensure input sandboxes assigned to transformations to avoid premature cleaning#8621

Open
ryuwd wants to merge 8 commits into
DIRACGrid:integrationfrom
ryuwd:roneil-trf-sandbox-assignment
Open

fix: ensure input sandboxes assigned to transformations to avoid premature cleaning#8621
ryuwd wants to merge 8 commits into
DIRACGrid:integrationfrom
ryuwd:roneil-trf-sandbox-assignment

Conversation

@ryuwd

@ryuwd ryuwd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This PR introduces the concept of assigning sandboxes to transformations such that the sandboxes remain for the lifetime of the associated transformations. Transformations can make use of sandboxes to e.g. make use of software or configurations that e.g. can not be publicly distributed.

The input sandbox parameter already exists on Transformations, so this PR is not bringing sandboxes to Transformations. It is fixing the issue wherein sandboxes would be cleaned up in the usual timeframe if that were the case.

BEGINRELEASENOTES

*TransformationSystem
FIX: ensure input sandboxes assigned to transformations

ENDRELEASENOTES

@ryuwd ryuwd changed the title Roneil trf sandbox assignment Support assigning input sandboxes to transformations Jun 16, 2026
@ryuwd ryuwd changed the title Support assigning input sandboxes to transformations feat: support assigning input sandboxes to transformations Jun 16, 2026
@ryuwd ryuwd force-pushed the roneil-trf-sandbox-assignment branch from fee8fed to 7018c3d Compare June 16, 2026 15:23
@ryuwd ryuwd marked this pull request as ready for review June 17, 2026 10:15
@ryuwd ryuwd requested a review from fstagni as a code owner June 17, 2026 10:15
Comment thread src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py Outdated
Comment thread src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py Outdated
Comment thread src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py Outdated
Comment thread src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py Outdated
@aldbr

aldbr commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

ddev: no associated issue, please at least bring a PR description explaining the use case, and also some documentation on how to use it.

@ryuwd ryuwd changed the title feat: support assigning input sandboxes to transformations fix: ensure input sandboxes assigned to transformations to avoid premature cleaning Jun 24, 2026
@ryuwd

ryuwd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@aldbr the PR description is updated

@ryuwd ryuwd requested a review from andresailer as a code owner June 24, 2026 15:51
@ryuwd ryuwd force-pushed the roneil-trf-sandbox-assignment branch from e8de297 to bbb883b Compare June 24, 2026 16:08
ryuwd added 7 commits June 24, 2026 22:31
…n/unpin

A created-but-unpinned transformation is unsafe: its input sandbox gets cleaned
on the usual timescale and every (1000s-10000s of) job submitted afterwards
fails to find it. So when a transformation body references sandboxes that cannot
be pinned, delete the transformation and return S_ERROR — a missing
SandboxMetadataDB or a failed assignment is fatal for sandbox-bearing
transformations.

Symmetrically, if unassigning a transformation's sandboxes at clean/archive
fails, the cleaning fails and is retried rather than proceeding: leaving the
assignment behind would pin the sandboxes to a gone transformation and leak
them. unassignEntities is idempotent, so the retry is safe.
…odules

Rename Test_*_sandbox.py to Test_TransformationCleaningAgent.py /
Test_TransformationManagerHandler.py and drive the methods with a stand-in self
(no AgentModule/handler construction). Assert the contract: pinning returns
S_OK/S_ERROR, a sandbox-bearing transformation with no DB or a failed assign is
an error, addTransformation rolls back on a pin failure, and a failed
unassignment is logged and fails the cleaning so it is retried.
Explain that a transformation references already-uploaded sandboxes via the
SB: PFNs in its body's InputSandbox parameter, how to set it at creation, and
that the Transformation System pins them to Transformation:<id> for the sandbox
lifetime (rolling back creation if pinning fails, failing/retrying cleaning if
unassignment fails).
@ryuwd ryuwd force-pushed the roneil-trf-sandbox-assignment branch from bbb883b to c6d3b08 Compare June 24, 2026 20:31
Comment thread src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py Outdated
Comment thread src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py Outdated
Co-authored-by: Ryunosuke O'Neil <ryunoneil@protonmail.com>
@aldbr aldbr requested a review from chrisburr June 26, 2026 07:19
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 this pull request may close these issues.

4 participants