-
Notifications
You must be signed in to change notification settings - Fork 7
Pull UKMO components from Github #385
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
Changes from all commits
7eabff3
26e2087
743214a
381aaf3
ba20703
c0f985e
a68a97e
34a9f2d
0e6d9e9
25cb004
381e0ef
67bbaaf
374891d
89c8977
2302f86
43e0d97
5f4de99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,18 +7,18 @@ class Gcom(Package): | |
| GCOM is a wrapper around multiprocessing libraries such as MPI | ||
| """ | ||
|
|
||
| homepage = "https://github.com/ACCESS-NRI/gcom" | ||
| homepage = "https://code.metoffice.gov.uk/trac/gcom" | ||
| # svn = "file:///g/data/ki32/mosrs/gcom/main/trunk" | ||
| git = "https://github.com/ACCESS-NRI/gcom" | ||
|
|
||
| maintainers("scottwales", "paulleopardi") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should you add yourself to maintainers? |
||
|
|
||
| version("7.8", tag="vn7.8") | ||
| version("7.9", tag="vn7.9") | ||
| version("8.0", tag="vn8.0") | ||
| version("8.1", tag="vn8.1") | ||
| version("8.2", tag="vn8.2") | ||
| version("8.3", tag="vn8.3") | ||
| version("8.4", tag="vn8.4") | ||
| version("7.8", tag="vn7.8", commit="65c857cc3201833360ff62b285e49082378dae42") | ||
| version("7.9", tag="vn7.9", commit="6319ae016dcadc192842a06178f3dbd21a8af64f") | ||
| version("8.0", tag="vn8.0", commit="5a122e9e2147c9a7486a00b9588356eb65324af9") | ||
| version("8.1", tag="vn8.1", commit="e061e2787bd643d9a65679f153fb8e3ffd9d3186") | ||
| version("8.2", tag="vn8.2", commit="fd143bb38e21fe03c7150c0754852c80e15df3d4") | ||
| version("8.3", tag="vn8.3", commit="b7b890a181d8e31e4e80b731b9f8ad9a6e1a8bed") | ||
| version("8.4", tag="vn8.4", commit="f4fa92eb4af4f1e4cf9d608b441e3c96f77b6a6d") | ||
|
|
||
| variant("mpi", default=True, description="Build with MPI") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,17 +64,13 @@ class Um(Package): | |
| # String variants have their default values set to "none" here. | ||
| # The real default is set by the model. | ||
|
|
||
| # Revision variants. | ||
| _rev_variants = ( | ||
| "casim_rev", | ||
| "jules_rev", | ||
| "shumlib_rev", | ||
| "socrates_rev", | ||
| "ukca_rev") | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does removing the "_rev" variants force all builds to use GitHub only? Will MOSRS-based builds still succeed?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm genuinely unsure. The logic in the spack package is too hard to follow. The existing AM3
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will do some testing today.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI is failing with It is probably best to revert your removal of the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it is may be better to migrate from MOSRS to GitHub gradually. I will need to think of how to do this.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the points to. If (e.g.)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point, I would recommend waiting until I have made the changes needed for #362 to be merged. |
||
| # Git reference variants. | ||
| _ref_variants = ( | ||
| "casim_ref", | ||
| "jules_ref", | ||
| "shumlib_ref", | ||
| "socrates_ref", | ||
| "ukca_ref", | ||
| "um_ref") | ||
|
|
||
| # Other string variants. | ||
|
|
@@ -115,7 +111,7 @@ class Um(Package): | |
| "um_sources" | ||
| ) | ||
|
|
||
| _str_variants = _rev_variants + _ref_variants + _other_variants | ||
| _str_variants = _ref_variants + _other_variants | ||
|
|
||
| for var in _str_variants: | ||
| variant(var, default="none", description=var, values="*", multi=False) | ||
|
|
@@ -174,15 +170,32 @@ class Um(Package): | |
|
|
||
| # Optional Github sources to be used in build (i.e. AM3) | ||
| _resource_cfg = { | ||
| "casim_ref": { | ||
| "sources_var": "casim_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/casim.git", | ||
| "subdir": "casim"}, | ||
| "jules_ref": { | ||
| "sources_var": "jules_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/JULES.git", | ||
| "subdir": "jules"}, | ||
| "shumlib_ref": { | ||
| "sources_var": "shumlib_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/shumlib.git", | ||
| "subdir": "shumlib"}, | ||
| "socrates_ref": { | ||
| "sources_var": "socrates_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/socrates.git", | ||
| "subdir": "socrates"}, | ||
| "um_ref": { | ||
| "sources_var": "um_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/UM.git", | ||
| "subdir": "um"}} | ||
|
|
||
| "subdir": "um"}, | ||
| "ukca_ref": { | ||
| "sources_var": "ukca_sources", | ||
| "git_url": "https://github.com/ACCESS-NRI/ukca.git", | ||
| "subdir": "ukca" | ||
| } | ||
| } | ||
|
|
||
| def _config_file_path(self, model): | ||
| """ | ||
|
|
@@ -320,17 +333,6 @@ def check_model_vs_sources_vs_ref( | |
| check_model_vs_spec(model, config_env, var, spec_str_value) | ||
| config_env[var] = spec_str_value | ||
|
|
||
| # Override those environment variables where a revision variant is specified. | ||
| # If the variant is left unspecified, and the model does not specify a revision, | ||
| # then use a component revision based on the spec UM version. | ||
| for var in self._rev_variants: | ||
| spec_value = spec.variants[var].value | ||
| if spec_value != "none": | ||
| check_model_vs_spec(model, config_env, var, spec_value) | ||
| config_env[var] = spec_value | ||
| elif var not in config_env or config_env[var] == "": | ||
| config_env[var] = f"um{spec.version}" | ||
|
|
||
| # Override those environment variables where any other string variant is specified. | ||
| for var in self._other_variants: | ||
| spec_value = spec.variants[var].value | ||
|
|
@@ -359,34 +361,16 @@ def check_model_vs_sources_vs_ref( | |
| linker_args = self._get_linker_args(spec, var) | ||
| config_env[f"ldflags_{fcm_name}_on"] = linker_args | ||
|
|
||
| # The _resource_cfg is relevant only for models that use Github URLs. | ||
| # Only one model so far, but this may change in future. | ||
| if model == "vn13p1-am": | ||
| # Get the root to the resources | ||
| resources_root = join_path(self.stage.source_path, "resources") | ||
| # Add sources to the environment if requested | ||
| for ref_var in self._resource_cfg: | ||
| ref_value = spec.variants[ref_var].value | ||
| if ref_value != "none": | ||
| sources_var = self._resource_cfg[ref_var]["sources_var"] | ||
| subdir = self._resource_cfg[ref_var]["subdir"] | ||
| resource_path = join_path(resources_root, subdir) | ||
| # Output appropriate warning messages. | ||
| check_model_vs_sources_vs_ref( | ||
| model, | ||
| config_env, | ||
| sources_var, | ||
| ref_var, | ||
| resource_path) | ||
| config_env[sources_var] = resource_path | ||
| else: | ||
| # The model does not use Github URLs and ignores the ref variants. | ||
| for ref_var in self._resource_cfg: | ||
| ref_value = spec.variants[ref_var].value | ||
| if ref_value != "none": | ||
| tty.warn( | ||
| f"The {model} model ignores the variant " | ||
| f"{ref_var}={ref_value}.") | ||
| # Get the root to the resources | ||
| resources_root = join_path(self.stage.source_path, "resources") | ||
| # Add sources to the environment if requested | ||
| for ref_var in self._resource_cfg: | ||
| ref_value = spec.variants[ref_var].value | ||
| if ref_value != "none": | ||
| sources_var = self._resource_cfg[ref_var]["sources_var"] | ||
| subdir = self._resource_cfg[ref_var]["subdir"] | ||
| resource_path = join_path(resources_root, subdir) | ||
| config_env[sources_var] = resource_path | ||
|
|
||
| # Set environment variables based on config_env. | ||
| for key in config_env: | ||
|
|
||
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.
If you want to remove a line, just remove it, otherwise explain in the comment why the line is commented out.