ecmwf / pyflow-wellies

A set of tools to build consistent pyflow suites.
https://pyflow-wellies.readthedocs.io/latest/
Apache License 2.0
1 stars 1 forks source link

New features #4

Open corentincarton opened 9 months ago

corentincarton commented 9 months ago

Is your feature request related to a problem? Please describe.

Some things that should be changed for next release:

colonesej commented 9 months ago

Add version as ecflow variable at suite level for any module provided. Use wellies tools key, which is already unique, as variable name. example

tools:
  modules:
    python:
      name: python3
      version: 3.10
   python_new:
      name: python3
      version: 3.12

pf.Suite(
   (...)
   variables={
      "PYTHON_VERSION":"3.10",
      "PYTHON_NEW_VERSION": "3.12",
  },
  (...)
)
corentincarton commented 9 months ago

This is something we discussed with @oiffrig a few weeks ago as it was needed in one of the operational suites. There's a way to do this without modifying the wellies code:

tools:
  modules:
    python:
      name: python3
      version: ${PYTHON_VERSION:-3.10}
   python_new:
      name: python3
      version: ${PYTHON_VERSION_NEW:-3.12}

The good thing with this approach is that it doesn't pollute your list of variables by default and you can just add the variable to the suite when you need it. But I agree it's not straightforward, so maybe it could be featured in the documentation or the quickstart?

colonesej commented 9 months ago

How about changing pyflow to identify bash variables in scripts with defaults and treat them as exportables even if not defined on a node/tree?

corentincarton commented 9 months ago

Ah yes, you're right, it will need to be identified in the script generation otherwise the variable will not be exported. Not sure it's safe to do that automatically in pyflow... I would prefer your first suggestion. What bothers me is that we do all sorts of gymnastics when we could use directly ecflow variables with default values %PYTHON_VERSION:3.12% :D

colonesej commented 9 months ago

Another thing that came to me (it might not belong to wellies but maybe tracksuits, not sure):

Second one could be replaced by tracksuite commit message but do we include there information about the git state of the source project by default?

corentincarton commented 9 months ago

Yes we could definitely do that! It doesn't belong in tracksuite, but more in wellies. We already have add a wellies-specific message which includes the version of wellies used to deploy the suite, but we could add the local git hash/branch/tag as well if we find one.