Implement verdi computer duplicate #1937
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1937 +/- ##
===========================================
+ Coverage 67.47% 67.53% +0.05%
===========================================
Files 321 321
Lines 33195 33275 +80
===========================================
+ Hits 22399 22472 +73
- Misses 10796 10803 +7
Continue to review full report at Codecov.
|
| echo.echo_info('pk: {}, uuid: {}'.format(computer.pk, computer.uuid)) | ||
|
|
||
| echo.echo_info("Note: before using it with AiiDA, configure it using the command") | ||
| echo.echo_info(" verdi computer configure {} {}".format(computer.get_transport_type(), computer.name)) |
There was a problem hiding this comment.
In interactive mode, we should simply prompt the user should for this (because it almost always needs to happen).
There was a problem hiding this comment.
(Meaning: Configure computer ... now? [Y/n] )
There was a problem hiding this comment.
Do you now how this would work? I know I can do something like ctx.invoke(click_command, **kwargs) to invoke the command, but if I don't pass anything in kwargs, it complains that Computer is None in the configure command. If I do pass it, I get the exception TypeError: transport_configure_command() got multiple values for keyword argument 'computer'. Is this complicated because the configure commands are created dynamically?
| echo.echo_info("Note: before using it with AiiDA, configure it using the command") | ||
| echo.echo_info(" verdi computer configure {} {}".format(computer.get_transport_type(), computer.name)) | ||
| echo.echo_info("(Note: machine_dependent transport parameters cannot be set via ") | ||
| echo.echo_info("the command-line interface at the moment)") |
There was a problem hiding this comment.
Would it be possible to give a bit more details here/be more constructive?
E.g. "Note: For setting[property] use [function] from the python interface"
There was a problem hiding this comment.
I agree that the description is vague, I still don't really understand what is meant here. Does it relate to minimum transport open interval and stuff like that? If so, in any case I don't think that listing them here is going to make it more clear. Probably we should in that case just reference to a place in the documentation, until they get implemented in the CLI. Should this go in this PR, or should we open separate issue?
There was a problem hiding this comment.
OK after discussion, removed these lines as they will be implemented in the future and the current information was just plain confusing
| * **test**: tests if the current user (or a given user) can connect to the computer and if basic operations perform as expected (file copy, getting the list of jobs in the scheduler queue, ...) | ||
| * **update**: change configuration of a computer. Works only if the computer node is a disconnected node in the database (has not been used yet) | ||
| * **duplicate**: setup a new computer, starting from the settings of an existing one | ||
| * **update**: [deprecated: use ``verdi computer duplicate`` instead] change configuration of a computer. Works only if the computer node is a disconnected node in the database (has not been used yet) |
There was a problem hiding this comment.
Not even sure we should include deprecated functions in the user documentation.
Once the deprecation is clear from the verdi output, I think we don't need to mention it here.
(btw: in the case of verdi code, update is not just deprecated - it also does not work)
ltalirz
left a comment
There was a problem hiding this comment.
Just tested the automatic configure locally and it's fantastic!
One of these things where people will wonder why it hasn't been like this all along.
| except ValidationError as err: | ||
| echo.echo_critical('unable to store the computer: {}. Exiting...'.format(err)) | ||
| else: | ||
| echo.echo_success('stored computer {}<{}>'.format(computer.name, computer.pk)) |
There was a problem hiding this comment.
never saw this pattern before - learned something new today ;-)
Fixes #1788