Skip to content

Commit 7ce8153

Browse files
committed
Add github workfloW
Signed-off-by: peppi-lotta <[email protected]>
1 parent c79d57a commit 7ce8153

22 files changed

+253
-208
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Quick Start Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
type: string
8+
default: "ubuntu-latest"
9+
timeout-minutes:
10+
type: number
11+
default: 30
12+
13+
permissions: {}
14+
15+
jobs:
16+
test:
17+
name: Quick Start Test
18+
runs-on: ${{ inputs.runner }}
19+
timeout-minutes: ${{ inputs.timeout-minutes }}
20+
21+
steps:
22+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
23+
24+
- name: Install libvirt
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager libvirt-dev
28+
29+
- name: Run Quick Start Test
30+
# We need a new shell to pick up the new group. That is why we do the sudo -s -u $USER ...
31+
# Remove the pre-installed go version. We install the exact version we need.
32+
run: |
33+
sudo usermod -a -G libvirt $USER
34+
sudo ${{ github.workspace }}/hack/quick-start-test/quick-start-test.sh
35+
36+
- name: Upload artifacts
37+
if: ${{ !cancelled() }}
38+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
39+
with:
40+
name: artifacts-${{ inputs.bmc-protocol }}.tar.gz
41+
path: test/quick-start/_artifacts
42+
if-no-files-found: error
43+
overwrite: false

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ hack/quick-start-test/disk-images
99
hack/quick-start-test/bmh-vm-01.xml
1010
hack/quick-start-test/bmo/ironic-username
1111
hack/quick-start-test/bmo/ironic-password
12-
hack/quick-start-test/irso/ironic-username
13-
hack/quick-start-test/irso/ironic-password
12+
hack/quick-start-test/ironic/ironic-username
13+
hack/quick-start-test/ironic/ironic-password
14+
hack/quick-start-test/irso/ssh_testkey
15+
hack/quick-start-test/irso/ssh_testkey.pub
1416

1517

1618
# Development containers
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: bml-01
5+
type: Opaque
6+
stringData:
7+
username: replaceme
8+
password: replaceme
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: metal3.io/v1alpha1
2+
kind: BareMetalHost
3+
metadata:
4+
name: bml-vm-01
5+
spec:
6+
online: true
7+
bootMACAddress: 00:60:2f:31:81:01
8+
bootMode: UEFI
9+
hardwareProfile: libvirt
10+
bmc:
11+
address: redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmh-vm-01
12+
credentialsName: bml-01
13+
image:
14+
checksumType: sha256
15+
checksum: http://192.168.222.1/SHA256SUMS
16+
format: qcow2
17+
url: http://192.168.222.1/noble-server-cloudimg-amd64.img

hack/quick-start-test/bml-vm-01.yaml renamed to hack/quick-start-test/bmh-01.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
online: true
77
bootMACAddress: 00:60:2f:31:81:01
8-
bootMode: legacy # use 'UEFI' for Scenario 1
8+
bootMode: UEFI
99
hardwareProfile: libvirt
1010
bmc:
1111
address: redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmh-vm-01

hack/quick-start-test/bml-01.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

hack/quick-start-test/bmo/ironic.env

Lines changed: 0 additions & 3 deletions
This file was deleted.

hack/quick-start-test/bmo/kustomization.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,4 @@ namespace: baremetal-operator-system
66
# Note that the ref=main specifies the version to use.
77
# We use main here simply because the integration with IrSO is not included in a release yet.
88
resources:
9-
- https://github.com/metal3-io/baremetal-operator/config/use-irso?ref=main
10-
11-
generatorOptions:
12-
disableNameSuffixHash: true
13-
14-
secretGenerator:
15-
- name: ironic-credentials
16-
namespace: baremetal-operator-system
17-
files:
18-
- username=ironic-username
19-
- password=ironic-password
9+
- https://github.com/metal3-io/baremetal-operator/config/use-irso?ref=main
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Baremetal lab image variables
2+
# export IMAGE_URL="http://192.168.0.150/CENTOS_10_NODE_IMAGE_K8S_v1.34.1.qcow2"
3+
# export IMAGE_CHECKSUM="afa7e95ee6fb92b952ab85bae4d01033651e690cf04a626c668041d7b94ddd4a"
4+
# export IMAGE_FORMAT="qcow2"
5+
# Virtualized setup variables
6+
export IMAGE_URL="http://192.168.222.1/CENTOS_10_NODE_IMAGE_K8S_v1.34.1.raw"
7+
export IMAGE_CHECKSUM="20537529c0588e1c3d1929981207ef6fac73df7b2500b84f462d09badcc670ea"
8+
export IMAGE_FORMAT="raw"
9+
# Common variables
10+
export IMAGE_CHECKSUM_TYPE="sha256"
11+
export KUBERNETES_VERSION="v1.34.1"
12+
# Make sure this does not conflict with other networks
13+
export POD_CIDR='["192.168.10.0/24"]'
14+
# These can be used to add user-data
15+
export CTLPLANE_KUBEADM_EXTRA_CONFIG="
16+
preKubeadmCommands:
17+
- systemctl enable --now crio
18+
users:
19+
- name: user
20+
sshAuthorizedKeys:
21+
- ssh-ed25519 ABCD... [email protected]"
22+
export WORKERS_KUBEADM_EXTRA_CONFIG="
23+
preKubeadmCommands:
24+
- systemctl enable --now crio
25+
users:
26+
- name: user
27+
sshAuthorizedKeys:
28+
- ssh-ed25519 ABCD... [email protected]"
29+
# NOTE! You must ensure that this is forwarded or assigned somehow to the
30+
# server(s) that is selected for the control-plane.
31+
# We reserved this address in the net.xml as a basic way to get a fixed IP.
32+
export CLUSTER_APIENDPOINT_HOST="192.168.222.101"
33+
export CLUSTER_APIENDPOINT_PORT="6443"

hack/quick-start-test/cleanup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ virsh -c qemu:///system net-destroy baremetal-e2e
1515
virsh -c qemu:///system net-undefine baremetal-e2e
1616

1717
export QUICK_START_BASE=${QUICK_START_BASE:="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")"}
18-
rm -rf "${QUICK_START_BASE}/bmh-vm-01.xml"
18+
rm -rf "${QUICK_START_BASE}/bmh-vm-01.xml"
19+
20+
sudo ip link del metalend # delete both ends of veth pair
21+
docker network rm kind
22+
sudo iptables -D FORWARD 1
23+
sudo iptables -D FORWARD 1 # twice because we want to remove the first rule twice

0 commit comments

Comments
 (0)