FCM logo

FCM (Flexible Configuration Management) is a code management tool that essentially does two jobs: firstly, it's your tool for dealing with the JULES version-control system, and, secondly, it deals with the compilation of the JULES model too.

Installing FCM means you have also installed Subversion, which FCM uses to deal with version control internally, so there will be no need to install Subversion as well even if you get any error messages saying "svn command is not found" later on.

** To follow the following steps you need to have a MOSRS password **

** For CACHING YOUR MOSRS PASSWORD, see STEP 6 below **

** PLEASE NOTE that you will need versions of Cylc, Rose and FCM that can work together: see STEP 1 here for how to select them **

 

STEP 0: Check whether FCM is already installed.

fcm --version

If FCM has already been installed on your system, this will give you a version number (a date; it's OK if the locale is not set properly, e.g. "Setting locale failed"); otherwise it'll say "command not found".

STEP 1 *** SKIP THIS STEP IF FCM ALREADY INSTALLED ***:

Install using these commands from a bash terminal

   cd ~/.local

   git clone https://github.com/metomi/fcm.git
   cd fcm
   git tag -l
   git checkout tags/2021.05.0
   cd ..
 

STEP 2 *** SKIP THIS STEP IF FCM ALREADY INSTALLED ***:

You need to link your FCM Subversion repository to the MOSRS (this is explained here). Two possibilities here: type

   ls ~/.subversion/servers

 

STEP 2a *** SKIP THIS STEP IF FCM ALREADY INSTALLED ***:

If this says ‘No such file or directory’ then you have not used Subversion before on this system so you need to create that .subversion/servers file:

   mkdir ~/.subversion

Create a textfile ~/.subversion/servers with the following lines (substituting your MOSRS username instead of tobymarthews):

[groups]
metofficesharedrepos = code*.metoffice.gov.uk

[metofficesharedrepos]
username = tobymarthews
store-plaintext-passwords = no

 

STEP 2b *** SKIP THIS STEP IF FCM ALREADY INSTALLED ***:

Alternatively, if you have used Subversion on this system before then you need to modify the textfile at ~/.subversion/servers: find the [groups] and [metofficesharedrepos] sections and amend them to have the extra few lines specified above (remembering to substitute the correct MOSRS username), leaving the rest of the file unmodified.

   *** Potential problem *** if your existing version of Subversion is pre-vn1.9 then your MOSRS password may not cache properly and you may need to add another repository following instructions similar to these, but please take advice from a System Administrator in this case to be sure you do not disturb the existing svn installation.

 

STEP 3 *** SKIP THIS STEP IF FCM ALREADY INSTALLED ***:

Now you need to append the FCM command set to your library. This must be done every time you log on, so best to add the following line to the end of your ~/.bashrc file to accomplish this:

export PATH=$HOME/.local/fcm/bin:$PATH

chmod -R 755 ~/.local

Run your .bashrc file (or log off and log in again):

   . ~/.bashrc

 

STEP 4: Now check the installation:

   fcm --version

 

All done: FCM should be installed (typing FCM_EXEC=$(which fcm);echo $FCM_EXEC will tell you where it is installed, if you are interested).

 

STEP 5: Keywords

Set up keywords as described here (which is necessary to get Rose Stem working, but also saves a bit of typing). Do this by creating a textfile on your system at ~/.metomi/fcm/keyword.cfg containing these lines:


location{primary, type:svn}[jules.x] = https://code.metoffice.gov.uk/svn/jules/main
browser.loc-tmpl[jules.x] = https://code.metoffice.gov.uk/trac/{1}/intertrac/source:/{2}{3}
browser.comp-pat[jules.x] = (?msx-i:\A // [^/]+ /svn/ ([^/]+) /*(.*) \z)

location{primary, type:svn}[jules_doc.x] = https://code.metoffice.gov.uk/svn/jules/doc
browser.loc-tmpl[jules_doc.x] = https://code.metoffice.gov.uk/trac/{1}/intertrac/source:/{2}{3}
browser.comp-pat[jules_doc.x] = (?msx-i:\A // [^/]+ /svn/ ([^/]+) /*(.*) \z)

n.b. in a command such as "fcm co fcm:jules.x_tr@vn5.5 jules-vn5.5", there are two keywords: the "fcm:jules.x_tr" and the "vn5.5" and you'll need that keyword.cfg file set up to use either of them. If you don't have keywords set up then you can still download, but you'll need to replace the "vnX.X" bit with a revision number from here and you'll need to replace the"fcm:jules.x_tr" with the URL "https://code.metoffice.gov.uk/svn/jules/main/trunk".

 

STEP 6: Cache your MOSRS password

Not finished yet: you need also to cache your MOSRS password in order to be able to use FCM, as described here. There are two options: GNOME keyring (Seahorse) and GPG Agent. The instructions here are for GPG agent only.

 

** CACHING YOUR MOSRS PASSWORD may be problematic on Fedora 23 systems and/or if your MOSRS password has special characters in it (definitely "%" causes problems - see note at the end of this page - and perhaps other characters like "!" or "&" too; change your MOSRS password here): please email JULES support if you encounter problems **

 

Download two MOSRS utilities from here:

   firefox https://code.metoffice.gov.uk/trac/home/raw-attachment/wiki/AuthenticationCaching/GpgAgent/mosrs-setup-gpg-agent

Put in your MOSRS password, save the file and close Firefox.

   firefox https://code.metoffice.gov.uk/trac/home/raw-attachment/wiki/AuthenticationCaching/GpgAgent/mosrs-cache-password

Again, put in your MOSRS password, save the file and close Firefox.

   mv ~/Downloads/mosrs-setup-gpg-agent ~/.local/mosrs-setup-gpg-agent
   mv ~/Downloads/mosrs-cache-password ~/.local/mosrs-cache-password
   export PATH=$HOME/.local:$PATH
   chmod -R 755 ~/.local

Now activate (n.b. you need to have installed Rose first before this can work):

   . mosrs-setup-gpg-agent

You should be asked to put your MOSRS password in more than once and then you’ll be told your Subversion and Rosie passwords have been cached (on the first time through you may need to log out and log back in more than once to make this work). To test this has worked correctly, you should find that you are NOT asked for your password when you type in the following commands:

   rosie hello

   svn info --username=tobymarthews https://code.metoffice.gov.uk/svn/test

(just to be clear: if you get a response from rosie hello and the svn command WITHOUT having to type in your password then your password is cached correctly. If it works, but asks you for your password then you've got Rose and FCM installed correctly, but it's missing or can't access one or other of your profile files so rewind a few steps and try again).

 

You will need to re-cache your MOSRS password every time you log in from now on. It’s easiest to accomplish this by adding the following lines to the end of your .bashrc file (n.b. the command with square brackets in it won't display properly on this webpage so I've uploaded an image instead and you must type that bit in):

export PATH=$HOME/.local:$PATH

text that won't display in drupal#Stop if not running interactively (see MetO advice from https://code.metoffice.gov.uk/trac/home/wiki/AuthenticationCaching/GpgAgent ; n.b. here they give the same advice (more or less) but no quotes around the $- at the start and this seems to work just as well)
. mosrs-setup-gpg-agent

(if you log out and log in again, you should find that it now asks you for your MOSRS password and informs you that your subversion and rosie passwords have been cached: if none of that happens then one possibility is that your system has only been set up to run .bash_profile on logon rather than .bash_profile and .bashrc and you can change that setting with these commands

   cd $HOME

   ln -s .bashrc .bash_profile

which create a softlink to achieve this. If the ln command returns "File exists" then instead edit your existing .bash_profile file to add this

   . $HOME/.bashrc

on the end of it, which should be enough).