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

Changes to um-setup to allow GCOM to install with Cylc 8 #40

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

theabro
Copy link
Contributor

@theabro theabro commented Dec 20, 2024

Following from GCOM:#242, GCOM will only be able to be installed with Cylc 8. As the um-setup script installs from the head of the GCOM trunk by default, this will cause problems when running this script after GCOM:#242 is commited unless Cylc 8 can be used.

The changes in um-setup have been made to:

  1. Maintain the directory structure of the GCOM install as done under Cylc 7, to minimise changes needed elsewhere in the script.
  2. Keep Cylc 7 as an option when needing to install older versions of GCOM (the -c 7 option)
  3. Provide Cylc 8 as the default behaviour (although running with -c 8 will also make use of Cylc 8)

After Cylc 8 is used to install GCOM, the Cylc version is set back to 7 for use with ShumLib.

It may be best to not commit this pull request until GCOM:#242 has been commited, but to do so as soon as possible thereafter.

UM ticket um:#7839 will update UMDP X10 documentation on how to install and run the UM on the VM.

When Cylc 8 is used, additional information is given when the um-setup script is run:

INSTALLED gcom_install from /tmp/tmp.nxxEAXDBBI/wc/rose-stem
INFO - Workflow: gcom_install
INFO - Scheduler: url=tcp://vagrant:43001 pid=169780
INFO - Workflow publisher: url=tcp://vagrant:43092
INFO - Run: (re)start number=1, log rollover=1
INFO - Cylc version: 8.3.6
INFO - Run mode: live
INFO - Initial point: 1
INFO - Final point: 1
INFO - Workflow shutting down - AUTOMATIC

This has been tested with Andy Malcolm's vn8.3_cylc8 branch with UM13.7. This has been tested with rose-stem and all jobs completed successfully.

The command

um-setup -s fcm:shumlib.x_tr@um13.7 -g fcm:gcom.x_br/dev/andymalcolm/vn8.3_cylc8

was used to install GCOM. To install the current GCOM head of trunk, the following command was tested, and GCOM installed successfully

um-setup -s fcm:shumlib.x_tr@um13.7 -c 7

if [ "$cylc_version" -ne "7" ]&&[ "$cylc_version" -ne "8" ]; then
ereport "Cylc version for GCOM must be 7 or 8"
fi
;;
-g) shift
Copy link

Choose a reason for hiding this comment

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

Just checking, as I was looking as part of SR for UM:7839...
Does this logic work if "-c" is not the last argument provided ? becasue if it's not the last argument, after 'shift' surely $1 will be the next argument - so users will get the message "Cylc version for GCOM must be 7 or 8", but it won't be clear what was read and 'used' as the cylc version.
I mean, it's not significantly worse than the rest of the argument parsing stuff here (they all seem to check to see if there's a $1, but none of them have a default if there isn't, they just die on the spot.
Also, as the script drops out of the case statement (assuming it survived ingesting the next arg as a value for cylc_version).
Assuming the other values are sanity checked further down, by all means keep the sanity check on the value being 7 or 8, but add "got $cylc_version" to the error message so at least the user gets a clue as to what it's ingested.
I think however it would be safer to also remove the "else cylc_version='8'" and just give the same error as everything else if no supplementary arg was provided. Otherwise "um-setup -c -s <some/path/somewhere>" is just going to cause headaches all round when it returns with "unrecognised argument: <some/path/somewhere>"

Copy link
Contributor Author

@theabro theabro Jan 15, 2025

Choose a reason for hiding this comment

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

Many thanks. I have updated in 23ad19b.

I have tested this and the -c can come first and behaves correctly unless there is no argument given, when the error is then, e.g.

vagrant@vagrant:~$ um-setup -c -s fcm:shumlib.x_tr@um13.7 -g fcm:gcom.x_br/dev/andymalcolm/vn8.3_cylc8
./um-setup: line 43: [: -s: integer expression expected
Unrecognised argument: fcm:shumlib.x_tr@um13.7
Usage: um-setup [-g gcom_path] [-s shumlib_path] [-c GCOM Cylc version]

Options:
  -c [7/8]   Cylc version to use (7 or 8) for GCOM install (default=8)
  -g path    GCOM source location (working copy or repository location)
  -h         Show this help and exit
  -s path    Shumlib source location (working copy or repository location)

The error message has been updated so that the Cylc version is returned if it isn't 7 or 8, e.g.

vagrant@vagrant:~$ um-setup -c 9 -s fcm:shumlib.x_tr@um13.7 -g fcm:gcom.x_br/dev/andymalcolm/vn8.3_cylc8
Cylc version for GCOM must be 7 or 8, provided 9
Usage: um-setup [-g gcom_path] [-s shumlib_path] [-c GCOM Cylc version]

Options:
  -c [7/8]   Cylc version to use (7 or 8) for GCOM install (default=8)
  -g path    GCOM source location (working copy or repository location)
  -h         Show this help and exit
  -s path    Shumlib source location (working copy or repository location)

If the -c is at the end of the line then the error message is slightly nicer, as it would be for the other arguments

vagrant@vagrant:~$ um-setup -s fcm:shumlib.x_tr@um13.7 -c
Cylc version not provided
Usage: um-setup [-g gcom_path] [-s shumlib_path] [-c GCOM Cylc version]

Options:
  -c [7/8]   Cylc version to use (7 or 8) for GCOM install (default=8)
  -g path    GCOM source location (working copy or repository location)
  -h         Show this help and exit
  -s path    Shumlib source location (working copy or repository location)

@theabro
Copy link
Contributor Author

theabro commented Feb 7, 2025

GCOM:#242 has now been committed, so can this pull request be committed to enable VM system to keep in line with the head of GCOM trunk?

@dpmatthews dpmatthews merged commit 99096f5 into metomi:master Feb 7, 2025
0 of 3 checks passed
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.

3 participants