-
Notifications
You must be signed in to change notification settings - Fork 211
Description
Goal
With #4021 we can parse EasyConfig-specific options in an EasyStack file. However, nothing is done with those parsed options yet.
One of the options of primary importance would be to be able to use --from-pr
, so that EasyStack files can be also include software that has just been PR-ed, but is not part of an EasyBuild release yet.
Required adaptations
In this issue, I want to discuss the approach and issues surrounding --from-pr
support in EasyStack files.
In #3513 (comment) we have identified a couple of places in the code that would definitely need adaptation for --from-pr
support in EasyStack files.
det_easyconfig_paths
: gets the original paths for the EasyConfigs specified in the EasyStack file. At this stage, no dependency resolution is done yet. However, this function should resolve the list of EasyConfig filenames to paths to EasyConfig files. As such, it needs to be aware of--from-pr
, so that EasyConfig files that are part of PRs are resolved to the tempdir where the PR is checked out.resolve_dependencies
: receives a list of EasyConfig objects as argument, and then resolves the dependencies for those. Since this function is responsible for locating the paths to EasyConfig files for these dependencies, it has to be aware of--from-pr
. It finds EasyConfigs from dependencies by callingrobot_find_easyconfig
, which in turn relies onbuild_option('robot_path')
, which in turn is set during initial configuration of eb byset_up_configuration
. Technically, this means therobot_path
build option should be updated in order forrobot_find_easyconfig
to be able to find the EasyConfig in a tempdir that stores a PR.
Challenges
It is not completely clear what the desired behaviour should be. Let us consider the following EasyStack file:
# my_easystack.yaml
easyconfigs:
- A.eb
options: {
'from_pr': 1235,
}
- B.eb
Where both A
and B
have a dependency on C, and PR 1234 includes an updated C.eb
. Clearly, we can only install one version of C, so
eb --easystack my_easystack.yaml --robot
should pick one C.eb
, install it, and then install A
and B
. But: which C.eb
should it pick? Technically, our definiton above said "We want to use PR 1234 for A.eb
(and it's dependency C)", but it also said "Install B.eb
(and it's dependency C) from EasyConfigs found on the default robot search path". Thus, this essentially refers to two different versions of C
. That, clearly, is not an option.
The reason this question is important is that we should wonder: how should resolve_dependencies
find EasyConfigs? Should it realize that C is a dependency of A, and that A had a PR set, and therefore should it search the tempdir in which that PR was checked out for C.eb
? What if we had listed B.eb first? Then, it would have already resolved C.eb
to its local version.
One option would be that we simply add all from_pr
's specified for specific EasyConfigs to the global build_option('from_pr')
early on. That way, the behaviour is predictable (and the implementation is actually easier): C.eb
will always resolve to the version from PR 1234.