Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create macadam-ready bundles #990

Open
wants to merge 4 commits into
base: release-4.17
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion ci_microshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -exuo pipefail
sudo yum install -y make golang

./shellcheck.sh
MICROSHIFT_PRERELEASE=yes ./microshift.sh
./microshift.sh

# Set the zstd compression level to 10 to have faster
# compression while keeping a reasonable bundle size.
Expand Down
11 changes: 11 additions & 0 deletions createdisk-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ function prepare_qemu_guest_agent() {
${SSH} core@${vm_ip} 'sudo systemctl enable qemu-guest-agent.service'
}

function copy_ready_systemd_units() {
local vm_ip=$1

${SCP} systemd/* core@${vm_ip}:
${SSH} core@${vm_ip} 'sudo mv -Z *.service /etc/systemd/system/'
${SSH} core@${vm_ip} 'sudo systemctl daemon-reload'
${SSH} core@${vm_ip} 'sudo systemctl enable podman-ready-apple.service'
${SSH} core@${vm_ip} 'sudo systemctl enable podman-ready-microsoft.service'
${SSH} core@${vm_ip} 'sudo systemctl enable podman-ready-kvm.service'
}

function generate_vfkit_bundle {
local srcDir=$1
local destDir=$2
Expand Down
1 change: 1 addition & 0 deletions createdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if [ "${SNC_GENERATE_WINDOWS_BUNDLE}" != "0" ]; then
fi

prepare_qemu_guest_agent ${VM_IP}
copy_ready_systemd_units ${VM_IP}

image_tag="latest"
if podman manifest inspect quay.io/crcont/routes-controller:${OPENSHIFT_VERSION} >/dev/null 2>&1; then
Expand Down
14 changes: 14 additions & 0 deletions systemd/podman-ready-apple.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
After=sshd.socket sshd.service
OnFailure=emergency.target
OnFailureJobMode=isolate
Requires=dev-virtio\x2dports-vsock.device
ConditionVirtualization=apple

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c '/usr/bin/echo Ready | socat - VSOCK-CONNECT:2:1025'

[Install]
RequiredBy=default.target
14 changes: 14 additions & 0 deletions systemd/podman-ready-kvm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
After=sshd.socket sshd.service systemd-user-sessions.service
OnFailure=emergency.target
OnFailureJobMode=isolate
Requires=dev-virtio\x2dports-vport1p1.device
ConditionVirtualization=kvm

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c '/usr/bin/echo Ready >/dev/vport1p1'

[Install]
RequiredBy=default.target
18 changes: 18 additions & 0 deletions systemd/podman-ready-microsoft.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
After=sshd.socket sshd.service systemd-user-sessions.service vsock-network.service
OnFailure=emergency.target
OnFailureJobMode=isolate
Requires=sys-devices-virtual-net-vsock0.device
ConditionVirtualization=microsoft

[Service]
Type=oneshot
RemainAfterExit=yes
; XXXX is a port number, but podman-machine dynamically allocates it, so we can't hardcode it
; https://github.com/containers/podman/blob/0712c18d9c6daef2f15e55e4c760c86a22588d03/pkg/machine/hyperv/vsock/vsock.go#L161-L187
; Either we add that through ignition as podman is doing, or we could set it in a configuration file
; and overwrite this file at startup, but this is kind of ugly/racy
ExecStart=/bin/sh -c '/usr/bin/echo Ready | socat - VSOCK-CONNECT:2:XXXX'

[Install]
RequiredBy=default.target
5 changes: 3 additions & 2 deletions tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,16 @@ function create_libvirt_resources {
function create_vm {
local iso=$1

sudo virt-install \
sudo ${VIRT_INSTALL} \
--name ${SNC_PRODUCT_NAME} \
--vcpus ${SNC_CLUSTER_CPUS} \
--memory ${SNC_CLUSTER_MEMORY} \
--arch=${ARCH} \
--disk path=/var/lib/libvirt/${SNC_PRODUCT_NAME}/${SNC_PRODUCT_NAME}.qcow2,size=${CRC_VM_DISK_SIZE} \
--network network="${SNC_PRODUCT_NAME}",mac=52:54:00:ee:42:e1 \
--os-variant rhel9-unknown \
--nographics \
--graphics vnc \
--console pty,target.type=virtio \
--cdrom /var/lib/libvirt/${SNC_PRODUCT_NAME}/${iso} \
--events on_reboot=restart \
--autoconsole none \
Expand Down