From 934a65bc3415a49a8b41ea59258e0a84a49e004e Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Tue, 5 Jul 2022 10:05:16 +0800 Subject: [PATCH] Upgrade openEuler to 22.03 LTS openEuler 20.03-LTS-SP2 was out of date in May 2022. 22.03 LTS is the newest LTS version. It was release in March 2022 and will be maintained for 2 years. This patch upgrades the LTS version. It'll be used in Devstack, Kolla-ansible and so on in CI jobs. This patch also enables the YUM mirror to speed up the package download. Change-Id: Iba38570d96374226b924db3aca305f7571643823 --- .zuul.d/jobs.yaml | 4 +-- .../elements/openeuler-minimal/README.rst | 9 ++++-- .../10-openeuler-distro-name.bash | 2 +- .../pre-install.d/00-setup-mirror.bash | 5 ++++ .../root.d/00-00-generate-repo | 5 ++-- .../20.03-LTS-SP2-build-succeeds/README.rst | 1 - .../environment.d/10-set-distro.bash | 1 - .../22.03-LTS-build-succeeds/README.rst | 1 + .../element-deps | 0 .../environment.d/10-set-distro.bash | 1 + .../test-output-formats | 0 doc/source/user_guide/supported_distros.rst | 4 +-- ...e_openeuler_to_22.03-d67d9bb3c5c97749.yaml | 4 +++ roles/dib-setup-gate-mirrors/tasks/main.yaml | 10 +++---- .../20.03-LTS-SP2/openEuler.repo.j2 | 29 ------------------- .../22.03-LTS/openEuler.repo.j2 | 29 +++++++++++++++++++ 16 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror.bash delete mode 100644 diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/README.rst delete mode 100644 diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/environment.d/10-set-distro.bash create mode 100644 diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst rename diskimage_builder/elements/openeuler-minimal/test-elements/{20.03-LTS-SP2-build-succeeds => 22.03-LTS-build-succeeds}/element-deps (100%) create mode 100644 diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash rename diskimage_builder/elements/openeuler-minimal/test-elements/{20.03-LTS-SP2-build-succeeds => 22.03-LTS-build-succeeds}/test-output-formats (100%) create mode 100644 releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml delete mode 100644 roles/dib-setup-gate-mirrors/templates/openeuler-minimal/20.03-LTS-SP2/openEuler.repo.j2 create mode 100644 roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 29bf980b..58dad618 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -22,7 +22,7 @@ vars: dib_functests: - containerfile/jammy-build-succeeds - - openeuler-minimal/20.03-LTS-SP2-build-succeeds + - openeuler-minimal/22.03-LTS-build-succeeds # Image based tests - centos/8-stream-build-succeeds - centos/9-stream-build-succeeds @@ -57,7 +57,7 @@ dib_functests: - centos-minimal/8-stream-aarch64-build-succeeds - centos-minimal/9-stream-aarch64-build-succeeds - - openeuler-minimal/20.03-LTS-SP2-build-succeeds + - openeuler-minimal/22.03-LTS-build-succeeds # # Build and boot functional tests diff --git a/diskimage_builder/elements/openeuler-minimal/README.rst b/diskimage_builder/elements/openeuler-minimal/README.rst index 9ab49ad2..78053217 100644 --- a/diskimage_builder/elements/openeuler-minimal/README.rst +++ b/diskimage_builder/elements/openeuler-minimal/README.rst @@ -7,6 +7,9 @@ Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora, CentOS or openEuler. -Set ``DIB_RELEASE`` to ``20.03-LTS-SP2``,``21.03`` or other release number -to explicitly select the release. ``DIB_RELEASE`` defaults the latest LTS -release. +Set ``DIB_RELEASE`` to ``22.03-LTS`` other release number to explicitly select +the release. ``DIB_RELEASE`` defaults the latest LTS release. + +Set ``DIB_DISTRIBUTION_MIRROR`` to the mirror URL use a openEuler Yum mirror. +This URL should point to the directory containing the ``DIB_RELEASE`` +directories. diff --git a/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash b/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash index 4f51dbcc..4804dc4c 100644 --- a/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash +++ b/diskimage_builder/elements/openeuler-minimal/environment.d/10-openeuler-distro-name.bash @@ -1,3 +1,3 @@ export DISTRO_NAME=openeuler -export DIB_RELEASE=${DIB_RELEASE:-20.03-LTS-SP2} +export DIB_RELEASE=${DIB_RELEASE:-22.03-LTS} export EFI_BOOT_DIR="EFI/openEuler" diff --git a/diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror.bash b/diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror.bash new file mode 100644 index 00000000..312f0345 --- /dev/null +++ b/diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror.bash @@ -0,0 +1,5 @@ +if [ -n "${DIB_DISTRIBUTION_MIRROR:-}" ]; then + # Only set the mirror for OS, everything, EPOL and update repositories, + # The others (debuginfo and source) aren't mirrored since they do not exist on all mirrors + sed -i "/\(debuginfo\|source\)/! {s#http://repo.openeuler.org#$DIB_DISTRIBUTION_MIRROR#g}" $TARGET_ROOT/etc/yum.repos.d/openEuler.repo +fi diff --git a/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo b/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo index 9ea55cf6..0615441a 100755 --- a/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo +++ b/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo @@ -11,17 +11,18 @@ set -o pipefail yum_repos_dir="$(dirname $0)/../yum.repos.d" mkdir -p $yum_repos_dir +REPO_URL=${DIB_DISTRIBUTION_MIRROR:-http://repo.openeuler.org} repo_file=$(mktemp) cat > $repo_file << EOF [OS] name=openEuler-$DIB_RELEASE - OS -baseurl=http://repo.openeuler.org/openEuler-$DIB_RELEASE/OS/\$basearch/ +baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/OS/\$basearch/ enabled=1 gpgcheck=0 [update] name=openEuler-$DIB_RELEASE - update -baseurl=http://repo.openeuler.org/openEuler-$DIB_RELEASE/update/\$basearch/ +baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/update/\$basearch/ enabled=1 gpgcheck=0 EOF diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/README.rst b/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/README.rst deleted file mode 100644 index e504e4a4..00000000 --- a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/README.rst +++ /dev/null @@ -1 +0,0 @@ -openEuler 20.03-LTS-SP2 test diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/environment.d/10-set-distro.bash deleted file mode 100644 index 50ea59d0..00000000 --- a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/environment.d/10-set-distro.bash +++ /dev/null @@ -1 +0,0 @@ -export DIB_RELEASE='20.03-LTS-SP2' diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst new file mode 100644 index 00000000..f9696478 --- /dev/null +++ b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/README.rst @@ -0,0 +1 @@ +openEuler 22.03-LTS test diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/element-deps b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/element-deps similarity index 100% rename from diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/element-deps rename to diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/element-deps diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 00000000..4dd7ce40 --- /dev/null +++ b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE='22.03-LTS' diff --git a/diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/test-output-formats b/diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/test-output-formats similarity index 100% rename from diskimage_builder/elements/openeuler-minimal/test-elements/20.03-LTS-SP2-build-succeeds/test-output-formats rename to diskimage_builder/elements/openeuler-minimal/test-elements/22.03-LTS-build-succeeds/test-output-formats diff --git a/doc/source/user_guide/supported_distros.rst b/doc/source/user_guide/supported_distros.rst index c50878c9..f28e68d2 100644 --- a/doc/source/user_guide/supported_distros.rst +++ b/doc/source/user_guide/supported_distros.rst @@ -101,7 +101,7 @@ We run functional (build-only) tests on the following elements and versions: * ``containerfile``: Ubuntu Focal -* ``openeuler-minimal``: 20.03-LTS-SP2 +* ``openeuler-minimal``: 22.03-LTS * ``centos`` : (image-based build) 8-stream and 9-stream * ``fedora`` : (image-based build) latest * ``opensuse`` : 15.3 @@ -112,7 +112,7 @@ For ARM64, we also run functional tests on * ``ubuntu-minimal`` : Bionic and Focal * ``debian-minimal`` : Bullseye * ``centos-minimal`` : 8-stream and 9-stream -* ``openeuler-minimal``: 20.03-LTS-SP2 +* ``openeuler-minimal``: 22.03-LTS For additional details, see the ``README`` file of the relevant elements. diff --git a/releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml b/releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml new file mode 100644 index 00000000..9469b4af --- /dev/null +++ b/releasenotes/notes/upgrade_openeuler_to_22.03-d67d9bb3c5c97749.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Upgrade openEuler element from 20.03-LTS-SP2 to 22.03-LTS. diff --git a/roles/dib-setup-gate-mirrors/tasks/main.yaml b/roles/dib-setup-gate-mirrors/tasks/main.yaml index 6ce85ea4..2b5e37b1 100644 --- a/roles/dib-setup-gate-mirrors/tasks/main.yaml +++ b/roles/dib-setup-gate-mirrors/tasks/main.yaml @@ -74,17 +74,17 @@ - [ 'default' ] - [ 'fedora.repo', 'fedora-updates.repo' ] -- name: Create openeuler-minimal 20.03-LTS-SP2 directory +- name: Create openeuler-minimal 22.03-LTS directory file: - path: "{{ dib_gate_mirror_repos }}/openeuler-minimal/20.03-LTS-SP2/yum.repos.d" + path: "{{ dib_gate_mirror_repos }}/openeuler-minimal/22.03-LTS/yum.repos.d" state: directory mode: 0775 recurse: yes -- name: Install openeuler-minimal 20.03-LTS-SP2 repo files +- name: Install openeuler-minimal 22.03-LTS repo files template: - dest: "{{ dib_gate_mirror_repos }}/openeuler-minimal/20.03-LTS-SP2/yum.repos.d/dib-mirror-{{ item }}" + dest: "{{ dib_gate_mirror_repos }}/openeuler-minimal/22.03-LTS/yum.repos.d/dib-mirror-{{ item }}" mode: 0644 - src: "openeuler-minimal/20.03-LTS-SP2/{{ item }}.j2" + src: "openeuler-minimal/22.03-LTS/{{ item }}.j2" with_items: - openEuler.repo diff --git a/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/20.03-LTS-SP2/openEuler.repo.j2 b/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/20.03-LTS-SP2/openEuler.repo.j2 deleted file mode 100644 index c209a533..00000000 --- a/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/20.03-LTS-SP2/openEuler.repo.j2 +++ /dev/null @@ -1,29 +0,0 @@ -[OS] -name=OS -baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-20.03-LTS-SP2/OS/$basearch/ -enabled=1 -gpgcheck=0 - -[everything] -name=everything -baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-20.03-LTS-SP2/everything/$basearch/ -enabled=1 -gpgcheck=0 - -[EPOL] -name=EPOL -baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-20.03-LTS-SP2/EPOL/main/$basearch/ -enabled=1 -gpgcheck=0 - -[EPOL-UPDATE] -name=EPOL-UPDATE -baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-20.03-LTS-SP2/EPOL/update/main/$basearch/ -enabled=1 -gpgcheck=0 - -[update] -name=update -baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-20.03-LTS-SP2/update/$basearch/ -enabled=1 -gpgcheck=0 diff --git a/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 b/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 new file mode 100644 index 00000000..5eaf8505 --- /dev/null +++ b/roles/dib-setup-gate-mirrors/templates/openeuler-minimal/22.03-LTS/openEuler.repo.j2 @@ -0,0 +1,29 @@ +[OS] +name=OS +baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/OS/$basearch/ +enabled=1 +gpgcheck=0 + +[everything] +name=everything +baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/everything/$basearch/ +enabled=1 +gpgcheck=0 + +[EPOL] +name=EPOL +baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/EPOL/main/$basearch/ +enabled=1 +gpgcheck=0 + +[EPOL-UPDATE] +name=EPOL-UPDATE +baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/EPOL/update/main/$basearch/ +enabled=1 +gpgcheck=0 + +[update] +name=update +baseurl=http://{{ mirror_fqdn }}/openeuler/openEuler-22.03-LTS/update/$basearch/ +enabled=1 +gpgcheck=0