mantle icon indicating copy to clipboard operation
mantle copied to clipboard

platform: Hetzner API implementation

Open apricote opened this issue 1 year ago • 2 comments

Add support for the Hetzner Platform to kola and ore.

Usage looks like:

HETZNER_IMAGE_ID=$(./bin/ore \
  hetzner \
  --hetzner-token $(pass hetzner/token) \
  --hetzner-location fsn1 \
  create-image \
  --name flatcar-nightly \
  --file http://bincache.flatcar-linux.net/images/amd64/4011.0.0+nightly-20240624-2100/flatcar_production_hetzner_image.bin.bz2)

./bin/kola \
  --platform hetzner \
  --hetzner-token $(pass hetzner/token) \
  --hetzner-server-type cpx11 \
  --hetzner-location fsn1 \
  --hetzner-image "${HETZNER_IMAGE_ID}"
  run '*'

apricote avatar Jun 20 '24 18:06 apricote

  • Squashed all commits into 5 along the lines you suggested and had in #533.
  • Rebased on current flatcar-master and changed the PR target branch to it.
  • Updated hcloud-go to latest version

All tests besides one work for me with this version. The failing test looks weird to me, in that it tries to parse cloud-init config.

--- FAIL: cl.cloudinit.basic (292.05s)
        cluster.go:125: cat: /foo: No such file or directory
        cluster.go:145: "cat /foo" failed: output , status Process exited with status 1

apricote avatar Aug 05 '24 17:08 apricote

  • Squashed all commits into 5 along the lines you suggested and had in [wip] platform: add Hetzner #533.

    • Rebased on current flatcar-master and changed the PR target branch to it.

    • Updated hcloud-go to latest version

All tests besides one work for me with this version. The failing test looks weird to me, in that it tries to parse cloud-init config.

--- FAIL: cl.cloudinit.basic (292.05s)
        cluster.go:125: cat: /foo: No such file or directory
        cluster.go:145: "cat /foo" failed: output , status Process exited with status 1

Great, thanks a lot for the cleanup. For the failing test, I suspect it's because the coreos-cloudinit support is not implemented for Hetzner: https://github.com/flatcar/coreos-cloudinit/tree/flatcar-master/datasource/metadata

Flatcar does not ship the "official" cloudinit but a rewriting in Go that implements a subset of the official cloud-init. I think for now we can skip this test and we can still implement the Hetzner cloudinit support later.

diff --git a/kola/tests/misc/cloudinit.go b/kola/tests/misc/cloudinit.go
index 9ef74d541..0abce80a4 100644
--- a/kola/tests/misc/cloudinit.go
+++ b/kola/tests/misc/cloudinit.go
@@ -156,7 +156,8 @@ write_files:
   - path: "/foo"
     content: bar`),
 		Distros:          []string{"cl"},
-		ExcludePlatforms: []string{"qemu-unpriv"},
+		// Hetzner: we need to implement coreos-cloudinit support for Hetzner.
+		ExcludePlatforms: []string{"qemu-unpriv", "hetzner"},
 		// This should run on all clouds
 	})
 	register.Register(&register.Test{

The CI failure is "normal" (here: https://github.com/flatcar/mantle/actions/runs/10253573202/job/28366511620?pr=536) - it's because you pushed from a fork.

tormath1 avatar Aug 05 '24 17:08 tormath1

Disabled the cloudinit test in 1ce68f96df08893734d5f0b40c576ad3928dcc1c.

apricote avatar Aug 21 '24 13:08 apricote