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

AiiDA workgraph creation rebased on new IR #45

Open
wants to merge 1 commit into
base: cli-args
Choose a base branch
from

Conversation

agoscinski
Copy link
Collaborator

@agoscinski agoscinski commented Nov 26, 2024

Please merge first #75

Implementation of running Shell Task with workgraph.

Initialization of all files required to run workflows. The workflow config files are updated to work properly. The $PWD environment is removed because the config_rootdir is now used.

To allow a graph like initialization of workgraph tasks first creating the task nodes and then linking the additional information including inpouts outputs and arguments we implemented a temporary hack to overcome internal validations.

TODO:

  • fix tests
  • update IR tests
  • I think we should upgrade to workgraph 0.4 to avoid headaches later on --> Made issue Upgrade to workgraph v0.4 #76, not high priority
  • ~possibility to run the tests with the current profile to debug the workflow? --> No easy solution found for now
  • mv files for IR tests into separate folder (in separate PR) --> Not needed since all files are in the config folder

GeigerJ2 added a commit that referenced this pull request Dec 17, 2024
This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.
GeigerJ2 added a commit that referenced this pull request Dec 17, 2024
This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.
@GeigerJ2
Copy link
Collaborator

OK, @agoscinski, all conflicts should be resolved now. Will branch off from this here, to work on the ShellTask.

agoscinski added a commit that referenced this pull request Dec 30, 2024
TODO remove expandvars hack, use by default local folder

TODO remove example reference from tests

Arbitrary CLI args for shell tasks (#66)

This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.

Fix svgs being created in main directory. (#67)

Create `svg` files in subdirectory under `tests/files/svgs` instead of top-level directory, and ignore them via `.gitignore`, while syncing the `svgs` directory.
Merge remote-tracking branch 'origin/main' into workgraph

---

Pass single argument string to `ShellTasks` (#72)

* Try to make current example YAML files run through.

* Update class names after rebase/merge

* Add `no_icon` config file

* First working version apart from flags.

* Try fixing argument format.

* Current state before branch-off.

* Pass one multi-line string as `cli_argument`

* Cleanup.

* Pass arguments as list.

* Remove `workgraph-dev.py` dev file.

* Fix issues from `hatch fmt`

reimplementing cli_arguments

change to unspecified inputs are added as positional cli args automatically

delete examples

add files required to run the workflow

remove old files

use rootdir from config

move files to confi folder

adapt configs to relativ to config folder

rm expandvars

fix hatch fmt

fix hatch fmt

update reference

rm comment
agoscinski added a commit that referenced this pull request Dec 30, 2024
TODO remove expandvars hack, use by default local folder

TODO remove example reference from tests

Arbitrary CLI args for shell tasks (#66)

This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.

Fix svgs being created in main directory. (#67)

Create `svg` files in subdirectory under `tests/files/svgs` instead of top-level directory, and ignore them via `.gitignore`, while syncing the `svgs` directory.
Merge remote-tracking branch 'origin/main' into workgraph

---

Pass single argument string to `ShellTasks` (#72)

* Try to make current example YAML files run through.

* Update class names after rebase/merge

* Add `no_icon` config file

* First working version apart from flags.

* Try fixing argument format.

* Current state before branch-off.

* Pass one multi-line string as `cli_argument`

* Cleanup.

* Pass arguments as list.

* Remove `workgraph-dev.py` dev file.

* Fix issues from `hatch fmt`

reimplementing cli_arguments

change to unspecified inputs are added as positional cli args automatically

delete examples

add files required to run the workflow

remove old files

use rootdir from config

move files to confi folder

adapt configs to relativ to config folder

rm expandvars

fix hatch fmt

fix hatch fmt

update reference

rm comment
agoscinski added a commit that referenced this pull request Dec 31, 2024
TODO remove expandvars hack, use by default local folder

TODO remove example reference from tests

Arbitrary CLI args for shell tasks (#66)

This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.

Fix svgs being created in main directory. (#67)

Create `svg` files in subdirectory under `tests/files/svgs` instead of top-level directory, and ignore them via `.gitignore`, while syncing the `svgs` directory.
Merge remote-tracking branch 'origin/main' into workgraph

---

Pass single argument string to `ShellTasks` (#72)

* Try to make current example YAML files run through.

* Update class names after rebase/merge

* Add `no_icon` config file

* First working version apart from flags.

* Try fixing argument format.

* Current state before branch-off.

* Pass one multi-line string as `cli_argument`

* Cleanup.

* Pass arguments as list.

* Remove `workgraph-dev.py` dev file.

* Fix issues from `hatch fmt`

reimplementing cli_arguments

change to unspecified inputs are added as positional cli args automatically

delete examples

add files required to run the workflow

remove old files

use rootdir from config

move files to confi folder

adapt configs to relativ to config folder

rm expandvars

fix hatch fmt

fix hatch fmt

update reference

rm comment

implement wait_on

clean up code

clean up add doc
agoscinski added a commit that referenced this pull request Jan 1, 2025
TODO remove expandvars hack, use by default local folder

TODO remove example reference from tests

Arbitrary CLI args for shell tasks (#66)

This PR adds the `_CliArgsBaseModel` class (inspired from `_WhenBaseModel`), which replaces the `command_option` and `input_arg_options` of the `ConfigShellTaskSpecs`. Validation is applied on the correctness of the keyword and positional arguments to ensure they start with `-` or `--`.

The three test YAML files are updated accordingly, leading to changes in the pretty-print test text files, which is also part of the PR.

Actually making something useful out of these arguments only happens when the WG is created, so will require #45 to be merged.

Fix svgs being created in main directory. (#67)

Create `svg` files in subdirectory under `tests/files/svgs` instead of top-level directory, and ignore them via `.gitignore`, while syncing the `svgs` directory.
Merge remote-tracking branch 'origin/main' into workgraph

---

Pass single argument string to `ShellTasks` (#72)

* Try to make current example YAML files run through.

* Update class names after rebase/merge

* Add `no_icon` config file

* First working version apart from flags.

* Try fixing argument format.

* Current state before branch-off.

* Pass one multi-line string as `cli_argument`

* Cleanup.

* Pass arguments as list.

* Remove `workgraph-dev.py` dev file.

* Fix issues from `hatch fmt`

reimplementing cli_arguments

change to unspecified inputs are added as positional cli args automatically

delete examples

add files required to run the workflow

remove old files

use rootdir from config

move files to confi folder

adapt configs to relativ to config folder

rm expandvars

fix hatch fmt

fix hatch fmt

update reference

rm comment

implement wait_on

clean up code

clean up add doc

cli parameters

update tests

test work

fix everything
@agoscinski agoscinski changed the base branch from main to cli-args January 1, 2025 17:09
@agoscinski agoscinski marked this pull request as ready for review January 1, 2025 17:18
Initialization of all files required to run workflows. The workflow config files
are updated to work properly. The $PWD environment is removed because the
config_rootdir is now used.

To allow a graph like initialization of workgraph tasks first creating the task
nodes and then linking the additional information including inpouts outputs and
arguments we implemented a temporary hack to overcome internal validations.
cli_arguments: "{--restart icon_restart} {--init initial_conditions}"
env_source_files: data/dummy_source_file.sh
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been added to test this in the workgraph as we do not run the large config where this is also used

[
"tests/cases/small/config/test_config_small.yml",
"tests/cases/parameters/config/test_config_parameters.yml",
],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the large config takes 4 minutes to run therefore it is not included in the tests

@@ -0,0 +1 @@
pytest_plugins = ["aiida.tools.pytest_fixtures"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This autoloads a temporary aiida profile for the tests. I find pytest is doing here a bit too much in the background. One needs to look into the auto fixtures from aiida to see what is all created. Just keep in mind that the tests are not run with your current profile but create a temporary one.

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 this pull request may close these issues.

2 participants