From 19fb43834e9bb2a89d56feebe0090875bee95c5d Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 17 Dec 2019 19:05:53 -0500 Subject: [PATCH 1/5] Rename rhcos to machine os Due to the image being renamed from ironic-rhcos-downloader to ironic-machine-os-downloader, this accounts for that change in dev-scripts. --- 04_setup_ironic.sh | 12 ++++++------ common.sh | 2 +- metal3-config.yaml | 2 +- rhcos.sh | 10 +++++----- run_ci.sh | 2 +- utils.sh | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index 2d9534356..68ca7808a 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -11,7 +11,7 @@ source ocp_install_env.sh # _LOCAL_IMAGE - where ENTRYNAME matches an uppercase version of the name in the release image # with "-" converted to "_" e.g. to use a custom ironic-inspector #export IRONIC_INSPECTOR_LOCAL_IMAGE=https://github.com/metal3-io/ironic-inspector-image -#export IRONIC_RHCOS_DOWNLOADER_LOCAL_IMAGE=https://github.com/openshift-metal3/rhcos-downloader +#export IRONIC_MACHINE_OS_DOWNLOADER_LOCAL_IMAGE=https://github.com/openshift-metal3/ironic-rhcos-downloader #export BAREMETAL_OPERATOR_LOCAL_IMAGE=192.168.111.1:5000/localimages/bmo:latest rm -f assets/templates/99_local-registry.yaml $OPENSHIFT_INSTALL_PATH/data/data/bootstrap/baremetal/files/etc/containers/registries.conf @@ -70,14 +70,14 @@ fi sudo podman pod create -n ironic-pod # Pull the rhcos-downloder image to use from the release, this gets change -# to use IRONIC_RHCOS_DOWNLOADER_LOCAL_IMAGE if present -IRONIC_RHCOS_DOWNLOADER_IMAGE=$(oc adm release info --registry-config $REGISTRY_AUTH_FILE $OPENSHIFT_RELEASE_IMAGE --image-for=ironic-rhcos-downloader) +# to use IRONIC_MACHINE_OS_DOWNLOADER_LOCAL_IMAGE if present +IRONIC_MACHINE_OS_DOWNLOADER_IMAGE=$(oc adm release info --registry-config $REGISTRY_AUTH_FILE $OPENSHIFT_RELEASE_IMAGE --image-for=ironic-machine-os-downloader) IRONIC_IMAGE=${IRONIC_LOCAL_IMAGE:-$IRONIC_IMAGE} IRONIC_IPA_DOWNLOADER_IMAGE=${IRONIC_IPA_DOWNLOADER_LOCAL_IMAGE:-$IRONIC_IPA_DOWNLOADER_IMAGE} -IRONIC_RHCOS_DOWNLOADER_IMAGE=${IRONIC_RHCOS_DOWNLOADER_LOCAL_IMAGE:-$IRONIC_RHCOS_DOWNLOADER_IMAGE} +IRONIC_MACHINE_OS_DOWNLOADER_IMAGE=${IRONIC_MACHINE_OS_DOWNLOADER_LOCAL_IMAGE:-$IRONIC_MACHINE_OS_DOWNLOADER_IMAGE} -for IMAGE in ${IRONIC_IMAGE} ${IRONIC_IPA_DOWNLOADER_IMAGE} ${IRONIC_RHCOS_DOWNLOADER_IMAGE} ${VBMC_IMAGE} ${SUSHY_TOOLS_IMAGE} ; do +for IMAGE in ${IRONIC_IMAGE} ${IRONIC_IPA_DOWNLOADER_IMAGE} ${IRONIC_MACHINE_OS_DOWNLOADER_IMAGE} ${VBMC_IMAGE} ${SUSHY_TOOLS_IMAGE} ; do sudo -E podman pull $([[ $IMAGE =~ $LOCAL_REGISTRY_ADDRESS.* ]] && echo "--tls-verify=false" ) $IMAGE done @@ -91,7 +91,7 @@ sudo podman run -d --net host --privileged --name ipa-downloader --pod ironic-po -v $IRONIC_DATA_DIR:/shared ${IRONIC_IPA_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh sudo podman run -d --net host --privileged --name coreos-downloader --pod ironic-pod \ - -v $IRONIC_DATA_DIR:/shared ${IRONIC_RHCOS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $RHCOS_IMAGE_URL + -v $IRONIC_DATA_DIR:/shared ${IRONIC_MACHINE_OS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $MACHINE_OS_IMAGE_URL if [ "$NODES_PLATFORM" = "libvirt" ]; then sudo podman run -d --net host --privileged --name vbmc --pod ironic-pod \ diff --git a/common.sh b/common.sh index e8de00a8e..1b9336287 100644 --- a/common.sh +++ b/common.sh @@ -68,7 +68,7 @@ if [ -z "$KNI_INSTALL_FROM_GIT" ]; then export OPENSHIFT_INSTALLER=${OPENSHIFT_INSTALLER:-$OPENSHIFT_INSTALL_PATH/bin/openshift-install} # This is an URI so we can use curl for either the file on GitHub, or locally - export OPENSHIFT_INSTALLER_RHCOS=${OPENSHIFT_INSTALLER_RHCOS:-file:///$OPENSHIFT_INSTALL_PATH/data/data/rhcos.json} + export OPENSHIFT_INSTALLER_MACHINE_OS=${OPENSHIFT_INSTALLER_MACHINE_OS:-file:///$OPENSHIFT_INSTALL_PATH/data/data/rhcos.json} # The installer defaults to origin/CI releases, e.g registry.svc.ci.openshift.org/origin/release:4.4 # Which currently don't work for us ref diff --git a/metal3-config.yaml b/metal3-config.yaml index 2509b0c49..bb3dc204e 100644 --- a/metal3-config.yaml +++ b/metal3-config.yaml @@ -13,4 +13,4 @@ data: ironic_endpoint: "http://172.22.0.3:6385/v1/" ironic_inspector_endpoint: "http://172.22.0.3:5050/v1/" cache_url: "http://192.168.111.1/images" - rhcos_image_url: "__RHCOS_IMAGE_URL__" + rhcos_image_url: "__MACHINE_OS_IMAGE_URL__" diff --git a/rhcos.sh b/rhcos.sh index 0dabb9449..0fa97af04 100644 --- a/rhcos.sh +++ b/rhcos.sh @@ -2,10 +2,10 @@ OPENSHIFT_INSTALL_COMMIT=$($OPENSHIFT_INSTALLER version | grep commit | cut -d' ' -f4) # Get the rhcos.json for that commit -OPENSHIFT_INSTALLER_RHCOS=${OPENSHIFT_INSTALLER_RHCOS:-https://raw.githubusercontent.com/openshift/installer/$OPENSHIFT_INSTALL_COMMIT/data/data/rhcos.json} +OPENSHIFT_INSTALLER_MACHINE_OS=${OPENSHIFT_INSTALLER_MACHINE_OS:-https://raw.githubusercontent.com/openshift/installer/$OPENSHIFT_INSTALL_COMMIT/data/data/rhcos.json} # Get the rhcos.json for that commit, and find the baseURI and openstack image path -RHCOS_IMAGE_JSON=$(curl "${OPENSHIFT_INSTALLER_RHCOS}") -export RHCOS_INSTALLER_IMAGE_URL=$(echo "${RHCOS_IMAGE_JSON}" | jq -r '.baseURI + .images.openstack.path') -export RHCOS_IMAGE_URL=${RHCOS_IMAGE_URL:-${RHCOS_INSTALLER_IMAGE_URL}} -export RHCOS_IMAGE_FILENAME_LATEST="rhcos-ootpa-latest.qcow2" +MACHINE_OS_IMAGE_JSON=$(curl "${OPENSHIFT_INSTALLER_MACHINE_OS}") +export MACHINE_OS_INSTALLER_IMAGE_URL=$(echo "${MACHINE_OS_IMAGE_JSON}" | jq -r '.baseURI + .images.openstack.path') +export MACHINE_OS_IMAGE_URL=${MACHINE_OS_IMAGE_URL:-${MACHINE_OS_INSTALLER_IMAGE_URL}} +export MACHINE_OS_IMAGE_FILENAME_LATEST="rhcos-ootpa-latest.qcow2" diff --git a/run_ci.sh b/run_ci.sh index ca810acd9..965768bc2 100755 --- a/run_ci.sh +++ b/run_ci.sh @@ -130,7 +130,7 @@ sudo chown -R notstack /opt/dev-scripts/ironic /opt/data/installer-cache /home/n sudo sed -i -e '/keepcache=0/d' /etc/yum.conf sudo mount -o bind /opt/data/yumcache /var/cache/yum -# Mount the openshift-installer cache directory so we don't download a RHCOS image for each run +# Mount the openshift-installer cache directory so we don't download a Machine OS image for each run sudo mount -o bind /opt/data/installer-cache /home/notstack/.cache/openshift-install/libvirt # Install terraform diff --git a/utils.sh b/utils.sh index 9a52ace49..42ae8f186 100644 --- a/utils.sh +++ b/utils.sh @@ -190,7 +190,7 @@ function bmo_config_map { mkdir -p ocp/deploy cp $SCRIPTDIR/metal3-config.yaml ocp/deploy - sed -i "s#__RHCOS_IMAGE_URL__#${RHCOS_IMAGE_URL}#" ocp/deploy/metal3-config.yaml + sed -i "s#__MACHINE_OS_IMAGE_URL__#${MACHINE_OS_IMAGE_URL}#" ocp/deploy/metal3-config.yaml sed -i "s#provisioning_interface: \"ens3\"#provisioning_interface: \"${CLUSTER_PRO_IF}\"#" ocp/deploy/metal3-config.yaml sed -i "s#cache_url: \"http://192.168.111.1/images\"#cache_url: \"http://${BAREMETAL_IP}/images\"#" ocp/deploy/metal3-config.yaml From e1ff33db22bec6efa1dccbd394d7c3531e42fdea Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 17 Dec 2019 19:12:46 -0500 Subject: [PATCH 2/5] Temporarily apply installer patch to verify --- ocp_install_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocp_install_env.sh b/ocp_install_env.sh index e21493dad..3e2df964b 100644 --- a/ocp_install_env.sh +++ b/ocp_install_env.sh @@ -50,7 +50,7 @@ function extract_installer() { function clone_installer() { # Clone repo, if not already present if [[ ! -d $OPENSHIFT_INSTALL_PATH ]]; then - sync_repo_and_patch go/src/github.com/openshift/installer https://github.com/openshift/installer.git + sync_repo_and_patch go/src/github.com/openshift/installer https://github.com/openshift/installer.git https://patch-diff.githubusercontent.com/raw/openshift/installer/pull/2837.patch fi } From 40cda3c4422cdfb3196e912f9ab2c751f52a70e7 Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 17 Dec 2019 19:25:34 -0500 Subject: [PATCH 3/5] Use git installer --- run_ci.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run_ci.sh b/run_ci.sh index 965768bc2..d60d7da1b 100755 --- a/run_ci.sh +++ b/run_ci.sh @@ -1,6 +1,9 @@ #!/bin/bash set -ex +# temporary +export KNI_INSTALL_FROM_GIT=true + # grabs files and puts them into $LOGDIR to be saved as jenkins artifacts function getlogs(){ LOGDIR=/home/notstack/dev-scripts/logs From 43de3c4f6e0c7c7666f694dd07f41f21cf52b95a Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 17 Dec 2019 19:29:30 -0500 Subject: [PATCH 4/5] Use different installer patch --- ocp_install_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocp_install_env.sh b/ocp_install_env.sh index 3e2df964b..735957bf4 100644 --- a/ocp_install_env.sh +++ b/ocp_install_env.sh @@ -50,7 +50,7 @@ function extract_installer() { function clone_installer() { # Clone repo, if not already present if [[ ! -d $OPENSHIFT_INSTALL_PATH ]]; then - sync_repo_and_patch go/src/github.com/openshift/installer https://github.com/openshift/installer.git https://patch-diff.githubusercontent.com/raw/openshift/installer/pull/2837.patch + sync_repo_and_patch go/src/github.com/openshift/installer https://github.com/openshift/installer.git https://patch-diff.githubusercontent.com/raw/openshift/installer/pull/2821.patch fi } From e976a2f3a894bf74fee2ccbfb5a94372c628c97a Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 17 Dec 2019 19:32:52 -0500 Subject: [PATCH 5/5] Rename containers --- 04_setup_ironic.sh | 6 +++--- run_ci.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index 68ca7808a..d7b782402 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -56,7 +56,7 @@ if [ -f assets/templates/99_local-registry.yaml ] ; then fi rm -f $DOCKERFILE -for name in ironic ironic-api ironic-conductor ironic-inspector dnsmasq httpd mariadb ipa-downloader coreos-downloader vbmc sushy-tools; do +for name in ironic ironic-api ironic-conductor ironic-inspector dnsmasq httpd mariadb ipa-downloader machine-os-downloader vbmc sushy-tools; do sudo podman ps | grep -w "$name$" && sudo podman kill $name sudo podman ps --all | grep -w "$name$" && sudo podman rm $name -f done @@ -90,7 +90,7 @@ sudo podman run -d --net host --privileged --name httpd --pod ironic-pod \ sudo podman run -d --net host --privileged --name ipa-downloader --pod ironic-pod \ -v $IRONIC_DATA_DIR:/shared ${IRONIC_IPA_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh -sudo podman run -d --net host --privileged --name coreos-downloader --pod ironic-pod \ +sudo podman run -d --net host --privileged --name machine-os-downloader --pod ironic-pod \ -v $IRONIC_DATA_DIR:/shared ${IRONIC_MACHINE_OS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $MACHINE_OS_IMAGE_URL if [ "$NODES_PLATFORM" = "libvirt" ]; then @@ -106,7 +106,7 @@ fi # Wait for the downloader containers to finish, if they are updating an existing cache # the checks below will pass because old data exists -sudo podman wait -i 1000 ipa-downloader coreos-downloader +sudo podman wait -i 1000 ipa-downloader machine-os-downloader # Wait for images to be downloaded/ready while ! curl --fail http://localhost/images/rhcos-ootpa-latest.qcow2.md5sum ; do sleep 1 ; done diff --git a/run_ci.sh b/run_ci.sh index d60d7da1b..4d22967ac 100755 --- a/run_ci.sh +++ b/run_ci.sh @@ -11,7 +11,7 @@ function getlogs(){ # Grab the host journal sudo journalctl > $LOGDIR/bootstrap-host-system.journal - for c in httpd coreos-downloader ipa-downloader ; do + for c in httpd machine-os-downloader ipa-downloader ; do sudo podman logs $c > $LOGDIR/$c.log || true done