diff --git a/.github/workflows/build-test-release-client-packages.yml b/.github/workflows/build-test-release-client-packages.yml index 26ec3728..54d37a96 100644 --- a/.github/workflows/build-test-release-client-packages.yml +++ b/.github/workflows/build-test-release-client-packages.yml @@ -36,12 +36,6 @@ jobs: echo "localhost ansible_connection=local" > inventory/hosts ansible-playbook ./prepare-client-packages.yml - - name: Include the old eessi-hpc.org config as well for now - run: | - wget https://github.com/EESSI/filesystem-layer/releases/download/v0.4.0/cvmfs-config-eessi-0.4.0.tar - tar -C ./package -xf cvmfs-config-eessi-0.4.0.tar - rm cvmfs-config-eessi-0.4.0.tar - # We probably should loop over the set {rpm,deb,osxpkg} to create packages, but # it will make debugging more annoying. @@ -244,7 +238,28 @@ jobs: run: sudo cvmfs_config setup - name: Test repository access - run: ls /cvmfs/software.eessi.io/ + run: | + ls /cvmfs/software.eessi.io/ + cfg=$(cvmfs_config showconfig software.eessi.io) + # Print the full configuration for debugging purposes + echo "$cfg" + # Check that the GEO API is enabled + echo "$cfg" | grep "CVMFS_USE_GEOAPI=yes" + # CVMFS_CLIENT_PROFILE=single should set CVMFS_USE_CDN + echo "$cfg" | grep "CVMFS_USE_CDN=yes" + # Check that the openhtc.io CDN URLs are used for the Stratum 1 servers + echo "$cfg" | grep "CVMFS_SERVER_URL" | grep "openhtc.io" + + # Check if we can still override the CDN setting + echo "CVMFS_USE_CDN=custom_value" | sudo tee -a /etc/cvmfs/default.local + sudo cvmfs_config reload software.eessi.io + cfg=$(cvmfs_config showconfig software.eessi.io) + # Print the full configuration for debugging purposes + echo "$cfg" + # Check that the custom value for CVMFS_USE_CDN shows up in the configuration + echo "$cfg" | grep "CVMFS_USE_CDN=custom_value" + # Now we should not be using the openhtc.io URLs anymore + echo "$cfg" | grep "CVMFS_SERVER_URL" | grep -v "openhtc.io" # test-macos-package: # needs: build-macos-package diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 5dad42ea..5f3f1035 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -39,6 +39,15 @@ eessi_cvmfs_server_urls: - "http://azure-us-east-s1.eessi.science/cvmfs/@fqrn@" - "http://ral-uk-s1.eessi.science:8000/cvmfs/@fqrn@" +# URLs for all CDN Stratum 1 servers. +eessi_cvmfs_server_cdn_urls: + - domain: eessi.io + use_geoapi: true + urls: + - "http://s1eessieu1-cvmfs.openhtc.io/cvmfs/@fqrn@" + - "http://s1eessina1-cvmfs.openhtc.io/cvmfs/@fqrn@" + - "http://s1ral-cvmfs.openhtc.io/cvmfs/@fqrn@" + # Configuration of all the repositories. eessi_cvmfs_repositories: - repository: software.eessi.io diff --git a/prepare-client-packages.yml b/prepare-client-packages.yml index 4afbd800..161a54bc 100644 --- a/prepare-client-packages.yml +++ b/prepare-client-packages.yml @@ -40,9 +40,6 @@ - name: Make EESSI CVMFS domain configuration file ansible.builtin.copy: content: | - # Stratum 1 servers for the eessi.io domain - CVMFS_SERVER_URL="{{ item.urls | join(';') }}" - # Public keys for the eessi.io domain CVMFS_KEYS_DIR="/etc/cvmfs/keys/{{ item.domain }}" @@ -51,11 +48,26 @@ # The client profile is supposed to be set in /etc/cvmfs/default.local if [ "$CVMFS_CLIENT_PROFILE" = "single" ]; then - if [ "$CVMFS_HTTP_PROXY" = "" ]; then - # For individual clients (laptops, clusters < 5 nodes), use a site proxy - # where possible and otherwise a direct stratum 1 connection - CVMFS_HTTP_PROXY="DIRECT" - fi + if [ "$CVMFS_HTTP_PROXY" = "" ]; then + # For individual clients (laptops, clusters < 5 nodes), use a site proxy + # where possible and otherwise a direct stratum 1 connection + CVMFS_HTTP_PROXY="DIRECT" + fi + fi + + # Check if we should use a CDN + CVMFS_USE_CDN="$CVMFS_USE_CDN" + if [ -z "$CVMFS_USE_CDN" ] && [ "$CVMFS_HTTP_PROXY" = "DIRECT" ] || [ "$CVMFS_HTTP_PROXY" = "auto;DIRECT" ]; then + CVMFS_USE_CDN="yes" + fi + + # Stratum 1 servers for the eessi.io domain + if [ "$CVMFS_USE_CDN" = "yes" ]; then + CVMFS_SERVER_URL="{{ eessi_cvmfs_server_cdn_urls | selectattr('domain', 'equalto', 'eessi.io') | + map(attribute='urls') | sum(start=[]) | join(';') }}" + else + CVMFS_SERVER_URL="{{ eessi_cvmfs_server_urls | selectattr('domain', 'equalto', 'eessi.io') | + map(attribute='urls') | sum(start=[]) | join(';') }}" fi dest: "{{ package_source_dir }}/etc/cvmfs/domain.d/{{ item.domain }}.conf"