Skip to content

feat(cli): add --remote flag for automated remote Ray dispatch of ado CLI commands#593

Open
michael-johnston wants to merge 30 commits intomainfrom
maj_execution_contexts
Open

feat(cli): add --remote flag for automated remote Ray dispatch of ado CLI commands#593
michael-johnston wants to merge 30 commits intomainfrom
maj_execution_contexts

Conversation

@michael-johnston
Copy link
Member

@michael-johnston michael-johnston commented Feb 20, 2026

What's Added

A new global --remote <file> option for the ado CLI. When provided, any ado command is automatically dispatched to a remote Ray cluster instead of running locally. The entire workflow — copying files, building plugin wheels, generating a Ray runtime environment, setting up a port-forward, submitting the job, and tearing down — is handled by ado with no manual steps required.

Example

Running an optimisation operation (using examples/optimization_test_functions/) with the port-forward execution context.

: # From examples/optimization_test_functions/
ado --remote execution_context.yaml \
    create operation -f operation_nevergrad.yaml \
    --with space=space.yaml

Where execution_context.yaml contains:

executionType:
  type: cluster
  clusterUrl: "http://localhost:8265"
  portForward:
    namespace: discovery-dev
    serviceName: ray-disorch-head-svc
    localPort: 8265
packages:
  fromPyPI:
    - ray==2.52.1 # Required to match cluster ray
  fromSource:
    - . ./../          # ado-core 
    - custom_experiments  # in-tree custom experiments
wait: true
envVars:
  PYTHONUNBUFFERED: "x"
  OMP_NUM_THREADS: "1"
  OPENBLAS_NUM_THREADS: "1"
  RAY_AIR_NEW_PERSISTENCE_MODE: "0"
additionalFiles: [ ] #Optional list of additional files/dirs to send

@michael-johnston
Copy link
Member Author

@AlessandroPomponio Docs not complete but take a look and test when you have a moment.

@michael-johnston michael-johnston added the enhancement New feature or request label Feb 20, 2026
@michael-johnston michael-johnston linked an issue Feb 20, 2026 that may be closed by this pull request
* refactor(remote): initial attempt at simplifying code

Made with Bob

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): remove wrapper functions

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename models

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): remove unused function

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): move definitions

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename FlagDefinition to RemoteDispatchFlagDefinition

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* fix(tests): update mocks

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename remote-dispatch related models

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename files as well

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename field

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): remove duplicate argument

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): simplify arguments

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): strip -c flag immediately

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): use project context name for serialization

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* fix(tests): update assertions

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(core): use HttpUrl with constraint in ExecutionContext

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(core): rename ExecutionContext to RemoteExecutionContext

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* docs(agents): add instructions

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): use annotated defaults

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* docs(cli): update docstring for ParsedRemoteSubmissionFlags

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename variables

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename flag_name to name

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename variable

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename variables

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): rename variables

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* refactor(cli): remove filter_and_rewrite

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

* build(deps): add uv as a dependency

It's now required for remote execution

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

---------

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
@michael-johnston michael-johnston changed the title feat(cli): add --execution-context for automated remote Ray dispatch feat(cli): add --remote flag for automated remote Ray dispatch of all ado CLI commands Feb 24, 2026
@michael-johnston michael-johnston changed the title feat(cli): add --remote flag for automated remote Ray dispatch of all ado CLI commands feat(cli): add --remote flag for automated remote Ray dispatch of ado CLI commands Feb 24, 2026
Copy link
Member

@AlessandroPomponio AlessandroPomponio left a comment

Choose a reason for hiding this comment

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

I have left a couple of comments and opened #608 for converting docstrings to all use the Google format

michael-johnston and others added 10 commits February 25, 2026 09:27
Also avoid direct indexing of function_operation_descriptions just in case
Original code waited 30 seconds for port-forward to become ready.
If port-forward failed after 1s it would still wait 30s

New code polls directly for errors allowing faster failure.
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
The additionalFiles field can contain absolute or relative paths to files or directories. These will be symlinked into the workding dir package sent to the remote ray cluster.
plus related link updated
@michael-johnston michael-johnston marked this pull request as ready for review February 25, 2026 13:41
@michael-johnston
Copy link
Member Author

@christian-pinto @VassilisVassiliadis some modifications to the actuator docs so please check

@christian-pinto
Copy link
Member

@christian-pinto @VassilisVassiliadis some modifications to the actuator docs so please check

The docs look fine to me

plus related link updated
Copy link
Member

@VassilisVassiliadis VassilisVassiliadis left a comment

Choose a reason for hiding this comment

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

There're a couple of broken %include directives, a broken URL, and some potentially misaligned lines in sft-trainer.md.

We'll have to run mkserve docs locally to fix those problems.

… after join

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: cli support for running remote operations

4 participants