Skip to content

Commit

Permalink
naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
nobuto-m committed Feb 12, 2025
1 parent e687ac6 commit 7ca837c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/sunbeam-multi-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ jobs:
# SSH
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ''
cat <<EOF | tee -a ~/.ssh/config
Host sunbeam-machine-1
Host sunbeam-multi-node-1
User ubuntu
Hostname 192.168.124.11
Host sunbeam-machine-2
Host sunbeam-multi-node-2
User ubuntu
Hostname 192.168.124.12
Host sunbeam-machine-3
Host sunbeam-multi-node-3
User ubuntu
Hostname 192.168.124.13
EOF
Expand All @@ -158,7 +158,7 @@ jobs:
run: |
for i in {1..3}; do
# FIXME: the requirement of FQDN is not documented well in each tutorial
sudo -g libvirt uvt-kvm destroy "sunbeam-machine-${i}.localdomain" || true
sudo -g libvirt uvt-kvm destroy "sunbeam-multi-node-${i}.localdomain" || true
done
- name: Prepare virtual machines
run: |
Expand All @@ -176,7 +176,7 @@ jobs:
--network-config /dev/stdin \
--ssh-public-key-file ~/.ssh/id_ed25519.pub \
--no-start \
"sunbeam-machine-${i}.localdomain" \
"sunbeam-multi-node-${i}.localdomain" \
release=noble <<EOF
network:
version: 2
Expand All @@ -198,7 +198,7 @@ jobs:
# secondary NIC
for i in {1..3}; do
sudo -g libvirt virsh -c qemu:///system attach-interface "sunbeam-machine-${i}.localdomain" \
sudo -g libvirt virsh -c qemu:///system attach-interface "sunbeam-multi-node-${i}.localdomain" \
network sunbeam-virbr0 \
--model virtio --config
done
Expand All @@ -207,19 +207,19 @@ jobs:
if [ "$USE_WORKAROUND" = true ]; then
for i in {1..3}; do
virsh vol-create-as uvtool --format qcow2 \
"sunbeam-machine-${i}-sata1.qcow" "$((EXTRA_DISK * 1024**3))"
virsh attach-disk "sunbeam-machine-${i}.localdomain" \
"/var/lib/uvtool/libvirt/images/sunbeam-machine-${i}-sata1.qcow" \
"sunbeam-multi-node-${i}-sata1.qcow" "$((EXTRA_DISK * 1024**3))"
virsh attach-disk "sunbeam-multi-node-${i}.localdomain" \
"/var/lib/uvtool/libvirt/images/sunbeam-multi-node-${i}-sata1.qcow" \
sda --subdriver qcow2 --targetbus sata --config
done
fi
for i in {1..3}; do
sudo -g libvirt virsh -c qemu:///system start "sunbeam-machine-${i}.localdomain"
sudo -g libvirt virsh -c qemu:///system start "sunbeam-multi-node-${i}.localdomain"
done
for i in {1..3}; do
until ssh -oStrictHostKeyChecking=no "sunbeam-machine-${i}" -- 'cloud-init status --wait; ip -br a; lsblk'; do
until ssh -oStrictHostKeyChecking=no "sunbeam-multi-node-${i}" -- 'cloud-init status --wait; ip -br a; lsblk'; do
sleep 5
done
done
Expand All @@ -229,60 +229,60 @@ jobs:
use_workaround: $USE_WORKAROUND
dockerhub_mirror_host: "${DOCKERHUB_MIRROR#http*://}"
EOF
scp ./manifest.yaml sunbeam-machine-1:
scp ./manifest.yaml sunbeam-multi-node-1:
- name: Sunbeam - Prepare the first machine
run: |
ssh sunbeam-machine-1 -- sudo snap install openstack --channel 2024.1/edge
ssh sunbeam-machine-1 -- 'sunbeam prepare-node-script --bootstrap | bash -x'
ssh sunbeam-multi-node-1 -- sudo snap install openstack --channel 2024.1/edge
ssh sunbeam-multi-node-1 -- 'sunbeam prepare-node-script --bootstrap | bash -x'
- name: Sunbeam - Bootstrap the cloud
run: |
# -t is necessary to see some progress in act env, LP:#2097451
# Also, without -t, somehow add-k8s command gets stuck in act env
# although it doesn't happen in GitHub runner.
# without -tt, GitHub runner's log should be quiet.
ssh sunbeam-machine-1 -t -- sunbeam cluster bootstrap --manifest manifest.yaml \
ssh sunbeam-multi-node-1 -t -- sunbeam cluster bootstrap --manifest manifest.yaml \
--role control,compute,storage
- name: Workaround - destroy localhost controller
if: ${{ env.USE_WORKAROUND }}
run: |
# LP: #2095487
ssh sunbeam-machine-1 -- juju destroy-controller localhost-localhost --no-prompt
ssh sunbeam-multi-node-1 -- juju destroy-controller localhost-localhost --no-prompt
- name: Workaround - enable debug logging
if: ${{ env.USE_WORKAROUND }}
run: |
# LP: #2065490
ssh sunbeam-machine-1 -- 'juju model-config -m admin/openstack-machines logging-config="<root>=INFO;unit=DEBUG"'
ssh sunbeam-multi-node-1 -- 'juju model-config -m admin/openstack-machines logging-config="<root>=INFO;unit=DEBUG"'
- name: Sunbeam - Create registration tokens for the second and the third machines
run: |
for i in {2..3}; do
ssh sunbeam-machine-1 -t -- sunbeam cluster add "sunbeam-machine-${i}.localdomain" --output "sunbeam-machine-${i}.asc"
ssh sunbeam-multi-node-1 -t -- sunbeam cluster add "sunbeam-multi-node-${i}.localdomain" --output "sunbeam-multi-node-${i}.asc"
done
- name: Sunbeam - Prepare the second and the third machines
run: |
for i in {2..3}; do
ssh "sunbeam-machine-${i}" -- sudo snap install openstack --channel 2024.1/edge
ssh "sunbeam-machine-${i}" -- 'sunbeam prepare-node-script | bash -x'
ssh "sunbeam-multi-node-${i}" -- sudo snap install openstack --channel 2024.1/edge
ssh "sunbeam-multi-node-${i}" -- 'sunbeam prepare-node-script | bash -x'
done
- name: Sunbeam - Add the second and the third machines
run: |
for i in {2..3}; do
cat "sunbeam-machine-${i}.asc" | ssh "sunbeam-machine-${i}" -t -- sunbeam cluster join --role control,compute,storage -
cat "sunbeam-multi-node-${i}.asc" | ssh "sunbeam-multi-node-${i}" -t -- sunbeam cluster join --role control,compute,storage -
done
- name: Sunbeam - Resize the control plane
run: |
ssh sunbeam-machine-1 -t -- sunbeam cluster resize
ssh sunbeam-multi-node-1 -t -- sunbeam cluster resize
- name: Sunbeam - Configure the cloud
run: |
ssh sunbeam-machine-1 -t -- sunbeam configure --openrc demo-openrc
ssh sunbeam-multi-node-1 -t -- sunbeam configure --openrc demo-openrc
- name: Sunbeam - Launch a VM
run: |
ssh sunbeam-machine-1 -t -- sunbeam launch ubuntu --name test
ssh sunbeam-multi-node-1 -t -- sunbeam launch ubuntu --name test
- name: Sunbeam - Connect to the VM
run: |
# The cloud-init process inside the VM takes ~2 minutes to bring up the
# SSH service after the VM gets ACTIVE in OpenStack
sleep 300
ssh sunbeam-machine-1 -- '
ssh sunbeam-multi-node-1 -- '
set -ex
source demo-openrc
demo_floating_ip="$(openstack floating ip list -c Floating\ IP\ Address -f value | head -n1)"
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/sunbeam-single-node-guided.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
# SSH
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ''
cat <<EOF | tee -a ~/.ssh/config
Host sunbeam-machine-single-node-guided
Host sunbeam-single-node-guided
User ubuntu
Hostname 192.168.124.6
EOF
Expand All @@ -116,7 +116,7 @@ jobs:
if: ${{ env.ACT }}
run: |
# FIXME: the requirement of FQDN is not documented well in each tutorial
sudo -g libvirt uvt-kvm destroy sunbeam-machine-single-node-guided.localdomain || true
sudo -g libvirt uvt-kvm destroy sunbeam-single-node-guided.localdomain || true
- name: Prepare a virtual machine
run: |
sudo -g libvirt uvt-kvm create \
Expand All @@ -130,7 +130,7 @@ jobs:
--network-config /dev/stdin \
--ssh-public-key-file ~/.ssh/id_ed25519.pub \
--no-start \
sunbeam-machine-single-node-guided.localdomain \
sunbeam-single-node-guided.localdomain \
release=noble <<EOF
network:
version: 2
Expand All @@ -150,13 +150,13 @@ jobs:
EOF
# secondary NIC
sudo -g libvirt virsh -c qemu:///system attach-interface sunbeam-machine-single-node-guided.localdomain \
sudo -g libvirt virsh -c qemu:///system attach-interface sunbeam-single-node-guided.localdomain \
network sunbeam-virbr0 \
--model virtio --config
sudo -g libvirt virsh -c qemu:///system start sunbeam-machine-single-node-guided.localdomain
sudo -g libvirt virsh -c qemu:///system start sunbeam-single-node-guided.localdomain
until ssh -oStrictHostKeyChecking=no sunbeam-machine-single-node-guided -- 'cloud-init status --wait; ip -br a; lsblk'; do
until ssh -oStrictHostKeyChecking=no sunbeam-single-node-guided -- 'cloud-init status --wait; ip -br a; lsblk'; do
sleep 5
done
- name: Sunbeam - Prepare manifest file
Expand All @@ -165,38 +165,38 @@ jobs:
use_workaround: $USE_WORKAROUND
dockerhub_mirror_host: "${DOCKERHUB_MIRROR#http*://}"
EOF
scp ./manifest.yaml sunbeam-machine-single-node-guided:
scp ./manifest.yaml sunbeam-single-node-guided:
- name: Sunbeam - Prepare the machine
run: |
ssh sunbeam-machine-single-node-guided -- sudo snap install openstack --channel 2024.1/edge
ssh sunbeam-machine-single-node-guided -- 'sunbeam prepare-node-script --bootstrap | bash -x'
ssh sunbeam-single-node-guided -- sudo snap install openstack --channel 2024.1/edge
ssh sunbeam-single-node-guided -- 'sunbeam prepare-node-script --bootstrap | bash -x'
- name: Sunbeam - Bootstrap the cloud
run: |
# -t is necessary to see some progress in act env, LP:#2097451
# Also, without -t, somehow add-k8s command gets stuck in act env
# although it doesn't happen in GitHub runner.
# without -tt, GitHub runner's log should be quiet.
ssh sunbeam-machine-single-node-guided -t -- sunbeam cluster bootstrap --manifest manifest.yaml
ssh sunbeam-single-node-guided -t -- sunbeam cluster bootstrap --manifest manifest.yaml
- name: Workaround - destroy localhost controller
run: |
# LP: #2095487
ssh sunbeam-machine-single-node-guided -- juju destroy-controller localhost-localhost --no-prompt
ssh sunbeam-single-node-guided -- juju destroy-controller localhost-localhost --no-prompt
- name: Workaround - enable debug logging
run: |
# LP: #2065490
ssh sunbeam-machine-single-node-guided -- 'juju model-config -m admin/openstack-machines logging-config="<root>=INFO;unit=DEBUG"'
ssh sunbeam-single-node-guided -- 'juju model-config -m admin/openstack-machines logging-config="<root>=INFO;unit=DEBUG"'
- name: Sunbeam - Configure the cloud
run: |
ssh sunbeam-machine-single-node-guided -t -- sunbeam configure --openrc demo-openrc
ssh sunbeam-single-node-guided -t -- sunbeam configure --openrc demo-openrc
- name: Sunbeam - Launch a VM
run: |
ssh sunbeam-machine-single-node-guided -t -- sunbeam launch ubuntu --name test
ssh sunbeam-single-node-guided -t -- sunbeam launch ubuntu --name test
- name: Sunbeam - Connect to the VM
run: |
# The cloud-init process inside the VM takes ~2 minutes to bring up the
# SSH service after the VM gets ACTIVE in OpenStack
sleep 300
ssh sunbeam-machine-single-node-guided -- '
ssh sunbeam-single-node-guided -- '
set -ex
source demo-openrc
demo_floating_ip="$(openstack floating ip list -c Floating\ IP\ Address -f value | head -n1)"
Expand Down

0 comments on commit 7ca837c

Please sign in to comment.