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

(WIP) LIU-5: Provide improved FileDROP naming and support for input-output filepaths. #314

Draft
wants to merge 3 commits into
base: LIU-448
Choose a base branch
from

Conversation

myxie
Copy link
Collaborator

@myxie myxie commented Mar 12, 2025

JIRA Ticket

LIU-5

Type

  • Feature (addition)
  • Bug fix
  • Refactor (change)
  • Documentation

Problem/Issue

DRAFT

An existing limitation of the DALiuGE engine is one of it's strengths; we create our own path names for intermediary data products because hard-coding them is prone to error, and so we have complete knowledge of the data.

The problem here when we have applications or functions that have an input parameter that is the name of the file (i.e. a runtime-generated output DROP).

Solution

To fix this, I have:

  • Added support for an input-output flag for a given parameter that is an ApplicationArgument
  • Provided a way to reference which output the input-output parameter we want to associated the flagged parameter
  • Provided support for prefix and suffix behaviour

Checklist

  • Unittests added
    • Reason for not adding unittests (remove this line if added)
  • Documentation added
    • Reason for not adding documentation (remove this line if added)

…port.

An existing limitation of the DALiuGE engine is one of it's strengths; we create our own path names for intermediary data products because hard-coding them is prone to error, and so we have complete knowledge of the data.

The problem here when we have applications or functions that have an input parameter that is the name of the file (i.e. a runtime-generated output DROP). To fix this, I have:

- Added support for an input-output flag for a given parameter that is an ApplicationArgument
- Provided a way to reference which output the input-output parameter we want to associated the flagged parameter
- Provided support for prefix and suffix behaviour
Copy link
Contributor

sourcery-ai bot commented Mar 12, 2025

Reviewer's Guide by Sourcery

This pull request introduces several new features and improvements to the DALiuGE engine, including support for input-output filepaths in PyFuncApp, INI configuration files and SLURM template files for job submission, and an updated build process.

Updated class diagram for PyFuncApp

classDiagram
    class PyFuncApp {
        -func_name
        -input_parser
        -output_parser
        -func_arg_mapping
        -func_defaults
        -func
        -argsig
        -argnames
        -fn_nargs
        -fn_defaults
        -fn_nposkw
        -varargs
        -varkw
        -fn_ndef
        -func_def_keywords
        -num_args
        -posonly
        -poskw
        -keyw
        -defaults
        -_recompute_data
        -_inputs
        -_outputs
        -_applicationArgs
        +initialize()
        +run()
        +write_results()
        +generate_recompute_data()
        -_mixin_func_defaults()
        -_init_fn_defaults()
        -_clean_applicationArgs()
        -_initialise_args()
        -_get_arg_info()
        -_init_appArgs()
        -_map_output_to_input()
        -_arg_to_output()
        -_ports2args()
        +_match_parser()
        +initialize_with_func_code()
    }
    class Argument {
      value: object
      encoding: DropParser
      type: Union [ArgType, None]
      input_output: bool
      precious: bool
      positional: bool
    }
    PyFuncApp -- Argument : uses
    note for Argument "Encapsulate data associated with all arguments."
Loading

Class diagram for ConfigManager

classDiagram
    class ConfigManager {
        -facilities
        -prompt_setup
        +setup_user()
        +prompt_user()
        +create_dlg_config_directory()
        +copy_defaults_to_user_config_directory()
        +get_user_configs()
        +print_available_config()
        +load_user_config()
    }
    class ConfigType {
        ENV
        SLURM
    }
    ConfigManager -- ConfigType : uses
Loading

File-Level Changes

Change Details Files
Added support for input-output filepaths in PyFuncApp to allow referencing output FileDROPs as input file parameters.
  • Introduced an input_output flag to ApplicationArgument to mark parameters that should be linked to an output file.
  • Implemented logic to map input-output arguments to the corresponding output FileDROP path using DALiuGE's variable substitution notation.
  • Modified _init_appArgs to handle input-output arguments and update their values with the output file paths.
  • Added _map_output_to_input to map input_output_args to the intended output.
  • Added _arg_to_output to map the argument to the output attribute that is referenced in the attribute.
daliuge-engine/dlg/apps/pyfunc.py
daliuge-engine/dlg/named_port_utils.py
daliuge-engine/dlg/data/drops/file.py
Introduced support for INI configuration files and SLURM template files for job submission.
  • Added config_file and slurm_template options to create_dlg_job.py to allow users to specify configuration and template files.
  • Implemented process_config and process_slurm_template functions to read and parse the configuration and template files.
  • Modified SlurmClient to accept config and slurm_template parameters and use them to generate the SLURM script.
  • Added a create_paramater_mapping function to map runtime or configured parameters to the session environment and SLURM script parameters.
  • Added a apply_slurm_template function to apply the SLURM template.
  • Added a session_dir property to the SlurmClient class.
  • Added a create_session_suffix function to create a suffix to identify the session.
daliuge-engine/dlg/deploy/slurm_client.py
daliuge-engine/dlg/deploy/create_dlg_job.py
daliuge-engine/dlg/deploy/configs/__init__.py
daliuge-engine/dlg/deploy/configs/config_manager.py
daliuge-engine/test/deploy/test_slurm_client.py
daliuge-engine/dlg/deploy/configs/default.ini
daliuge-engine/dlg/deploy/configs/setonix.ini
daliuge-engine/test/deploy/setonix.ini
daliuge-engine/VERSION
daliuge-engine/dlg/deploy/configs/default.slurm
daliuge-engine/dlg/deploy/configs/setonix.slurm
daliuge-engine/test/deploy/example_template.slurm
Added pyext module to the engine.
  • Added pyext module to the engine.
  • Added pyext module to the engine.
  • Added pyext module to the engine.
daliuge-engine/dlg/pyext/pyext.py
daliuge-engine/dlg/pyext/__init__.py
daliuge-engine/test/pyext/test_pyext.py
daliuge-engine/dlg/pyext/LICENSE
Updated dependencies and build process.
  • Removed explicit versioning of daliuge-common dependency in setup.py files.
  • Updated test dependencies in setup.py files.
  • Added a workflow to deploy DALiuGE to PyPI.
  • Added a function to extract the version from the VERSION file.
  • Added a VERSION file to the translator.
  • Added a VERSION file to the engine.
  • Added a VERSION file to the common.
daliuge-translator/setup.py
daliuge-engine/setup.py
daliuge-common/setup.py
daliuge-translator/VERSION
daliuge-engine/VERSION
daliuge-common/VERSION
.github/workflows/publish_to_pypi.yml
Miscellaneous fixes and improvements.
  • Fixed writing of BytesIO Data.
  • Updated installation documentation.
  • Fixed Drop naming.
  • Use translator avahi approach for engine docker container.
  • Use correct ports for CompositeManager.
  • Fixed a bug where the username was not configured in the INI file.
  • Fixed a bug where the remote directory could not be created.
  • Fixed a bug where the job submission was unsuccessful.
  • Fixed a bug where the pydata value was not parsed correctly.
  • Fixed a bug where the physical_graph_template_file was not checked for None.
daliuge-engine/dlg/drop_loaders.py
CHANGELOG.md
daliuge-engine/dlg/utils.py
daliuge-engine/dlg/data/drops/memory.py
daliuge-engine/dlg/deploy/deployment_utils.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@myxie myxie changed the title LIU-5: Provide improved FileDROP naming and support for input-output filepaths. (WIP) LIU-5: Provide improved FileDROP naming and support for input-output filepaths. Mar 12, 2025
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.

1 participant