mirror of
https://github.com/siderolabs/talos.git
synced 2025-09-29 09:41:12 +02:00
fix(ci): provision tests
Fix the provision-0 cron tests. Support zstd disk images for `talosctl cluster create`. Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
parent
e4945be3bc
commit
01bb294af6
10
.github/workflows/ci.yaml
vendored
10
.github/workflows/ci.yaml
vendored
@ -1,6 +1,6 @@
|
|||||||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
|
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
|
||||||
#
|
#
|
||||||
# Generated on 2025-04-15T15:57:38Z by kres fd5cab0.
|
# Generated on 2025-05-01T14:09:23Z by kres 6cbcbd1.
|
||||||
|
|
||||||
name: default
|
name: default
|
||||||
concurrency:
|
concurrency:
|
||||||
@ -2998,6 +2998,14 @@ jobs:
|
|||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
run: |
|
run: |
|
||||||
make talosctl-cni-bundle
|
make talosctl-cni-bundle
|
||||||
|
- name: images-essential
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
env:
|
||||||
|
IMAGE_REGISTRY: registry.dev.siderolabs.io
|
||||||
|
IMAGER_ARGS: --extra-kernel-arg=console=ttyS0
|
||||||
|
PLATFORM: linux/amd64,linux/arm64
|
||||||
|
run: |
|
||||||
|
make images-essential
|
||||||
- name: provision-tests-prepare
|
- name: provision-tests-prepare
|
||||||
run: |
|
run: |
|
||||||
make provision-tests-prepare
|
make provision-tests-prepare
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
|
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
|
||||||
#
|
#
|
||||||
# Generated on 2025-04-01T08:14:24Z by kres d903dae.
|
# Generated on 2025-05-01T14:09:23Z by kres 6cbcbd1.
|
||||||
|
|
||||||
name: integration-provision-0-cron
|
name: integration-provision-0-cron
|
||||||
concurrency:
|
concurrency:
|
||||||
@ -78,6 +78,14 @@ jobs:
|
|||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
run: |
|
run: |
|
||||||
make talosctl-cni-bundle
|
make talosctl-cni-bundle
|
||||||
|
- name: images-essential
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
env:
|
||||||
|
IMAGE_REGISTRY: registry.dev.siderolabs.io
|
||||||
|
IMAGER_ARGS: --extra-kernel-arg=console=ttyS0
|
||||||
|
PLATFORM: linux/amd64,linux/arm64
|
||||||
|
run: |
|
||||||
|
make images-essential
|
||||||
- name: provision-tests-prepare
|
- name: provision-tests-prepare
|
||||||
run: |
|
run: |
|
||||||
make provision-tests-prepare
|
make provision-tests-prepare
|
||||||
|
@ -731,6 +731,13 @@ spec:
|
|||||||
- name: talosctl-cni-bundle
|
- name: talosctl-cni-bundle
|
||||||
conditions:
|
conditions:
|
||||||
- only-on-schedule
|
- only-on-schedule
|
||||||
|
- name: images-essential
|
||||||
|
conditions:
|
||||||
|
- only-on-schedule
|
||||||
|
environment:
|
||||||
|
PLATFORM: linux/amd64,linux/arm64
|
||||||
|
IMAGER_ARGS: "--extra-kernel-arg=console=ttyS0"
|
||||||
|
IMAGE_REGISTRY: registry.dev.siderolabs.io
|
||||||
- name: provision-tests-prepare
|
- name: provision-tests-prepare
|
||||||
- name: provision-tests-track-0
|
- name: provision-tests-track-0
|
||||||
withSudo: true
|
withSudo: true
|
||||||
|
@ -246,6 +246,8 @@ func downloadBootAssets(ctx context.Context) error {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: &nodeDiskImagePath,
|
path: &nodeDiskImagePath,
|
||||||
|
// we disable extracting the compressed image since we handle zstd for disk images
|
||||||
|
disableArchive: true,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
if *downloadableImage.path == "" {
|
if *downloadableImage.path == "" {
|
||||||
|
@ -106,8 +106,7 @@ case "${USE_DISK_IMAGE:-false}" in
|
|||||||
false)
|
false)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
zstd -d < _out/metal-amd64.raw.zst > _out/metal-amd64.raw
|
QEMU_FLAGS+=("--disk-image-path=_out/metal-amd64.raw.zst")
|
||||||
QEMU_FLAGS+=("--disk-image-path=_out/metal-amd64.raw")
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -39,8 +39,6 @@ case "${CUSTOM_CNI_URL:-false}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
zstd -d < _out/metal-amd64.raw.zst > _out/metal-amd64.raw
|
|
||||||
|
|
||||||
"${INTEGRATION_TEST}" -test.v \
|
"${INTEGRATION_TEST}" -test.v \
|
||||||
-talos.talosctlpath "${TALOSCTL}" \
|
-talos.talosctlpath "${TALOSCTL}" \
|
||||||
-talos.provision.mtu 1430 \
|
-talos.provision.mtu 1430 \
|
||||||
|
@ -147,7 +147,7 @@ func upgradeCurrentToCurrentBios() upgradeSpec {
|
|||||||
return upgradeSpec{
|
return upgradeSpec{
|
||||||
ShortName: fmt.Sprintf("%s-same-ver-bios", DefaultSettings.CurrentVersion),
|
ShortName: fmt.Sprintf("%s-same-ver-bios", DefaultSettings.CurrentVersion),
|
||||||
|
|
||||||
SourceDiskImagePath: helpers.ArtifactPath("metal-amd64.raw"),
|
SourceDiskImagePath: helpers.ArtifactPath("metal-amd64.raw.zst"),
|
||||||
SourceInstallerImage: installerImage,
|
SourceInstallerImage: installerImage,
|
||||||
SourceVersion: DefaultSettings.CurrentVersion,
|
SourceVersion: DefaultSettings.CurrentVersion,
|
||||||
SourceK8sVersion: currentK8sVersion,
|
SourceK8sVersion: currentK8sVersion,
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
|
"github.com/klauspost/compress/zstd"
|
||||||
"github.com/siderolabs/gen/xslices"
|
"github.com/siderolabs/gen/xslices"
|
||||||
"github.com/siderolabs/go-cmd/pkg/cmd"
|
"github.com/siderolabs/go-cmd/pkg/cmd"
|
||||||
"github.com/siderolabs/go-procfs/procfs"
|
"github.com/siderolabs/go-procfs/procfs"
|
||||||
@ -317,24 +318,45 @@ func (p *provisioner) findBridgeListenPort(clusterReq provision.ClusterRequest)
|
|||||||
|
|
||||||
func (p *provisioner) populateSystemDisk(disks []string, clusterReq provision.ClusterRequest) error {
|
func (p *provisioner) populateSystemDisk(disks []string, clusterReq provision.ClusterRequest) error {
|
||||||
if len(disks) > 0 && clusterReq.DiskImagePath != "" {
|
if len(disks) > 0 && clusterReq.DiskImagePath != "" {
|
||||||
disk, err := os.OpenFile(disks[0], os.O_RDWR, 0o755)
|
if err := p.handleOptionalZSTDDiskImage(disks[0], clusterReq.DiskImagePath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *provisioner) handleOptionalZSTDDiskImage(provisionerDisk, diskImagePath string) error {
|
||||||
|
image, err := os.Open(diskImagePath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
defer image.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
disk, err := os.OpenFile(provisionerDisk, os.O_RDWR, 0o755)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
defer disk.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
if strings.HasSuffix(diskImagePath, ".zst") {
|
||||||
|
zstdReader, err := zstd.NewReader(image)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer disk.Close() //nolint:errcheck
|
|
||||||
|
|
||||||
image, err := os.Open(clusterReq.DiskImagePath)
|
defer zstdReader.Close() //nolint:errcheck
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer image.Close() //nolint:errcheck
|
|
||||||
|
|
||||||
_, err = io.Copy(disk, image)
|
_, err = io.Copy(disk, zstdReader)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
_, err = io.Copy(disk, image)
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *provisioner) createMetalConfigISO(state *vm.State, nodeName, config string) (string, error) {
|
func (p *provisioner) createMetalConfigISO(state *vm.State, nodeName, config string) (string, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user