Skip to content
Closed
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
19 changes: 19 additions & 0 deletions agent/06_agent_create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,28 @@ function create_pxe_files() {
function create_image() {
local asset_dir=${1}
local openshift_install=${2}

if [ "${AGENT_USE_APPLIANCE_MODEL}" == true ]; then
create_factory_image
else
create_automated_image
fi
}

function create_automated_image() {
"${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create image
}

function create_factory_image() {
"${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create cluster-manifests
"${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create unconfigured-ignition
oc adm release info --image-for=machine-os-images --insecure=true $OPENSHIFT_RELEASE_IMAGE
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a typo?

base_iso_url=$(oc adm release info --image-for=machine-os-images --insecure=true $OPENSHIFT_RELEASE_IMAGE)
Copy link
Member

Choose a reason for hiding this comment

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

nit: more than a base_iso_url it's a pullspec

oc image extract --path /coreos/coreos-x86_64.iso:$HOME/.cache/agent/image_cache --confirm $base_iso_url
local agent_iso_abs_path="$(realpath "${OCP_DIR}")"
podman run --privileged --rm -v /run/udev:/run/udev -v "${agent_iso_abs_path}:${agent_iso_abs_path}" -v "$HOME/.cache/agent/image_cache/:$HOME/.cache/agent/image_cache/" quay.io/coreos/coreos-installer:release iso ignition embed -f -i "${agent_iso_abs_path}/unconfigured-agent.ign" -o "${agent_iso_abs_path}/agent.iso" $HOME/.cache/agent/image_cache/coreos-x86_64.iso
}
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I'm missing something, but how are we going to test/exercise this new mode? I suppose that maybe another set of changes/PR will follow up, to implement the full workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should have marked this wip. Bob has taken this PR and added the entire workflow here #1533. Will close this one.


function attach_agent_iso() {

# This is required to allow qemu opening the disk image
Expand Down
2 changes: 2 additions & 0 deletions agent/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ function getReleaseImage() {
fi
echo ${releaseImage}
}

export AGENT_USE_APPLIANCE_MODEL=${AGENT_USE_APPLIANCE_MODEL:-"false"}
6 changes: 6 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -693,3 +693,9 @@ set -x
# As per https://libvirt.org/formatnetwork.html, the tftp element is not supported for IPv6 addresses,
# and can only be specified on a single IPv4 address per network
# AGENT_E2E_TEST_BOOT_MODE=PXE

# Uncomment the following line to deploy the cluster using the appliance model
# The appliance model boots the host using the unconfigured ignition. It then mounts
# the configuration ISO where its contents are copied over to the host. The cluster
# installation is triggered when the /etc/assisted/rendezvous-host.env file is present.
# export AGENT_USE_APPLIANCE_MODEL=false