Skip to content

SSHManager: Add the custom_worker_flag option, but don't add it to the public API #135

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DilumAluthge
Copy link
Member

Description

I have a use case where, instead of starting each remote worker with julia --worker, I need to start the remote workers with julia -e 'my_custom_code()'.

This PR modifies SSHManager to have a custom_worker_flag option. When custom_worker_flag is specified, it will replace --worker. When custom_worker_flag is not specified (which is the default), it falls back to the current behavior.

Example usage

using Distributed: addprocs

hosts = ["host1", "host2", "host3"]

julia_code = """
    my_custom_code()
"""

addprocs(hosts; custom_worker_flag = `-e "$(julia_code)"`) 

This will start each remote worker with julia -e 'my_custom_code()'.

Public API vs private API

This PR does not add the new custom_worker_flag option to the public API. This allows us to change (or remove) it in the future.

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.29%. Comparing base (ff8689a) to head (c9f786e).

Files with missing lines Patch % Lines
src/managers.jl 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
- Coverage   79.42%   79.29%   -0.14%     
==========================================
  Files          10       10              
  Lines        1949     1951       +2     
==========================================
- Hits         1548     1547       -1     
- Misses        401      404       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JamesWrigley
Copy link
Collaborator

Could you give some more details on what the usecase is? I'm not necessarily opposed to it, it just seems like a very easy footgun.

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.

2 participants