Skip to content

Hints serverside#42

Merged
aldbr merged 28 commits into
mainfrom
transformation_hints_serverside
Nov 24, 2025
Merged

Hints serverside#42
aldbr merged 28 commits into
mainfrom
transformation_hints_serverside

Conversation

@Stellatsuu

@Stellatsuu Stellatsuu commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Closes #31

Hints are now handled by the server.

How to create/use hints

In CWL only:

cwlVersion: v1.2
# What type of CWL process we have in this document: ComandLineTool or Workflow.
class: CommandLineTool

# The inputs for this process: none.
inputs: []
# The outputs for this process: none.
outputs: []

hints:
    - dirac:ExecutionHooks:
         ...
    - dirac:Scheduling:
         ...
baseCommand: ["echo", "Hello World"]

Using an external file:

In CWL:

cwlVersion: v1.2
# What type of CWL process we have in this document: ComandLineTool or Workflow.
class: CommandLineTool

# The inputs for this process: none.
inputs: []
# The outputs for this process: none.
outputs: []

hints:
      $import: "my_hints.yaml"

baseCommand: ["echo", "Hello World"]

In my_hints.yaml:

- class: dirac:ExecutionHooks
  hook_plugin: ...
  group_size:
    ...
  configuration:
    ...
...

@Stellatsuu Stellatsuu self-assigned this Oct 16, 2025

@aldbr aldbr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Stellatsuu, I think you are on the right track!

Some production tests are broken from this (do not merge now), I can't see why, maybe the new $import in cwl worflows I'm not sure of.

I haven't checked carefully but it is likely coming from https://github.com/aldbr/dirac-cwl-proto/blob/e97b83d0d65a46042fa9b9fbb725b5bbed498665/src/dirac_cwl_proto/production/__init__.py#L194-L198

Can you try to adjust all the SubmissionModels? If you adjust them all, then may be the errors will go away.

Should we describe the execution-hooks like this in the *.yaml (with dirac: prefix)?

I think what you did is fine!

I'm not sure of the call to TransformationExecutionHooksHint.from_cwl(transformation.task), I had some struggle with Mypi because it takes it as an ExecutionHooksHint. I don't think we have to rewrite from_cwl but right now I don't see a workaround for that?
I also tried (in local) calling extract_dirac_hints and modifying it to match TransformationExecutionHooksHint class, same problem.

See my comment below about Self 🙂

Note: may be TransformationSubmissionModel and ProductionSubmissionModel will be very similar in the end, let's see if we can/should refactor them in the end.

Comment thread src/dirac_cwl_proto/execution_hooks/core.py Outdated
Comment thread src/dirac_cwl_proto/transformation/__init__.py
Comment thread src/dirac_cwl_proto/submission_models.py Outdated
Comment thread src/dirac_cwl_proto/submission_models.py Outdated
@aldbr aldbr changed the title Transformation hints serverside Hints serverside Oct 20, 2025
@Stellatsuu

Copy link
Copy Markdown
Contributor Author

Thanks @aldbr for the quick review ! I will check all that 😄

Comment thread src/dirac_cwl_proto/job/__init__.py Outdated
Comment thread src/dirac_cwl_proto/production/__init__.py Outdated
Comment thread src/dirac_cwl_proto/job/__init__.py Outdated
Comment thread src/dirac_cwl_proto/production/__init__.py Outdated
Comment thread src/dirac_cwl_proto/production/__init__.py Outdated
Comment thread src/dirac_cwl_proto/job/__init__.py Outdated
num_points: 2000 # Override default 1000 from CWL
- class: dirac:ExecutionHooksHint
configuration:
num_points: 2000 # Override default 1000 from CWL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean to override here? It doesn't override anything anywhere, should it?

Comment thread test/workflows/test_meta/test_meta.cwl Outdated
@Stellatsuu
Stellatsuu marked this pull request as ready for review November 20, 2025 15:01
@Stellatsuu
Stellatsuu requested a review from aldbr November 20, 2025 15:03

@aldbr aldbr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Stellatsuu, I just have a few comments 🙂

Comment thread src/dirac_cwl_proto/execution_hooks/core.py Outdated
Comment thread src/dirac_cwl_proto/submission_models.py
@aldbr
aldbr merged commit a560783 into main Nov 24, 2025
4 checks passed
@aldbr
aldbr deleted the transformation_hints_serverside branch January 29, 2026 16:43
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.

Interpret the hints from the server only?

3 participants