diff --git a/01_install_requirements.sh b/01_install_requirements.sh index 18ea7999f..ff3d61254 100755 --- a/01_install_requirements.sh +++ b/01_install_requirements.sh @@ -69,7 +69,6 @@ sudo yum -y install \ ansible \ bind-utils \ jq \ - libguestfs-tools \ libvirt \ libvirt-devel \ libvirt-daemon-kvm \ diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index ff8d0ef6d..b1cf9b72a 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -5,13 +5,10 @@ set -ex source logging.sh source common.sh -# Get the various images -source get_images.sh - # Either pull or build the ironic images # To build the IRONIC image set # IRONIC_IMAGE=https://github.com/metalkube/metalkube-ironic -for IMAGE_VAR in IRONIC_IMAGE IRONIC_INSPECTOR_IMAGE ; do +for IMAGE_VAR in IRONIC_IMAGE IRONIC_INSPECTOR_IMAGE IPA_DOWNLOADER_IMAGE COREOS_DOWNLOADER_IMAGE ; do IMAGE=${!IMAGE_VAR} # Is it a git repo? if [[ "$IMAGE" =~ "://" ]] ; then @@ -27,24 +24,7 @@ for IMAGE_VAR in IRONIC_IMAGE IRONIC_INSPECTOR_IMAGE ; do fi done -pushd $IRONIC_DATA_DIR/html/images - -# Compress the qcow2 image so that it can be downloaded into -# a smaller /tmp by IPA -if [ ! -e "$RHCOS_IMAGE_FILENAME_COMPRESSED" ] ; then - qemu-img convert -O qcow2 -c "$RHCOS_IMAGE_FILENAME_OPENSTACK" "$RHCOS_IMAGE_FILENAME_COMPRESSED" -fi - -if [ ! -e "${RHCOS_IMAGE_FILENAME_COMPRESSED}.md5sum" -o \ - "$RHCOS_IMAGE_FILENAME_COMPRESSED" -nt "$RHCOS_IMAGE_FILENAME_COMPRESSED.md5sum" ] ; then - md5sum "$RHCOS_IMAGE_FILENAME_COMPRESSED" | cut -f 1 -d " " > "$RHCOS_IMAGE_FILENAME_COMPRESSED.md5sum" -fi - -ln -sf "$RHCOS_IMAGE_FILENAME_COMPRESSED" "$RHCOS_IMAGE_FILENAME_LATEST" -ln -sf "$RHCOS_IMAGE_FILENAME_COMPRESSED.md5sum" "$RHCOS_IMAGE_FILENAME_LATEST.md5sum" -popd - -for name in ironic ironic-inspector dnsmasq httpd mariadb; do +for name in ironic ironic-inspector dnsmasq httpd mariadb ipa-downloader coreos-downloader; do sudo podman ps | grep -w "$name$" && sudo podman kill $name sudo podman ps --all | grep -w "$name$" && sudo podman rm $name -f done @@ -75,6 +55,12 @@ sudo podman run -d --net host --privileged --name ironic --pod ironic-pod \ --env MARIADB_PASSWORD=$mariadb_password \ -v $IRONIC_DATA_DIR:/shared ${IRONIC_IMAGE} +sudo podman run -d --net host --privileged --name ipa-downloader --pod ironic-pod \ + -v $IRONIC_DATA_DIR:/shared ${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 ${COREOS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $RHCOS_IMAGE_URL + # Start Ironic Inspector sudo podman run -d --net host --privileged --name ironic-inspector \ --pod ironic-pod -v $IRONIC_DATA_DIR:/shared "${IRONIC_INSPECTOR_IMAGE}" diff --git a/common.sh b/common.sh index 915dbaa05..2fd759a9f 100644 --- a/common.sh +++ b/common.sh @@ -49,19 +49,13 @@ export VM_EXTRADISKS=${VM_EXTRADISKS:-"false"} export RHCOS_INSTALLER_IMAGE_URL="https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190508.1/" export RHCOS_IMAGE_URL=${RHCOS_IMAGE_URL:-${RHCOS_INSTALLER_IMAGE_URL}} - -export RHCOS_IMAGE_FILENAME_OPENSTACK_GZ="$(curl ${RHCOS_IMAGE_URL}/meta.json | jq -r '.images.openstack.path')" -export RHCOS_IMAGE_NAME=$(echo $RHCOS_IMAGE_FILENAME_OPENSTACK_GZ | sed -e 's/-openstack.*//') -# FIXME(shardy) - we need to download the -openstack as its needed -# for the baremetal nodes so we get config drive support, -# or perhaps a completely new image? -export RHCOS_IMAGE_FILENAME_OPENSTACK="${RHCOS_IMAGE_NAME}-openstack.qcow2" -export RHCOS_IMAGE_FILENAME_COMPRESSED="${RHCOS_IMAGE_NAME}-compressed.qcow2" export RHCOS_IMAGE_FILENAME_LATEST="rhcos-ootpa-latest.qcow2" # Ironic vars export IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic"} export IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"quay.io/metal3-io/ironic-inspector"} +export IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"quay.io/higginsd/resource-downloader-ipa"} +export COREOS_DOWNLOADER_IMAGE=${COREOS_DOWNLOADER_IMAGE:-"quay.io/higginsd/resource-downloader-coreos"} export IRONIC_DATA_DIR="$WORKING_DIR/ironic" export KUBECONFIG="${SCRIPTDIR}/ocp/auth/kubeconfig" diff --git a/get_images.sh b/get_images.sh deleted file mode 100755 index ed35a4d4e..000000000 --- a/get_images.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -xe - -source common.sh - -mkdir -p "$IRONIC_DATA_DIR/html/images" -pushd "$IRONIC_DATA_DIR/html/images" -if [ ! -f "${RHCOS_IMAGE_FILENAME_OPENSTACK}" ]; then - curl --insecure --compressed -L -o "${RHCOS_IMAGE_FILENAME_OPENSTACK}" "${RHCOS_IMAGE_URL}/${RHCOS_IMAGE_FILENAME_OPENSTACK}" -fi - -if [ ! -f ironic-python-agent.initramfs ]; then - curl --insecure --compressed -L https://images.rdoproject.org/master/rdo_trunk/current-tripleo-rdo/ironic-python-agent.tar | tar -xf - -fi - -popd