diff --git a/.github/workflows/release-vsphere-template.yaml b/.github/workflows/release-vsphere-template.yaml index d52dd4e6e..86f0f006f 100644 --- a/.github/workflows/release-vsphere-template.yaml +++ b/.github/workflows/release-vsphere-template.yaml @@ -31,6 +31,10 @@ jobs: buildConfig: "basic" - os: "oracle 9.4" buildConfig: "fips" + - os: "oracle 9.4" + buildConfig: "offline" + - os: "oracle 9.4" + buildConfig: "offline-fips" - os: "flatcar" buildConfig: "basic" runs-on: @@ -55,7 +59,7 @@ jobs: with: username: ${{ secrets.NEXUS_USERNAME }} password: ${{ secrets.NEXUS_PASSWORD }} - + - name: Login to D2iQ's Mirror Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/vsphere-e2e.yaml b/.github/workflows/vsphere-e2e.yaml index d48d34fd8..7b848a36d 100644 --- a/.github/workflows/vsphere-e2e.yaml +++ b/.github/workflows/vsphere-e2e.yaml @@ -35,6 +35,10 @@ jobs: buildConfig: "basic" - os: "oracle 9.4" buildConfig: "fips" + - os: "oracle 9.4" + buildConfig: "offline" + - os: "oracle 9.4" + buildConfig: "offline-fips" - os: "flatcar" buildConfig: "basic" runs-on: @@ -58,7 +62,7 @@ jobs: with: username: ${{ secrets.NEXUS_USERNAME }} password: ${{ secrets.NEXUS_PASSWORD }} - + - name: Login to D2iQ's Mirror Registry uses: docker/login-action@v3 with: @@ -73,7 +77,7 @@ jobs: uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_BASTION_KEY_CONTENTS }} - + # configure git to access private repo hosting vsphere module mesosphere/vcenter-tools - name: Configure git to clone private registry from mesosphere org run: | diff --git a/ansible/roles/containerd/tasks/redhat.yaml b/ansible/roles/containerd/tasks/redhat.yaml index d6181ac69..f292bd9f9 100644 --- a/ansible/roles/containerd/tasks/redhat.yaml +++ b/ansible/roles/containerd/tasks/redhat.yaml @@ -26,12 +26,13 @@ retries: 5 delay: 6 - -- name: install tar rpm package +- name: install tar and container-selinux rpm package yum: name: "{{ item }}" state: present update_cache: true + enablerepo: "{{ 'offline' if offline_mode_enabled else '' }}" + disablerepo: "{{ '*' if offline_mode_enabled else '' }}" register: result until: result is success retries: 5 diff --git a/bundles/oracle9.4/bundle.sh.gotmpl b/bundles/oracle9.4/bundle.sh.gotmpl new file mode 100755 index 000000000..d0d81da25 --- /dev/null +++ b/bundles/oracle9.4/bundle.sh.gotmpl @@ -0,0 +1,35 @@ +#!/bin/bash +set -x +set -euo pipefail + +# When yum operates on multiple packages, it does not, by default, return an error if a subset +# of packages is not found. This makes yum return an error. +echo skip_missing_names_on_install=False >> /etc/yum.conf + +# Install required tools for repository creation +yum -y install epel-release gettext dnf-utils createrepo modulemd-tools yum-utils +yum clean all + +TMP_DIR="$(mktemp -d repodata-XXXX)" +chmod 777 -R "${TMP_DIR}" +cp packages.txt "${TMP_DIR}" +pushd "${TMP_DIR}" +#shellcheck disable=SC2046 +repoquery --archlist=x86_64,noarch --resolve --requires --recursive $(< packages.txt) | xargs -r yumdownloader --archlist=x86_64,noarch -x \*i686 +#shellcheck disable=SC2046 +yumdownloader --archlist=x86_64,noarch -x \*i686 $(< packages.txt) +rm packages.txt + +createrepo -v . +repo2module . --module-name offline +createrepo_mod . + +# Package the repository into a tarball with proper permissions +#shellcheck disable=SC1083,SC2035 +tar -czf {{ .OutputDirectory }}/{{ .KubernetesVersion }}_oraclelinux_9.4_x86_64{{ .FipsSuffix }}.tar.gz * +#shellcheck disable=SC1083,SC2035 +chmod 777 {{ .OutputDirectory }}/{{ .KubernetesVersion }}_oraclelinux_9.4_x86_64{{ .FipsSuffix }}.tar.gz + +# Return to the original directory and clean up +popd +rm -rf "${TMP_DIR}" diff --git a/bundles/oracle9.4/packages.txt.gotmpl b/bundles/oracle9.4/packages.txt.gotmpl new file mode 100644 index 000000000..761db4f51 --- /dev/null +++ b/bundles/oracle9.4/packages.txt.gotmpl @@ -0,0 +1,33 @@ +audit +ca-certificates +conntrack-tools +chrony +open-vm-tools +python3-pip +socat +sysstat +dnf-utils +yum-utils +yum-plugin-versionlock +NetworkManager +cloud-init +cloud-utils-growpart +container-selinux +{{ if .FetchKubernetesRPMs -}} +kubectl-{{ .KubernetesVersion }}-0 +kubelet-{{ .KubernetesVersion }}-0 +kubeadm-{{ .KubernetesVersion }}-0 +cri-tools +{{- end }} +conntrack +ebtables +ethtool +iproute +iptables +socat +gcc +libseccomp +nfs-utils +sssd-kcm +iptables-libs +libnftnl diff --git a/bundles/oracle9.4/repo-templates/kubernetes.repo.gotmpl b/bundles/oracle9.4/repo-templates/kubernetes.repo.gotmpl new file mode 100644 index 000000000..3a03d7ef1 --- /dev/null +++ b/bundles/oracle9.4/repo-templates/kubernetes.repo.gotmpl @@ -0,0 +1,5 @@ +[kubernetes] +name=Konvoy Kubernetes package repository +baseurl=https://packages.d2iq.com/konvoy/stable/linux/repos/el/kubernetes-v{{ .KubernetesVersion }}-{{ .RepoSuffix }}/x86_64 +gpgcheck=1 +gpgkey=https://packages.d2iq.com/konvoy/stable/linux/repos/d2iq-sign-authority-gpg-public-key diff --git a/bundles/redhat8.6/packages.txt.gotmpl b/bundles/redhat8.6/packages.txt.gotmpl index a071b6393..a9173b393 100644 --- a/bundles/redhat8.6/packages.txt.gotmpl +++ b/bundles/redhat8.6/packages.txt.gotmpl @@ -11,7 +11,6 @@ sysstat yum-utils yum-plugin-versionlock NetworkManager -yum-utils cloud-init cloud-utils-growpart container-selinux diff --git a/bundles/redhat8.8/packages.txt.gotmpl b/bundles/redhat8.8/packages.txt.gotmpl index 14ba4c127..4f1e8699d 100644 --- a/bundles/redhat8.8/packages.txt.gotmpl +++ b/bundles/redhat8.8/packages.txt.gotmpl @@ -11,7 +11,6 @@ sysstat yum-utils yum-plugin-versionlock NetworkManager -yum-utils cloud-init cloud-utils-growpart container-selinux diff --git a/bundles/rocky9.1/packages.txt.gotmpl b/bundles/rocky9.1/packages.txt.gotmpl index 843f9c7a4..72d74ca6f 100644 --- a/bundles/rocky9.1/packages.txt.gotmpl +++ b/bundles/rocky9.1/packages.txt.gotmpl @@ -10,7 +10,6 @@ sysstat yum-utils yum-plugin-versionlock NetworkManager -yum-utils cloud-init cloud-utils-growpart container-selinux diff --git a/cmd/konvoy-image-wrapper/cmd/create-package-bundle.go b/cmd/konvoy-image-wrapper/cmd/create-package-bundle.go index 76218b716..14190e07c 100644 --- a/cmd/konvoy-image-wrapper/cmd/create-package-bundle.go +++ b/cmd/konvoy-image-wrapper/cmd/create-package-bundle.go @@ -47,6 +47,10 @@ var osToConfig = map[string]OSConfig{ configDir: "bundles/ubuntu20.04", containerImage: "docker.io/library/ubuntu:20.04", }, + "oracle-9.4": { + configDir: "bundles/oracle9.4", + containerImage: "docker.io/library/oraclelinux:9", + }, } func getKubernetesVerisonFromAnsible() (string, error) { diff --git a/cmd/konvoy-image/cmd/create-package-bundle.go b/cmd/konvoy-image/cmd/create-package-bundle.go index d312aa823..289fd66a4 100644 --- a/cmd/konvoy-image/cmd/create-package-bundle.go +++ b/cmd/konvoy-image/cmd/create-package-bundle.go @@ -18,6 +18,7 @@ var ( "rocky-9.1", "ubuntu-18.04", "ubuntu-20.04", + "oracle-9.4", } ) diff --git a/docs/cli/konvoy-image_create-package-bundle.md b/docs/cli/konvoy-image_create-package-bundle.md index f04e18eab..ca25568fd 100644 --- a/docs/cli/konvoy-image_create-package-bundle.md +++ b/docs/cli/konvoy-image_create-package-bundle.md @@ -19,7 +19,7 @@ create-package-bundle --os redhat-8.4 --output-directory=artifacts --fips If the package bundle should include fips packages. -h, --help help for create-package-bundle --kubernetes-version string The version of kubernetes to download packages for. - --os string The target OS you wish to create a package bundle for. Must be one of [centos-7.9 redhat-7.9 redhat-8.4 redhat-8.6 redhat-8.8 rocky-9.1 ubuntu-18.04 ubuntu-20.04] + --os string The target OS you wish to create a package bundle for. Must be one of [centos-7.9 redhat-7.9 redhat-8.4 redhat-8.6 redhat-8.8 rocky-9.1 ubuntu-18.04 ubuntu-20.04 oracle-9.4] --output-directory string The directory to place the bundle in. (default "artifacts") ``` diff --git a/magefile.go b/magefile.go index b37f9f0ca..84552fc12 100644 --- a/magefile.go +++ b/magefile.go @@ -447,12 +447,15 @@ func fetchPipPackages(downloadDir string) error { func fetchContainerd(osName, downloadDir, containerdVersion string, fips bool) error { osInfo := strings.Split(osName, " ") - osDist := osInfo[0] // TODO: improve this osMajorMinor := strings.Split(osInfo[1], ".") osMajor := osMajorMinor[0] osMinor := osMajorMinor[1] + + osDist := osInfo[0] osDist = strings.Replace(osDist, "redhat", "rhel", 1) + osDist = strings.Replace(osDist, "oracle", "ol", 1) + containerdFile := fmt.Sprintf("containerd-%s-d2iq.1-%s-%s.%s-x86_64", containerdVersion, osDist, osMajor, osMinor) if fips { containerdFile += "_fips"