Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions 04_setup_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source ocp_install_env.sh
# <ENTRYNAME>_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

Expand Down Expand Up @@ -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
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's change this also

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, but lets fix that as a follow-up so we can unblock CI

# 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

Expand All @@ -90,8 +90,8 @@ 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 \
-v $IRONIC_DATA_DIR:/shared ${IRONIC_RHCOS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $RHCOS_IMAGE_URL
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
sudo podman run -d --net host --privileged --name vbmc --pod ironic-pod \
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion metal3-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
2 changes: 1 addition & 1 deletion ocp_install_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/2821.patch
fi
}

Expand Down
10 changes: 5 additions & 5 deletions rhcos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 5 additions & 2 deletions run_ci.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/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

# 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

Expand Down Expand Up @@ -130,7 +133,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
Expand Down
2 changes: 1 addition & 1 deletion utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down