-
Notifications
You must be signed in to change notification settings - Fork 93
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
Cylc registration fix. #2759
Cylc registration fix. #2759
Conversation
Travis CI is maddening at the moment, but I see one genuine test fail due to relying on the old reg behaviour... |
$ ls
suite.rc
$ cylc reg $PWD
ERROR: no suite.rc found in /var/tmp/tmp.tHegPaMTo9 |
@oliver-sanders - technically that's user error. |
I'll abort with an error if there is only one argument and it is either an absolute path or a valid relative path from cwd that is not also an existing registered suite name. Does that sounds reasonable? |
That sounds a bit complicated, could we just reject any From the help page I would have expected $ cylc reg $PWD
ERROR: no suite.rc found in /var/tmp/tmp.0Rbo39DoUR
$ cylc reg $PWD .
REGISTER /var/tmp/tmp.0Rbo39DoUR: /var/tmp/tmp.0Rbo39DoUR The leading slash messes things up: # register suite in ~/cylc/run/var/tmp/tmp.0Rbo39DoUR
cylc reg var/tmp/tmp.0Rbo39DoUR /var/tmp/tmp.0Rbo39DoUR
# register suite in /var/tmp/tmp.0Rbo39DoUR
cylc reg /var/tmp/tmp.0Rbo39DoUR /var/tmp/tmp.0Rbo39DoUR Do we currently make use of this behaviour? |
Que? The help page (on this branch) only says you can omit PATH (2nd arg), not NAME, so neither of those examples should be allowed. We definitely shouldn't be able to use a leading / in a NAME. The complication is just that a relative path can't be distinguished from a name, which makes it difficult to know if the user got the args reversed, or if he/she omitted one, was it the right one... |
(Sorry, just re-read above, I guess you intended |
Indeed. We have to assume that whatever the user provides as the first argument is a
It's interesting that this seems to work fine. It could be a good way to run the test battery? |
OK, let's make it that a NAME can be the same as the relative source path, because that actually seems like a sensible thing to do, but it can't be the same as the absolute source path, because the name gets used as a relative path under ~/cylc-run. |
It might be nice to be able to |
The cleanest way I can think to do that would be:
With the following being equivalent:
This way we don't have to do any path checking, just so long as |
c4a2c38
to
6e8d105
Compare
Have not address the "no funny chars", due to this comment: #2281 (comment) |
884ae69
to
be7a703
Compare
@oliver-sanders - implemented as you suggested (which turned out to be mildly fiendish due to subtly different command line semantics for |
Updated issue description. |
Sorry it's taken a while to come back to this. All looks good and tests as expected, I'm pretty happy with this new functionality. My only comment is that with the new $ ps -fu user | grep cylc
user 1234 1 2 12:34 ? 00:00:00 python2 /path/to/cylc/cylc-run foo # cylc run foo
user 1234 1 2 12:34 ? 00:00:00 python2 /path/to/cylc/cylc-run # cylc run This will mess up our suite monitoring unless we can come up with a better way of doing things. I guess we could |
@oliver-sanders - that is unfortunate (what do you mean by "our suite monitoring" exactly?). Do we need to disable auto-registration for that reason? |
a06d765
to
643cedd
Compare
I suppose your |
I think it should only regenerate the SSL certificate if the current host name differs. However the behaviour is also dependent on the version of the SSL library. Older version of the library does not have the functionality to extract the information from the existing certificate. |
(So maybe it ends up generating a new certificate every run because it is not able to do the host match?) |
(Sorry for making things complicated!) |
(No worries, I think I know the way forward ... and will do it late tonight if I get home in time...). |
Last fix separates run directory and auth files creation, and renews the ssl.cert on the suite host at suite startup. So this preserves current behaviour (with respect to ssl.cert) on master. Test should pass now. |
4ea5f92
to
69db5d7
Compare
All good in my environment. |
@oliver-sanders please do a final sanity check. |
@oliver-sanders - if you are able to do the requested sanity check fairly quickly, I have another PR ready to go that is based on top of this one (thanks in advance ... I hope). |
Sorry! $ cylc run elephant
Traceback (most recent call last):
File "cylc/bin/cylc-run", line 25, in <module>
main(is_restart=False)
File "cylc/lib/cylc/scheduler_cli.py", line 116, in main
scheduler = Scheduler(is_restart, options, args)
File "cylc/lib/cylc/scheduler.py", line 126, in __init__
self.suite)
File "cylc/lib/cylc/suite_srv_files_mgr.py", line 327, in get_suite_source_dir
raise SuiteServiceFileError("ERROR: Suite not found %s" % reg)
cylc.suite_srv_files_mgr.SuiteServiceFileError: ERROR: Suite not found elephant |
Ah ... do you have a suite named 'elephant'? I guess your point is, for consistency, it shouldn't drop a traceback without |
Looks good! |
Close #2758
Close #2749
[UPDATED description 15 Oct]:
Abort suite registration if:
suite.rc
not found in target directory (this allows us to distinguish correct arg order)--redirect
Also support:
$PWD
cylc reg NAME
(auto-reg)cylc reg
(auto reg and auto-name - with name of parent dir)$PWD
, with name of parent dir).exec
) processcylc run
withcylc run NAME
for easy identification withps
etc.