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

verdi setup could automatically set up localhost #749

Closed
ltalirz opened this issue Oct 9, 2017 · 13 comments
Closed

verdi setup could automatically set up localhost #749

ltalirz opened this issue Oct 9, 2017 · 13 comments
Assignees
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/nice-to-have topic/config type/feature request status undecided

Comments

@ltalirz
Copy link
Member

ltalirz commented Oct 9, 2017

When using verdi setup, why not automatically set up the 'localhost' computer with the 'direct' scheduler?

This saves a few steps for new users getting started with AiiDA.

@giovannipizzi giovannipizzi added this to the v1.1.0 milestone Dec 3, 2018
@ltalirz ltalirz added the good first issue Issues that should be relatively easy to fix also for beginning contributors label Feb 3, 2020
@sphuber sphuber removed this from the v1.1.0 milestone Feb 28, 2020
@ramirezfranciscof ramirezfranciscof self-assigned this Sep 2, 2020
@ramirezfranciscof
Copy link
Member

@ltalirz would it be good enough to have all the defaults for the interactive prompt be the ones that set up localhost?

@ltalirz
Copy link
Member Author

ltalirz commented Sep 2, 2020

@ramirezfranciscof I'm not quite sure we are talking about the same thing here. To elaborate a bit more:

The idea would be that setting up a profile with verdi quicksetup or verdi setup automatically adds a localhost computer to the AiiDA database (just like it already adds a default user, for example).
Both commands currently have no command line options for this and I'm not sure any are needed - they could simply do it.

@ltalirz
Copy link
Member Author

ltalirz commented Sep 2, 2020

P.S. Perhaps I misunderstood your comment and what you mean is to leave verdi setup/quicksetup untouched and instead change verdi computer setup such that the defaults are the ones that would configure the localhost computer.

That is a possibility as well - I wonder whether there would be any unwanted side effects when setting up other computers (e.g. people forgetting to change the transport plugin to ssh)... but it might be a good idea and a step in the right direction.
I'm happy to review a PR that makes the change & play around with it a bit.

@ramirezfranciscof
Copy link
Member

Ahh, I see now. Yes, your second interpretation is right, since we were talking about localhost, my mind automatically inserted a computer between that verdi setup. Let me rethink this a bit then.

@mbercx
Copy link
Member

mbercx commented Nov 22, 2022

I like the idea in principle, but some of the setup (e.g. work_dir) should be specified by the user, no? Also: some users might have a local code they want to run with MPI perhaps?

Another side note is that this potentially can break setup scripts for users.

@ltalirz
Copy link
Member Author

ltalirz commented Nov 22, 2022

I like the idea in principle, but some of the setup (e.g. work_dir) should be specified by the user, no?

One can come up with a default work directory, e.g. tmp/$USER

Also: some users might have a local code they want to run with MPI perhaps?

This is not defined at the computer level, so I don't see the issue here?

Another side note is that this potentially can break setup scripts for users.

It could indeed. The default computer should therefore probably not be named localhost but some name that is not likely to occur by chance in existing setups.

@mbercx
Copy link
Member

mbercx commented Nov 22, 2022

This is not defined at the computer level, so I don't see the issue here?

Wouldn't one typically want to specify the mpirun_command in the computer setup? To be fair, I haven't run many local codes in parallel.

As a user myself, I typically do want to specify the working directory of my localhost computer though. Similarly, I'd prefer it to be called localhost. So I'd probably wind up simply deleting the automatically generated localhost computer. 😅

@sphuber
Copy link
Contributor

sphuber commented Dec 14, 2022

This was brought up in today's meeting. In my view, this should not be part of verdi setup as that is not its purpose. However, I can see adding a different dedicated command that automates the setup of localhost. Since it can be done using all defaults, it would require no user input. So we could simply add verdi computer setup-localhost (or some other name) and that takes no arguments or options. This way for tutorials or instructions the computer can be setup with a single simple command

@mbercx
Copy link
Member

mbercx commented Jan 11, 2023

Another alternative would be to have a --setup-localhost option for the verdi setup and verdi quicksetup commands. @ltalirz which of these suggestions do you think is best? If we agree I can take care of the implementation.

@ltalirz
Copy link
Member Author

ltalirz commented Jan 13, 2023

The short answer is that I agree with Sebastiaan - i.e. use a separate command, don't make it an option of setup/quicksetup.

On a related note: I think there is a use case for wanting to run a code locally from the terminal without having to set up anything - no extra command, no options to specify during setup, nothing.
While this goes somewhat against the current philosophy of how AiiDA usually works, it could be addressed by shipping a cli with the aiida-shell plugin e.g. something like aiida-shell pw.x -i pw.in > pw.out, which auto-generates a localhost computer and pw.x code on the fly, if they do not already exist.

@sphuber
Copy link
Contributor

sphuber commented Jan 16, 2023

While this goes somewhat against the current philosophy of how AiiDA usually works,

Not sure what philosophy that is that this would go against? As long as the provenance is kept, I don't see a problem. The issue was that it always required some setup overly laborious setup for the user. This is exactly what aiida-shell addresses.

it could be addressed by shipping a cli with the aiida-shell plugin e.g. something like aiida-shell pw.x -i pw.in > pw.out, which auto-generates a localhost computer and pw.x code on the fly, if they do not already exist.

This is a good idea I think. It might just be a bit tricky to properly define the syntax that is allowed after the aiida-shell command. In this case pw.in is an input file, and so it should be treated differently than another argument, but I am not sure that aiida-shell can automatically determine this. For the way it currently works at least, I am therefore not sure that it would work. But I can have a more in depth look to see what can be done.

@mbercx
Copy link
Member

mbercx commented May 7, 2024

@sphuber I think we can close this with #6351 merged? Or do we still want to add a separate verdi computer setup-localhost command as well?

@sphuber
Copy link
Contributor

sphuber commented May 7, 2024

I think we can consider this closed

@sphuber sphuber closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/nice-to-have topic/config type/feature request status undecided
Projects
None yet
Development

No branches or pull requests

6 participants