-
Notifications
You must be signed in to change notification settings - Fork 5
Fix symlinking RemoteData nodes for remote-submission
#136
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
Conversation
db22cf4 to
e3be067
Compare
|
Ping to the team, @leclairm, @agoscinski, @DropD, that this should be ready for review. |
RemoteData nodes for remote-submission
src/sirocco/workgraph.py
Outdated
| filenames = {} | ||
| input_sockets = workgraph_task.inputs.nodes | ||
|
|
||
| for input_socket in input_sockets: |
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.
Check that this doesn't mess with SinglefileData.
pyproject.toml
Outdated
| "lxml", | ||
| "f90nml" | ||
| "f90nml", | ||
| "aiida-shell @ git+https://github.com/sphuber/aiida-shell.git@fix/105/handle-remote-data-argument-placeholders", |
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.
Need to pin here before the PR is merged and released.
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.
Do we need this change in aiida-shell or would this just make our life easier?
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.
Yeah, this is required. Without it, the instructions will always be appended by /*, so will always fail for our RemoteData files, see here:
https://github.com/sphuber/aiida-shell/blob/189df631759eb07e574bfb5a5be2843ea532ec9d/src/aiida_shell/calculations/shell.py#L341
We could still hack our way around it by using the parent of the src path, but then, still, all files in the directory will be linked. I think it's better if we keep it pinned for now, and expect the PR to aiida-shell to be merged and released.
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.
Can't we monkeypatch ShellJob and pin the exact version? When we start to include git hashes in our dependencies I am afraid we run into problems later on. Dependency resolvement becomes a bit intransparent and unpredictable, e.g. we pin a hash while wrokgraph pins a version.
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.
Yeah, that was more meant as a temporary fix. Maybe @sphuber can include the change in a patch release of aiida-shell, and we can set that?
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.
I finally released this fix in v0.8.1 just now. Had forgotten about it, sorry for the delay
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.
Cheers, thanks a lot @sphuber! Just in time that this PR actually works and can be reviewed 🚀
pyproject.toml
Outdated
| ## Hatch configurations | ||
|
|
||
| [tool.hatch.metadata] | ||
| allow-direct-references = true |
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.
Needed for being able to pin aiida-shell.
src/sirocco/workgraph.py
Outdated
|
|
||
| filenames = {} | ||
|
|
||
| for input_list in task.inputs.values(): |
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.
inputs can be a list of inputs because for shell task we can assign multiple inputs for one port and the list returns you all the inputs for this one port. I don't think we stress test this much so most of the time the input_list has just one element.
| for input_list in task.inputs.values(): | |
| for input_list in task.input_data_nodes: |
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.
I think you need to handle all inputs separate as these can be potentially different files. Note that currently our code is also buggy in this regard. If we pass the outputs of a parametrized shell task to another task aiida will copy the file to the working directory. Since the output filename is the same for each parameter they will be overwritten. So only one file exists in the working directory of the next tasks that gets this as input. The solution is to give the outputs unique names.
d16e396 to
965d606
Compare
c4b98d0 to
a2ca536
Compare
|
Can you rebase so we can run the tests? |
I decided to remove the check since we will need to move it to to the aiida part after PR #136 is merged. With #136 we need to consider remote data which we cannot check neigher in core nor parsing. So moving this now to the yaml parsing would require the adoption of many test which will be anyway not be needed.
| msg = f"Could not find computer {data.computer!r} for input {data}." | ||
| raise ValueError(msg) from err | ||
| self._aiida_data_nodes[label] = aiida.orm.RemoteData(remote_path=data.src, label=label, computer=computer) | ||
| # `remote_path` must be str not PosixPath to be JSON-serializable |
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.
This was a bug in the code before this PR that surfaced when actually submitting.
| [tool.pytest.ini_options] | ||
| # Configuration for [pytest](https://docs.pytest.org) | ||
| addopts = "--pdbcls=IPython.terminal.debugger:TerminalPdb" | ||
| addopts = "-s --pdbcls=IPython.terminal.debugger:TerminalPdb" |
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.
-s disables output capturing, and allows for setting breakpoints in test code
|
Superseeded by PR #157 from branch on upstream. |
- Add dispatching for `IconTask` in multiple functions in responsible for creating the WorkGraph. - Pass `computer` argument to `core.Task` since it is required for the creation of a `IconCaclculation`. In the `small-shell` config the usage of `computer` has been removed temporarly until PR #136 fixes the usage. - Changes in `core.AvailableData`: - Use `config_rootdir` to resolve location of data if relative. - The `src` member is now compulsory and validated. This change required to implement the `from_config` constructor for `AvailableData` and `GeneratedData` as the validation does not happen for `GeneratedData`. - Fixing how `is_restart` is determined: It was not considering the data structure correctly data items. It was only checking the existance of the restart key in the input items, it was, however, not considering that the data structure still lists the input item with an empty list when the `when` keyword is used. Now it validates correctly to `False`. - In tests we use now `pytest.fixture.usefixtures` when a fixture is not directly used but is required to be executed
I decided to remove the check since we will need to move it to to the aiida part after PR #136 is merged. With #136 we need to consider remote data which we cannot check neigher in core nor parsing. So moving this now to the yaml parsing would require the adoption of many test which will be anyway not be needed.
- Add dispatching for `IconTask` in multiple functions in responsible for creating the WorkGraph. - Pass `computer` argument to `core.Task` since it is required for the creation of a `IconCaclculation`. In the `small-shell` config the usage of `computer` has been removed temporarly until PR #136 fixes the usage. - Changes in `core.AvailableData`: - Use `config_rootdir` to resolve location of data if relative. - The `src` member is now compulsory and validated. This change required to implement the `from_config` constructor for `AvailableData` and `GeneratedData` as the validation does not happen for `GeneratedData`. - Fixing how `is_restart` is determined: It was not considering the data structure correctly data items. It was only checking the existance of the restart key in the input items, it was, however, not considering that the data structure still lists the input item with an empty list when the `when` keyword is used. Now it validates correctly to `False`. - In tests we use now `pytest.fixture.usefixtures` when a fixture is not directly used but is required to be executed
I decided to remove the check since we will need to move it to to the aiida part after PR #136 is merged. With #136 we need to consider remote data which we cannot check neither in core nor in parsing. So moving this now to the yaml parsing would require the adoption of many test which will be anyway not be needed.
Adds a new test case `small-icon` and renamed test case `small` to `small-shell`. The `small-icon` test case is a copy of `small` replacing the usage of the dummy icon scripts with real icon. Because the `small` test case increases coverage of `ShellTask` it is kept. - Add dispatching for `IconTask` in multiple functions in responsible for creating the WorkGraph. - Pass `computer` argument to `core.Task` since it is required for the creation of a `IconCaclculation`. In the `small-shell` config the usage of `computer` has been removed temporarly until PR #136 fixes the usage. - Changes in `core.AvailableData`: - Use `config_rootdir` to resolve location of data if relative. - The `src` member is now compulsory and validated. This change required to implement the `from_config` constructor for `AvailableData` and `GeneratedData` as the validation does not happen for `GeneratedData`. - Fixing how `is_restart` is determined: It was not considering the data structure correctly data items. It was only checking the existance of the restart key in the input items, it was, however, not considering that the data structure still lists the input item with an empty list when the `when` keyword is used. Now it validates correctly to `False`. - In tests we use now `pytest.fixture.usefixtures` when a fixture is not directly used but is required to be executed - Exclude `test/cases/*` in type check as it contains dummy python scripts - Update the default options of `hatch test` to run without icon - Rename pytest fixture `icon_grid_simple_path` to `icon_grid_path`
The issue we were encountering (see here) is resolved by specifying the
filenamesargument of theShellTask.Notes:
smalltest case currently fails asrestartoutput not retrieved -> Root of problem might lie elsewhere, thoughavailabledata inputs?!