-
Notifications
You must be signed in to change notification settings - Fork 94
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
Forward arbitrary environment variables over SSH #5709
Changes from 5 commits
4720326
833f89c
2536745
9707f0a
8ff3082
8053ead
ac071c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Forward arbitrary environment variables over SSH connections |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -35,6 +35,7 @@ | |||||||||
from cylc.flow.option_parsers import verbosity_to_opts | ||||||||||
from cylc.flow.platforms import get_platform, get_host_from_platform | ||||||||||
from cylc.flow.util import format_cmd | ||||||||||
from cylc.flow.cfgspec.glbl_cfg import glbl_cfg | ||||||||||
|
||||||||||
|
||||||||||
def get_proc_ancestors(): | ||||||||||
|
@@ -298,7 +299,10 @@ def construct_ssh_cmd( | |||||||||
'CYLC_CONF_PATH', | ||||||||||
'CYLC_COVERAGE', | ||||||||||
'CLIENT_COMMS_METH', | ||||||||||
'CYLC_ENV_NAME' | ||||||||||
'CYLC_ENV_NAME', | ||||||||||
*(glbl_cfg().get(['scheduler']) | ||||||||||
['run hosts'] | ||||||||||
['ssh forward environment variables']), | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This configuration will apply to all SSH commands made by Cylc, not just the one made by For context, here are some examples of SSH use in Cylc:
Suggest moving the configuration into the [platforms]
[[myplatform]]
ssh forward environment variables = FOO, BAR, PROJECT It can then be used here like so:
Suggested change
Ping @hjoliver from his earlier comment which lead in this direction. In order to configure this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to have different platforms with different forwarded variables? Any variable used by a specific platform will also need to be sent to the scheduler for it to work properly, I can see things becoming confusing if they are out of sync. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have any use cases in mind for per-platform configuration. It could potentially make sense, e.g. for your use case if the project codes differ from one platform to another. There might potentially be other use cases for this sort of functionality e.g. configuring things at the Cylc level which you might otherwise have to configure in shell profile files. The options for implementation are either a per-platform configuration, or a global configuration (as implemented). IMO it would make more sense to colocate this with the other SSH/rsync configurations, but a global config is ok too. I think putting the global configuration in the Note we don't currently have platform inheritance which makes the per-platform configuration a little clunkier to configure than it strictly needs to be. Inheritance was planned as a more convenient way of sharing configuration between multiple platforms, however, we haven't got around to it yet. |
||||||||||
]: | ||||||||||
if envvar in os.environ: | ||||||||||
command.append( | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉