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
15 changes: 12 additions & 3 deletions 01_install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -z "${METAL3_DEV_ENV}" ]; then
# TODO -- come up with a plan for continuously updating this
# Note we only do this in the case where METAL3_DEV_ENV is
# unset, to enable developer testing of local checkouts
git reset ee1b2fec44e22700c8d250d5e0e371e3fd0aba17 --hard
git reset 37c2f30b84776841f24a59ed23c040fcb3b4aaa2 --hard
popd
fi

Expand All @@ -41,10 +41,10 @@ elif [[ $DISTRO == "rhel8" ]]; then
# Enable EPEL for python3-passlib and python3-bcrypt required by metal3-dev-env
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Comment thread
bn222 marked this conversation as resolved.
if sudo subscription-manager repos --list-enabled 2>&1 | grep "ansible-2-for-rhel-8-x86_64-rpms"; then
if sudo subscription-manager repos --list-enabled 2>&1 | grep "ansible-2-for-rhel-8-$(uname -m)-rpms"; then
# The packaged 2.x ansible is too old for compatibility with metal3-dev-env
sudo dnf erase -y ansible
sudo subscription-manager repos --disable=ansible-2-for-rhel-8-x86_64-rpms
sudo subscription-manager repos --disable=ansible-2-for-rhel-8-$(uname -m)-rpms
fi
fi

Expand All @@ -60,6 +60,14 @@ sudo pip3 install ansible=="${ANSIBLE_VERSION}"
# and lxml for the pyxpath script
sudo pip3 install netaddr lxml


GOARCH=$(uname -m)
if [[ $GOARCH == "aarch64" ]]; then
GOARCH="arm64"
elif [[ $GOARCH == "x86_64" ]]; then
GOARCH="amd64"
fi

Comment thread
bn222 marked this conversation as resolved.
pushd ${METAL3_DEV_ENV_PATH}
ansible-galaxy install -r vm-setup/requirements.yml
# NOTE(elfosardo): ansible.netcommon v2.6.0 broke compatibility with filters
Expand All @@ -73,6 +81,7 @@ ANSIBLE_FORCE_COLOR=true ansible-playbook \
-e "working_dir=$WORKING_DIR" \
-e "virthost=$HOSTNAME" \
-e "go_version=1.17.1" \
-e "GOARCH=$GOARCH" \
-i vm-setup/inventory.ini \
-b -vvv vm-setup/install-package-playbook.yml
popd
Expand Down
8 changes: 8 additions & 0 deletions 02_configure_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ sudo systemctl enable --now firewalld
# access.
configure_chronyd

export VNC_CONSOLE=true
if [[ $(uname -m) == "aarch64" ]]; then
VNC_CONSOLE=false
fi


ansible-playbook \
-e @vm_setup_vars.yml \
-e "ironic_prefix=${CLUSTER_NAME}_" \
Expand All @@ -93,6 +99,8 @@ ansible-playbook \
-e "virtualbmc_base_port=$VBMC_BASE_PORT" \
-e "master_hostname_format=$MASTER_HOSTNAME_FORMAT" \
-e "worker_hostname_format=$WORKER_HOSTNAME_FORMAT" \
-e "libvirt_arch=$(uname -m)" \
-e "enable_vnc_console=$VNC_CONSOLE" \
-i ${VM_SETUP_PATH}/inventory.ini \
-b -vvv ${VM_SETUP_PATH}/setup-playbook.yml

Expand Down
6 changes: 3 additions & 3 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export REGISTRY_CRT=registry.2.crt
# Set this variable to build the installer from source
export KNI_INSTALL_FROM_GIT=${KNI_INSTALL_FROM_GIT:-}

export OPENSHIFT_CLIENT_TOOLS_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz
export OPENSHIFT_CLIENT_TOOLS_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz

export OPENSHIFT_RELEASE_TYPE=${OPENSHIFT_RELEASE_TYPE:-nightly}
export OPENSHIFT_RELEASE_STREAM=${OPENSHIFT_RELEASE_STREAM:-4.11}
Expand Down Expand Up @@ -137,7 +137,7 @@ if [ -z "${OPENSHIFT_RELEASE_IMAGE:-}" ]; then
fi
fi
export OPENSHIFT_RELEASE_IMAGE="${OPENSHIFT_RELEASE_IMAGE:-$LATEST_CI_IMAGE}"
export OPENSHIFT_INSTALL_PATH="$GOPATH/src/github.com/openshift/installer"
export OPENSHIFT_INSTALL_PATH="${OPENSHIFT_INSTALL_PATH:-$GOPATH/src/github.com/openshift/installer}"

# Override the image to use for installing hive
export HIVE_DEPLOY_IMAGE="${HIVE_DEPLOY_IMAGE:-registry.ci.openshift.org/openshift/hive-v4.0:hive}"
Expand Down Expand Up @@ -265,7 +265,7 @@ export EXTRA_WORKER_DISK=${EXTRA_WORKER_DISK:-${WORKER_DISK}}
export EXTRA_WORKER_VCPU=${EXTRA_WORKER_VCPU:-${WORKER_VCPU}}

# Ironic vars (Image can be use <NAME>_LOCAL_IMAGE to override)
export IRONIC_IMAGE="quay.io/metal3-io/ironic:main"
export IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic:main"}
export IRONIC_DATA_DIR="${WORKING_DIR}/ironic"
export IRONIC_IMAGES_DIR="${IRONIC_DATA_DIR}/html/images"

Expand Down
16 changes: 15 additions & 1 deletion ocp_install_env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
eval "$(go env)"

function get_arch() {
ARCH=$(uname -m)
if [[ $ARCH == "aarch64" ]]; then
ARCH="arm64"
elif [[ $ARCH == "x86_64" ]]; then
if [[ "$1" == "install_config" ]]; then
ARCH="amd64"
fi
fi
echo $ARCH
}

function extract_command() {
local release_image
local cmd
Expand Down Expand Up @@ -85,7 +97,7 @@ function build_installer() {
# Build installer
pushd .
cd $OPENSHIFT_INSTALL_PATH
TAGS="libvirt baremetal" hack/build.sh
TAGS="libvirt baremetal" DEFAULT_ARCH=$(get_arch) hack/build.sh
popd
# This is only needed in rhcos.sh for old versions which lack the
# openshift-install coreos-print-stream-json option
Expand Down Expand Up @@ -230,9 +242,11 @@ metadata:
compute:
- name: worker
replicas: $NUM_WORKERS
architecture: $(get_arch install_config)
controlPlane:
name: master
replicas: ${NUM_MASTERS}
architecture: $(get_arch install_config)
platform:
baremetal: {}
platform:
Expand Down
10 changes: 5 additions & 5 deletions rhcos.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
if $OPENSHIFT_INSTALLER coreos print-stream-json >/dev/null 2>&1; then
$OPENSHIFT_INSTALLER coreos print-stream-json > $OCP_DIR/rhcos.json
export MACHINE_OS_INSTALLER_IMAGE_URL=$(jq -r '.architectures.x86_64.artifacts.openstack.formats["qcow2.gz"].disk.location' $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_IMAGE_SHA256=$(jq -r '.architectures.x86_64.artifacts.openstack.formats["qcow2.gz"].disk["sha256"]' $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_IMAGE_URL=$(jq -r .architectures.$(uname -m).artifacts.openstack.formats[\"qcow2.gz\"].disk.location $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_IMAGE_SHA256=$(jq -r .architectures.$(uname -m).artifacts.openstack.formats[\"qcow2.gz\"].disk[\"sha256\"] $OCP_DIR/rhcos.json)
export MACHINE_OS_IMAGE_URL=${MACHINE_OS_IMAGE_URL:-${MACHINE_OS_INSTALLER_IMAGE_URL}}
export MACHINE_OS_IMAGE_NAME=$(basename ${MACHINE_OS_IMAGE_URL})
export MACHINE_OS_IMAGE_SHA256=${MACHINE_OS_IMAGE_SHA256:-${MACHINE_OS_INSTALLER_IMAGE_SHA256}}

export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_URL=$(jq -r '.architectures.x86_64.artifacts.qemu.formats["qcow2.gz"].disk.location' $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_SHA256=$(jq -r '.architectures.x86_64.artifacts.qemu.formats["qcow2.gz"].disk["sha256"]' $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_URL=$(jq -r .architectures.$(uname -m).artifacts.qemu.formats[\"qcow2.gz\"].disk.location $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_SHA256=$(jq -r .architectures.$(uname -m).artifacts.qemu.formats[\"qcow2.gz\"].disk[\"sha256\"] $OCP_DIR/rhcos.json)
export MACHINE_OS_BOOTSTRAP_IMAGE_URL=${MACHINE_OS_BOOTSTRAP_IMAGE_URL:-${MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_URL}}
export MACHINE_OS_BOOTSTRAP_IMAGE_NAME=$(basename ${MACHINE_OS_BOOTSTRAP_IMAGE_URL})
export MACHINE_OS_BOOTSTRAP_IMAGE_URL=${MACHINE_OS_BOOTSTRAP_IMAGE_URL:-${MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_URL}}
export MACHINE_OS_BOOTSTRAP_IMAGE_SHA256=${MACHINE_OS_BOOTSTRAP_IMAGE_SHA256:-${MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_SHA256}}

export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_UNCOMPRESSED_SHA256=$(jq -r '.architectures.x86_64.artifacts.qemu.formats["qcow2.gz"].disk["uncompressed-sha256"]' $OCP_DIR/rhcos.json)
export MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_UNCOMPRESSED_SHA256=$(jq -r .architectures.$(uname -m).artifacts.qemu.formats[\"qcow2.gz\"].disk[\"uncompressed-sha256\"] $OCP_DIR/rhcos.json)
export MACHINE_OS_BOOTSTRAP_IMAGE_UNCOMPRESSED_SHA256=${MACHINE_OS_BOOTSTRAP_IMAGE_UNCOMPRESSED_SHA256:-${MACHINE_OS_INSTALLER_BOOTSTRAP_IMAGE_UNCOMPRESSED_SHA256}}
else
if [[ ! -f "$OCP_DIR/rhcos.json" ]]; then
Expand Down