Skip to content

Commit

Permalink
Mgmt 3108 - use latest release image for installing SNO with bootstra…
Browse files Browse the repository at this point in the history
…p-in-place (#371)

* MGMT-3108 Update BIP to use work with quay.io/eranco74/ocp-release:bootstrap-in-place release image

* MGMT-3108 Don't create secondary_net interface for bootstrap-in-place
  • Loading branch information
eranco74 authored Jan 3, 2021
1 parent 31e052f commit 50ef94b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 36 deletions.
15 changes: 7 additions & 8 deletions discovery-infra/bootstrap_in_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
SSH_KEY = os.path.join("ssh_key", "key")


def installer_generate():
logging.info("Installer generate manifests")
utils.run_command(f"{INSTALLER_BINARY} create manifests --dir={IBIP_DIR}")
def installer_generate(openshift_release_image):
logging.info("Installer generate ignitions")
# TODO delete
shutil.copy(f"{RESOURCES_DIR}/sno_manifest.yaml", os.path.join(IBIP_DIR, "openshift"))
utils.run_command(f"{INSTALLER_BINARY} create ignition-configs --dir={IBIP_DIR}")
bip_env={"OPENSHIFT_INSTALL_RELEASE_IMAGE": openshift_release_image,
"OPENSHIFT_INSTALL_EXPERIMENTAL_BOOTSTRAP_IN_PLACE": "true",
"OPENSHIFT_INSTALL_EXPERIMENTAL_BOOTSTRAP_IN_PLACE_COREOS_INSTALLER_ARGS": "/dev/vda"}
utils.run_command_with_output(f"{INSTALLER_BINARY} create ignition-configs --dir={IBIP_DIR}", env=bip_env)


def download_live_image(download_path, rhcos_version=None):
Expand Down Expand Up @@ -160,10 +159,10 @@ def execute_ibip_flow(args):
setup_files_and_folders(args, net_asset, controller.cluster_name)

utils.extract_installer(openshift_release_image, BUILD_DIR)
installer_generate()
installer_generate(openshift_release_image)

download_live_image(f"{BUILD_DIR}/installer-image.iso")
image_path = embed("installer-image.iso", "bootstrap.ign", EMBED_IMAGE_NAME)
image_path = embed("installer-image.iso", "bootstrap-in-place-for-live-iso.ign", EMBED_IMAGE_NAME)

logging.info("Starting node...")
controller.image_path = image_path
Expand Down
22 changes: 0 additions & 22 deletions discovery-infra/resources/sno_manifest.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions discovery-infra/test_infra/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def _io_buffer_to_str(buf):
return out, err, process.returncode


def run_command_with_output(command):
def run_command_with_output(command, env=None):
with subprocess.Popen(
command, shell=True, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True
command, shell=True, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True, env=env,
) as p:
for line in p.stdout:
print(line, end="") # process line here
Expand Down
10 changes: 6 additions & 4 deletions terraform_files/baremetal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ resource "libvirt_domain" "master" {
addresses = var.libvirt_master_ips[count.index]
}

network_interface {
network_name = libvirt_network.secondary_net.name
addresses = var.libvirt_secondary_master_ips[count.index]
dynamic "network_interface" {
for_each = var.bootstrap_in_place ? [] : ["secondary_net"]
content {
network_name = libvirt_network.secondary_net.name
addresses = var.libvirt_secondary_master_ips[count.index]
}
}

boot_device{
dev = ["hd", "cdrom"]
}
Expand Down

0 comments on commit 50ef94b

Please sign in to comment.