From c37e6b726f450ba6d3e6bb4805ee37408a5f2b23 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Wed, 12 Jun 2024 17:20:45 +0100 Subject: [PATCH 1/8] Remove support for Ubuntu 1604 & for building local docs --- README.md | 2 +- Vagrantfile.ubuntu-1604 | 25 ------------------------- install-base.sh | 18 +++--------------- install-desktop.sh | 19 +++++-------------- install-mosrs.sh | 6 ++---- install.sh | 13 +------------ 6 files changed, 12 insertions(+), 71 deletions(-) delete mode 100755 Vagrantfile.ubuntu-1604 diff --git a/README.md b/README.md index fdb6c7e..b355d44 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Note that they are not as well tested as the default VM and may not include a de To use a different VM, modify the file which is loaded in the default `Vagrantfile` before running `vagrant up`. Alternatively you can set the environment variable `VAGRANT_VAGRANTFILE`, for example: ``` -export VAGRANT_VAGRANTFILE=Vagrantfile.ubuntu-1604 +export VAGRANT_VAGRANTFILE=Vagrantfile.ubuntu-2204 ``` (use `set` in place of `export` when using the command window on Windows). diff --git a/Vagrantfile.ubuntu-1604 b/Vagrantfile.ubuntu-1604 deleted file mode 100755 index f2103b3..0000000 --- a/Vagrantfile.ubuntu-1604 +++ /dev/null @@ -1,25 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -VAGRANTFILE_API_VERSION = "2" -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - config.vm.define "metomi-vm-ubuntu-1604" - config.vm.box = "bento/ubuntu-16.04" - # Remove "desktop" from the args below if only accessing via SSH - # Remove "mosrs" from the args below if not accessing the Met Office Science Repository Service - config.vm.provision :shell, path: "install.sh", args: "ubuntu 1604 desktop mosrs" - config.ssh.forward_x11 = true - - config.vm.provider "virtualbox" do |v| - v.name = "metomi-vm-ubuntu-1604" - v.customize ["modifyvm", :id, "--vram", "32"] - v.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"] - # Comment out the line below if only accessing via SSH - v.gui = true - # Modify the line below if you need more than 1GB RAM - v.memory = 1024 - v.cpus = 2 - end - -end diff --git a/install-base.sh b/install-base.sh index f757ed0..8c12c5d 100755 --- a/install-base.sh +++ b/install-base.sh @@ -87,10 +87,6 @@ if [[ $dist == ubuntu ]]; then rm -rf PackageFolder *.deb fi apt-get install -q -y pep8 || error # used by test-battery - if [[ $release != 1604 ]]; then - : # Rose docs build no longer working - disable for the moment - #apt-get install -q -y imagemagick || error - fi elif [[ $dist == redhat ]]; then yum install -y graphviz at lsof || error service atd start || error @@ -141,7 +137,6 @@ if [[ $dist == ubuntu ]]; then apt-get install -q -y tidy || error if [[ $release != 2204 ]]; then apt-get install -q -y python-requests || error - apt-get install -q -y python-virtualenv || error # needed by rose make-docs pip install mock pytest-tap || error # used by test-battery else pip2 install requests || error @@ -158,9 +153,6 @@ elif [[ $dist == redhat ]]; then yum install -y pcre-tools || error pip install mock pytest-tap || error # used by test-battery fi - if [[ $release == fedora* ]]; then - yum install -y python2-virtualenv || error # needed by rose make-docs - fi fi # Add the Rose wrapper scripts cd /usr/local/bin @@ -186,9 +178,9 @@ dos2unix -n /vagrant/usr/local/bin/install-cylc7 /usr/local/bin/install-cylc7 dos2unix -n /vagrant/usr/local/bin/install-cylc8 /usr/local/bin/install-cylc8 dos2unix -n /vagrant/usr/local/bin/install-rose /usr/local/bin/install-rose /usr/local/bin/install-fcm --set-default || error -/usr/local/bin/install-cylc7 --set-default --make-docs || error +/usr/local/bin/install-cylc7 --set-default || error /usr/local/bin/install-cylc8 || error -/usr/local/bin/install-rose --set-default --make-docs || error +/usr/local/bin/install-rose --set-default || error # Set the default to Cylc 7 ln -sf /opt/cylc-7 /opt/cylc @@ -226,11 +218,7 @@ if [[ $dist == ubuntu ]]; then rm -r mod_wsgi-4.9.3 echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so" > /etc/apache2/mods-enabled/wsgi.conf fi - if [[ $release == 1604 ]]; then - apt-get install -q -y libapache2-svn || error - else - apt-get install -q -y libapache2-mod-svn || error - fi + apt-get install -q -y libapache2-mod-svn || error elif [[ $dist == redhat ]]; then if [[ $release == centos8 ]]; then yum install -y mod_dav_svn python2-sqlalchemy httpd-devel || error diff --git a/install-desktop.sh b/install-desktop.sh index e9c92f0..a97c4ba 100755 --- a/install-desktop.sh +++ b/install-desktop.sh @@ -1,15 +1,9 @@ #### Install the LXDE desktop sudo -u $(logname) mkdir -p /home/vagrant/Desktop if [[ $dist == ubuntu ]]; then - if [[ $release == 1604 ]]; then - apt-get install -q -y xorg lxdm lxde lxsession-logout || error - else - apt-get install -q -y lxde xinput || error - fi + apt-get install -q -y lxde xinput || error apt-get remove -q -y --auto-remove --purge xscreensaver xscreensaver-data gnome-keyring || error - if [[ $release != 1604 ]]; then - apt-get remove -q -y --auto-remove --purge gnome-screensaver lxlock light-locker network-manager-gnome gnome-online-accounts || error - fi + apt-get remove -q -y --auto-remove --purge gnome-screensaver lxlock light-locker network-manager-gnome gnome-online-accounts || error # Set language update-locale LANG=en_GB.utf8 || { # have an error updating the locale - need to generate first @@ -29,7 +23,7 @@ elif [[ $dist == redhat ]]; then localectl set-x11-keymap gb || error fi # Enable auto login -if [[ $dist == ubuntu && $release != 1604 ]]; then +if [[ $dist == ubuntu ]]; then echo "[SeatDefaults]" >> /usr/share/lightdm/lightdm.conf.d/lxde.conf echo "user-session=LXDE" >> /usr/share/lightdm/lightdm.conf.d/lxde.conf echo "autologin-user=vagrant" >> /usr/share/lightdm/lightdm.conf.d/lxde.conf @@ -43,10 +37,7 @@ sudo -u $(logname) dos2unix -n /vagrant/home/Desktop/docs.desktop /home/vagrant/ sudo -u $(logname) mkdir -p /home/vagrant/.config/autostart sudo -u $(logname) cp /usr/share/applications/lxterminal.desktop /home/vagrant/.config/autostart # Configure middle button emulation -if [[ $dist == ubuntu && $release == 1604 ]]; then - sudo -u $(logname) bash -c 'echo "[Desktop Entry]" >/home/vagrant/.config/autostart/xinput.desktop' - sudo -u $(logname) bash -c 'echo "Exec=xinput set-prop 11 \"Evdev Middle Button Emulation\" 1" >>/home/vagrant/.config/autostart/xinput.desktop' -elif [[ ($dist == ubuntu && $release == 1804) || ($dist == redhat && $release == fedora*) ]]; then +if [[ ($dist == ubuntu && $release == 1804) || ($dist == redhat && $release == fedora*) ]]; then sudo -u $(logname) bash -c 'echo "[Desktop Entry]" >/home/vagrant/.config/autostart/xinput.desktop' sudo -u $(logname) bash -c 'echo "Exec=xinput set-prop 11 \"libinput Middle Emulation Enabled\" 1" >>/home/vagrant/.config/autostart/xinput.desktop' fi @@ -55,7 +46,7 @@ sudo -u $(logname) mkdir -p /home/vagrant/.config/clipit sudo -u $(logname) bash -c 'echo "[rc]" >/home/vagrant/.config/clipit/clipitrc' sudo -u $(logname) bash -c 'echo "offline_mode=false" >>/home/vagrant/.config/clipit/clipitrc' # Setup desktop background colour -if [[ $dist == ubuntu && $release != 1604 ]]; then +if [[ $dist == ubuntu ]]; then sudo -u $(logname) mkdir -p /home/vagrant/.config/pcmanfm/LXDE sudo -u $(logname) bash -c 'echo "[*]" >/home/vagrant/.config/pcmanfm/LXDE/desktop-items-0.conf' sudo -u $(logname) bash -c 'echo "desktop_bg=#2f4266" >>/home/vagrant/.config/pcmanfm/LXDE/desktop-items-0.conf' diff --git a/install-mosrs.sh b/install-mosrs.sh index f65206c..752451f 100755 --- a/install-mosrs.sh +++ b/install-mosrs.sh @@ -2,9 +2,7 @@ if [[ $dist == ubuntu || ($dist == redhat && $release != centos7) ]]; then if [[ $dist == ubuntu ]]; then apt-get install -q -y libgpg-error-dev libgcrypt20-dev libassuan-dev libksba-dev libpth-dev zlib1g-dev || error - if [[ $release != 1604 ]]; then - apt-get remove -q -y --auto-remove --purge gpg-agent || error - fi + apt-get remove -q -y --auto-remove --purge gpg-agent || error else yum install -y zlib-devel libgpg-error-devel libgcrypt-devel libassuan-devel libksba-devel || error wget -q ftp://ftp.gnu.org/gnu/pth/pth-2.0.7.tar.gz || error @@ -19,7 +17,7 @@ if [[ $dist == ubuntu || ($dist == redhat && $release != centos7) ]]; then fi curl -L -s -S https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.31.tar.bz2 | tar -xj || error cd gnupg-2.0.31 - if [[ ($dist == ubuntu && $release != 1604) ]]; then + if [[ $dist == ubuntu ]]; then ./configure CFLAGS="-fcommon" || error else ./configure || error diff --git a/install.sh b/install.sh index a1a6ba3..ed6f109 100755 --- a/install.sh +++ b/install.sh @@ -19,24 +19,13 @@ if [[ $collections =~ desktop ]]; then echo "Installation in progress, please wait" > /etc/nologin fi -if [[ $dist == ubuntu && $release == 1604 ]]; then - # Address issues some hosts experience with networking (specifically, DNS latency) - # See https://github.com/mitchellh/vagrant/issues/1172 - if [ ! $(grep single-request-reopen /etc/resolvconf/resolv.conf.d/base) ]; then - echo "options single-request-reopen" >> /etc/resolvconf/resolv.conf.d/base && resolvconf -u - fi -fi - if [[ $dist == redhat && $release == centos* ]]; then # Add the EPEL repository yum install -y epel-release || error fi # Use the WANdisco subversion packages -if [[ $dist == ubuntu && $release == 1604 ]]; then - add-apt-repository 'deb http://opensource.wandisco.com/ubuntu xenial svn110' || error - wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add - || error -elif [[ $dist == redhat && $release == centos7 ]]; then +if [[ $dist == redhat && $release == centos7 ]]; then cat > /etc/yum.repos.d/WANdisco-svn.repo < Date: Wed, 12 Jun 2024 17:27:11 +0100 Subject: [PATCH 2/8] github actions: Move fcm conflicts tests to separate step --- .github/workflows/tests.yaml | 8 ++++++-- install.sh | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a3b37ce..e277843 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -58,6 +58,10 @@ jobs: CYLC_VERSION=8 rose version && \ fcm version && \ svn --version && \ - gfortran --version | grep 4.8.5 || fcm test-battery t/fcm-make && \ - fcm test-battery t/fcm-conflicts && \ + fcm test-battery t/fcm-make && \ which at" + + - name: Test fcm conflicts + run: | + export VAGRANT_VAGRANTFILE=Vagrantfile.${{ matrix.os }} + vagrant ssh -c "fcm test-battery t/fcm-conflicts" diff --git a/install.sh b/install.sh index ed6f109..3fdad55 100755 --- a/install.sh +++ b/install.sh @@ -20,6 +20,8 @@ if [[ $collections =~ desktop ]]; then fi if [[ $dist == redhat && $release == centos* ]]; then + # Stream 8 now EOL + sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* # Add the EPEL repository yum install -y epel-release || error fi From 50c31b03e098636ac84b0244e89fdd2c4dac3c4f Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Thu, 13 Jun 2024 12:00:40 +0100 Subject: [PATCH 3/8] Support gpg-agent >v2.0 --- .github/workflows/tests.yaml | 5 +++-- install-mosrs.sh | 28 ---------------------------- usr/local/bin/mosrs-setup-gpg-agent | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 39 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e277843..1243ce5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,9 +59,10 @@ jobs: fcm version && \ svn --version && \ fcm test-battery t/fcm-make && \ + gpg-agent --version && \ which at" - - name: Test fcm conflicts + - name: Test fcm conflicts (ignore errors) run: | export VAGRANT_VAGRANTFILE=Vagrantfile.${{ matrix.os }} - vagrant ssh -c "fcm test-battery t/fcm-conflicts" + vagrant ssh -c "fcm test-battery t/fcm-conflicts || true" diff --git a/install-mosrs.sh b/install-mosrs.sh index 752451f..2af795d 100755 --- a/install-mosrs.sh +++ b/install-mosrs.sh @@ -1,32 +1,4 @@ #### Install and configure gpg-agent -if [[ $dist == ubuntu || ($dist == redhat && $release != centos7) ]]; then - if [[ $dist == ubuntu ]]; then - apt-get install -q -y libgpg-error-dev libgcrypt20-dev libassuan-dev libksba-dev libpth-dev zlib1g-dev || error - apt-get remove -q -y --auto-remove --purge gpg-agent || error - else - yum install -y zlib-devel libgpg-error-devel libgcrypt-devel libassuan-devel libksba-devel || error - wget -q ftp://ftp.gnu.org/gnu/pth/pth-2.0.7.tar.gz || error - tar xzf pth-2.0.7.tar.gz - rm pth-2.0.7.tar.gz - cd pth-2.0.7 - ./configure --libdir=/usr/lib64 --exec-prefix=/usr || error - make || error - make install || error - cd .. - rm -r pth-2.0.7 - fi - curl -L -s -S https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.31.tar.bz2 | tar -xj || error - cd gnupg-2.0.31 - if [[ $dist == ubuntu ]]; then - ./configure CFLAGS="-fcommon" || error - else - ./configure || error - fi - make || error - make install || error - cd .. - rm -r gnupg-2.0.31 -fi # Add script that caches the user's Science Repository Service password for the session dos2unix -n /vagrant/usr/local/bin/mosrs-cache-password /usr/local/bin/mosrs-cache-password # Add script to start gpg-agent and cache the password when needed and source it in .bashrc diff --git a/usr/local/bin/mosrs-setup-gpg-agent b/usr/local/bin/mosrs-setup-gpg-agent index cfccac6..01692a9 100755 --- a/usr/local/bin/mosrs-setup-gpg-agent +++ b/usr/local/bin/mosrs-setup-gpg-agent @@ -1,15 +1,18 @@ -# If gpg-agent is already running, load its environment into this session -# Otherwise start it and cache the MOSRS password +# Define env file for use with gpg-agent v2.0 (ignored for v2.1+) envfile="$HOME/.gnupg/gpg-agent.env" +# Ensure GPG_AGENT_INFO is set for use by rosie if [[ -z "$GPG_AGENT_INFO" ]]; then - [[ -e "$envfile" ]] && eval "$(cat $envfile)" + if [[ -e "$envfile" ]]; then + eval "$(cat $envfile)" + else + GPG_AGENT_INFO=$(gpgconf --list-dirs | sed -n 's/agent-socket:\(.*\)/\1/p') + fi + export GPG_AGENT_INFO fi -export GPG_AGENT_INFO +# Start gpg-agent if it is not already running if ! gpg-agent 2>/dev/null; then - eval "$(gpg-agent --daemon --allow-preset-passphrase --batch --max-cache-ttl 43200 --write-env-file $envfile)" - mosrs-cache-password -else - # Check whether the passphrase is already cached - echo "GET_PASSPHRASE --no-ask rosie:https:code.metoffice.gov.uk Err Pmt Des" | gpg-connect-agent | grep -q "^OK " || mosrs-cache-password + eval "$(gpg-agent --daemon --allow-preset-passphrase --batch --max-cache-ttl 43200 --write-env-file $envfile 2>/dev/null)" fi unset envfile +# Check whether the password is already cached +echo "GET_PASSPHRASE --no-ask rosie:https:code.metoffice.gov.uk Err Pmt Des" | gpg-connect-agent | grep -q "^OK " || mosrs-cache-password From 11f6f944ff6ac105c69d86a80a1ad203d3e4c429 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Thu, 13 Jun 2024 13:10:32 +0100 Subject: [PATCH 4/8] Remove support for Fedora 28 --- Vagrantfile.fedora-28 | 25 ------------------------- install-base.sh | 31 ++++++++----------------------- install-desktop.sh | 2 +- 3 files changed, 9 insertions(+), 49 deletions(-) delete mode 100755 Vagrantfile.fedora-28 diff --git a/Vagrantfile.fedora-28 b/Vagrantfile.fedora-28 deleted file mode 100755 index 7301033..0000000 --- a/Vagrantfile.fedora-28 +++ /dev/null @@ -1,25 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -VAGRANTFILE_API_VERSION = "2" -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - config.vm.define "metomi-vm-fedora-28" - config.vm.box = "bento/fedora-28" - # Remove "desktop" from the args below if only accessing via SSH - # Remove "mosrs" from the args below if not accessing the Met Office Science Repository Service - config.vm.provision :shell, path: "install.sh", args: "redhat fedora28 desktop mosrs" - config.ssh.forward_x11 = true - - config.vm.provider "virtualbox" do |v| - v.name = "metomi-vm-fedora-28" - v.customize ["modifyvm", :id, "--vram", "32"] - v.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"] - # Comment out the line below if only accessing via SSH - v.gui = true - # Modify the line below if you need more than 1GB RAM - v.memory = 1024 - v.cpus = 2 - end - -end diff --git a/install-base.sh b/install-base.sh index 8c12c5d..d114740 100755 --- a/install-base.sh +++ b/install-base.sh @@ -23,12 +23,7 @@ if [[ $dist == ubuntu ]]; then elif [[ $dist == redhat ]]; then yum install -y gvim emacs || error # Set the default editor in .bash_profile - if [[ $release == fedora* ]]; then - yum install -y leafpad || error - echo "export EDITOR=leafpad" >>.bash_profile - else - echo "export EDITOR=emacs" >>.bash_profile - fi + echo "export EDITOR=emacs" >>.bash_profile fi #### Install FCM dependencies & configuration @@ -44,10 +39,7 @@ elif [[ $dist == redhat ]]; then fi yum install -y perl-Config-IniFiles subversion-perl || error yum install -y gcc-c++ || error # used by fcm test-battery - if [[ $release == fedora* ]]; then - yum install -y m4 perl-DBI || error - yum install -y tkcvs xxdiff || error - elif [[ $release == centos7 ]]; then + if [[ $release == centos7 ]]; then yum install -y tkcvs kdiff3 || error else yum install -y perl-DBI || error @@ -57,7 +49,7 @@ fi # Add the fcm wrapper script dos2unix -n /vagrant/usr/local/bin/fcm /usr/local/bin/fcm # Configure FCM diff and merge viewers -if [[ $dist == redhat && $release != fedora* ]]; then +if [[ $dist == redhat ]]; then mkdir -p /opt/metomi-site/etc/fcm dos2unix -n /vagrant/opt/metomi-site/etc/fcm/external.cfg /opt/metomi-site/etc/fcm/external.cfg fi @@ -90,13 +82,8 @@ if [[ $dist == ubuntu ]]; then elif [[ $dist == redhat ]]; then yum install -y graphviz at lsof || error service atd start || error - if [[ $release == fedora* ]]; then - yum install -y redhat-rpm-config sqlite || error - yum install -y ImageMagick || error - elif [[ $release == centos8 ]]; then - yum install -y sqlite || error - fi if [[ $release == centos8 ]]; then + yum install -y sqlite || error yum install -y python2-pip python2-jinja2 || error else yum install -y python-pip python-pep8 python-jinja2 || error @@ -151,7 +138,7 @@ elif [[ $dist == redhat ]]; then else yum install -y python-requests || error yum install -y pcre-tools || error - pip install mock pytest-tap || error # used by test-battery + #pip install mock pytest-tap || error # used by test-battery fi fi # Add the Rose wrapper scripts @@ -172,6 +159,9 @@ dos2unix -n /vagrant/opt/metomi-site/etc/rose/rose.conf /opt/metomi-site/etc/ros if [[ $dist == ubuntu ]]; then # Ensure curl is installed apt-get install -q -y curl || error +elif [[ $dist == redhat ]]; then + # Ensure wget is installed + yum install -y wget || error fi dos2unix -n /vagrant/usr/local/bin/install-fcm /usr/local/bin/install-fcm dos2unix -n /vagrant/usr/local/bin/install-cylc7 /usr/local/bin/install-cylc7 @@ -326,8 +316,3 @@ dos2unix -n /vagrant/usr/local/bin/install-um-data /usr/local/bin/install-um-dat dos2unix -n /vagrant/usr/local/bin/install-um-extras /usr/local/bin/install-um-extras dos2unix -n /vagrant/usr/local/bin/run-test-batteries /usr/local/bin/run-test-batteries dos2unix -n /vagrant/usr/local/bin/um-setup /usr/local/bin/um-setup - -if [[ $dist == redhat && $release == fedora* ]]; then - # Allow these commands to be found via sudo - echo "Defaults:vagrant secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin" >/etc/sudoers.d/vagrant-path -fi diff --git a/install-desktop.sh b/install-desktop.sh index a97c4ba..a641f53 100755 --- a/install-desktop.sh +++ b/install-desktop.sh @@ -37,7 +37,7 @@ sudo -u $(logname) dos2unix -n /vagrant/home/Desktop/docs.desktop /home/vagrant/ sudo -u $(logname) mkdir -p /home/vagrant/.config/autostart sudo -u $(logname) cp /usr/share/applications/lxterminal.desktop /home/vagrant/.config/autostart # Configure middle button emulation -if [[ ($dist == ubuntu && $release == 1804) || ($dist == redhat && $release == fedora*) ]]; then +if [[ $dist == ubuntu && $release == 1804 ]]; then sudo -u $(logname) bash -c 'echo "[Desktop Entry]" >/home/vagrant/.config/autostart/xinput.desktop' sudo -u $(logname) bash -c 'echo "Exec=xinput set-prop 11 \"libinput Middle Emulation Enabled\" 1" >>/home/vagrant/.config/autostart/xinput.desktop' fi From 649e7cb40b01409d1106187398aa9a202408a825 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Fri, 14 Jun 2024 08:03:53 +0100 Subject: [PATCH 5/8] Configure gpg-agent --- install-mosrs.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install-mosrs.sh b/install-mosrs.sh index 2af795d..5f534d0 100755 --- a/install-mosrs.sh +++ b/install-mosrs.sh @@ -6,6 +6,11 @@ dos2unix -n /vagrant/usr/local/bin/mosrs-setup-gpg-agent /usr/local/bin/mosrs-se echo ". /usr/local/bin/mosrs-setup-gpg-agent" >>/home/vagrant/.bashrc # Add script to install Rose meta data dos2unix -n /vagrant/usr/local/bin/install-rose-meta /usr/local/bin/install-rose-meta +# Set gpg-agent options (required when gpg-agent started automatically) +sudo -u $(logname) mkdir -p /home/vagrant/.gnupg +sudo -u $(logname) bash -c 'echo "allow-preset-passphrase" >/home/vagrant/.gnupg/gpg-agent.conf' +sudo -u $(logname) bash -c 'echo "batch" >>/home/vagrant/.gnupg/gpg-agent.conf' +sudo -u $(logname) bash -c 'echo "max-cache-ttl 43200" >>/home/vagrant/.gnupg/gpg-agent.conf' #### Configure FCM mkdir -p /etc/subversion From b8395ee191fc4a1728a5592d955fd530d938ddb5 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Fri, 14 Jun 2024 08:10:52 +0100 Subject: [PATCH 6/8] Remove redundant instructions re gpg-agent --- README.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b355d44..47eb4dc 100644 --- a/README.md +++ b/README.md @@ -123,22 +123,9 @@ Then use the `cd` command to navigate to the directory where you have extracted ## Ubuntu Pro -While Ubuntu 18.04 LTS went end-of-life in May 2023, an [Ubuntu Pro](https://ubuntu.com/pro) subscription can be used to get security updates for a further 5 years. This is free for personal use for up to 5 machines and the process is documented in a [Tutorial](https://ubuntu.com/pro/tutorial). Before you run the `sudo apt update && sudo apt upgrade` commands, you should first -``` -sudo apt-mark hold gpg-agent -``` - -After rebooting, you may get the error "gpg-preset-passphrase: caching passphrase failed: Not supported". Here you will need to re-install gpg-agent manually, in a similar way to how it is originally installed in the [install-mosrs](install-mosrs.sh) script: -``` -sudo apt-get remove -q -y --auto-remove --purge gpg-agent -curl -L -s -S https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.31.tar.bz2 | tar -xj -cd gnupg-2.0.31/ -./configure CFLAGS="-fcommon" -make -sudo make install -``` +While Ubuntu 18.04 LTS went end-of-life in May 2023, an [Ubuntu Pro](https://ubuntu.com/pro) subscription can be used to get security updates for a further 5 years. This is free for personal use for up to 5 machines and the process is documented in a [Tutorial](https://ubuntu.com/pro/tutorial). -When you reboot your VM you may also get the error "Vagrant was unable to mount VirtualBox shared folders". This can be fixed by [re-installing the VirtualBox guest additions](https://www.virtualbox.org/manual/ch04.html#additions-linux), which can be done via the command-line by +When you reboot your VM you may get the error "Vagrant was unable to mount VirtualBox shared folders". This can be fixed by [re-installing the VirtualBox guest additions](https://www.virtualbox.org/manual/ch04.html#additions-linux), which can be done via the command-line by ``` sudo apt install -y virtualbox-guest-additions-iso ``` From 1a7e8d04b47f518a6191dd72c62e8ce914fe0e46 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Fri, 14 Jun 2024 09:27:44 +0100 Subject: [PATCH 7/8] Add missing rose-2019.01 symlink --- install-base.sh | 2 +- usr/local/bin/install-cylc7 | 2 +- usr/local/bin/install-fcm | 2 +- usr/local/bin/install-rose | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/install-base.sh b/install-base.sh index d114740..00b5706 100755 --- a/install-base.sh +++ b/install-base.sh @@ -172,7 +172,7 @@ dos2unix -n /vagrant/usr/local/bin/install-rose /usr/local/bin/install-rose /usr/local/bin/install-cylc8 || error /usr/local/bin/install-rose --set-default || error # Set the default to Cylc 7 -ln -sf /opt/cylc-7 /opt/cylc +ln -sf cylc-7 /opt/cylc #### Configure syntax highlighting & bash completion sudo -u $(logname) mkdir -p /home/vagrant/.local/share/gtksourceview-3.0/language-specs/ diff --git a/usr/local/bin/install-cylc7 b/usr/local/bin/install-cylc7 index 871e0a2..21e8d07 100755 --- a/usr/local/bin/install-cylc7 +++ b/usr/local/bin/install-cylc7 @@ -55,5 +55,5 @@ fi if $set_default; then echo Setting the default Cylc 7 version to $CYLC_VERSION rm -f /opt/cylc-7 - ln -sf /opt/cylc-$CYLC_VERSION /opt/cylc-7 + ln -sf cylc-$CYLC_VERSION /opt/cylc-7 fi diff --git a/usr/local/bin/install-fcm b/usr/local/bin/install-fcm index 1cb0749..d712563 100755 --- a/usr/local/bin/install-fcm +++ b/usr/local/bin/install-fcm @@ -46,5 +46,5 @@ fi if $set_default; then echo Setting the default FCM version to $FCM_VERSION rm -f /opt/fcm - ln -sf /opt/fcm-$FCM_VERSION /opt/fcm + ln -sf fcm-$FCM_VERSION /opt/fcm fi diff --git a/usr/local/bin/install-rose b/usr/local/bin/install-rose index 702a3f1..f5eae39 100755 --- a/usr/local/bin/install-rose +++ b/usr/local/bin/install-rose @@ -48,5 +48,6 @@ fi if $set_default; then echo Setting the default Rose version to $ROSE_VERSION rm -f /opt/rose - ln -sf /opt/rose-$ROSE_VERSION /opt/rose + ln -sf rose-$ROSE_VERSION /opt/rose + ln -sf rose-$ROSE_VERSION /opt/rose-2019.01 fi From 6cf343fb1cf4a9bc6d8a84c03e1867527fcf14b3 Mon Sep 17 00:00:00 2001 From: dpmatthews Date: Fri, 14 Jun 2024 10:48:11 +0100 Subject: [PATCH 8/8] Ubuntu 2204: fix broken rosie ws --- .github/workflows/tests.yaml | 1 + opt/metomi-site/etc/httpd/rosie-wsgi.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1243ce5..e8f915c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,6 +59,7 @@ jobs: fcm version && \ svn --version && \ fcm test-battery t/fcm-make && \ + rosie hello && \ gpg-agent --version && \ which at" diff --git a/opt/metomi-site/etc/httpd/rosie-wsgi.conf b/opt/metomi-site/etc/httpd/rosie-wsgi.conf index 04f9111..cf4afce 100644 --- a/opt/metomi-site/etc/httpd/rosie-wsgi.conf +++ b/opt/metomi-site/etc/httpd/rosie-wsgi.conf @@ -1,4 +1,4 @@ -WSGIPythonPath /opt/cylc/lib:/opt/rose/lib/python +WSGIPythonPath /opt/cylc/lib:/opt/rose/lib/python:/usr/local/lib/python2.7/dist-packages WSGIScriptAlias /rosie /opt/rose/lib/python/rosie/ws.py WSGIScriptAlias /cylc-review /opt/cylc/bin/cylc-review