Skip to content
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

localhost cylc path should come from global.cylc platform if defined there #6301

Open
ColemanTom opened this issue Aug 15, 2024 · 3 comments · May be fixed by #6302
Open

localhost cylc path should come from global.cylc platform if defined there #6301

ColemanTom opened this issue Aug 15, 2024 · 3 comments · May be fixed by #6302

Comments

@ColemanTom
Copy link
Contributor

Problem

The path to cylc on localhost is assumed to have cylc in your PATH.

Proposed Solution

It would be better if it could use the path defined in the global.cylc [platform]localhost area if defined, otherwise use cylc in PATH as default. Basically, the same as is done for remote hosts.

@ColemanTom
Copy link
Contributor Author

ColemanTom commented Aug 15, 2024

Whilst I don't recommend this exact change (I think the logic which is in remote would be pulled into a function which returns the cylc path)

# NOTE: Somewhere at the top, I also had `from pathlib import Path`

diff --git a/cylc/flow/task_job_mgr.py b/cylc/flow/task_job_mgr.py
index 185966ff1..3d5fe96f8 100644
--- a/cylc/flow/task_job_mgr.py
+++ b/cylc/flow/task_job_mgr.py
@@ -530,7 +530,11 @@ class TaskJobManager:
                     cmd, platform, host
                 )
             else:
-                cmd = ['cylc'] + cmd
+                cylc_path = platform['cylc path']
+                if cylc_path:
+                    cmd = [str(Path(cylc_path) / 'cylc')] + cmd
+                else:
+                    cmd = ['cylc'] + cmd

             for itasks_batch in itasks_batches:
                 stdin_files = []

With a platform section

[platforms]
    [[localhost]]
        cylc path = /home/548/tc2375/cb

Gives [jobs-submit cmd] /home/548/tc2375/cb/cylc jobs-submit --d ...

Prior to change was [jobs-submit cmd] cylc jobs-submit --debug --path=/bin

@ColemanTom
Copy link
Contributor Author

I should say, the reason this is coming up, is despite the PATH being correct in the job script, the path known to the cylc job-submit command doesn't seem to have the PATH correct.

@ColemanTom
Copy link
Contributor Author

Perhaps it should be added, if defined in platform, to the start of PATH too.

@ScottWales ScottWales linked a pull request Aug 15, 2024 that will close this issue
8 tasks
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 a pull request may close this issue.

1 participant