Skip to content

refactor slik#43

Merged
happytreees merged 4 commits into
masterfrom
update
Jun 12, 2026
Merged

refactor slik#43
happytreees merged 4 commits into
masterfrom
update

Conversation

@happytreees

Copy link
Copy Markdown
Contributor

This pull request introduces several significant updates to improve compatibility, usability, and robustness of the SLiK Kubernetes operator. The main changes include raising the minimum supported Kubernetes and Go versions, updating dependencies, enhancing documentation with a new deployment guide, improving resource creation error handling, and refining signal handling and labeling logic.

Compatibility and Dependency Updates:

  • Raised the minimum required Kubernetes version to v1.36+ and Go version to 1.26+ across documentation, go.mod, and Helm chart (README.md, docs/deployment.md, go.mod, helm/slik/Chart.yaml). [1] [2] [3] [4]
  • Updated all major Go and Kubernetes dependencies to their latest versions in go.mod for improved compatibility and security. [1] [2]

Documentation Improvements:

  • Added a comprehensive deployment guide in docs/deployment.md, including prerequisites, installation steps, usage, troubleshooting, and upgrade/delete instructions.
  • Clarified and updated the main README.md to reflect new requirements and improved usage instructions, with a pointer to the new deployment guide.

Resource Creation Robustness:

  • Refactored resource creation functions (ConfigMaps, StatefulSets, Services, Namespaces) to gracefully ignore "already exists" errors, preventing failures during repeated or idempotent operations (pkg/slurm/create_mariadb.go, pkg/slurm/create_munged.go, pkg/slurm/create_namespace.go). [1] [2] [3] [4] [5] [6]

API and CRD Adjustments:

  • Increased the default MariaDB storage size from 40G to 50G in CRDs and Helm templates to better support production workloads (crds/v1/crds.yaml, helm/slik/templates/crds.yaml).
  • Improved namespace handling in the Slik client to use the correct namespace source and added versioned parameters for update and delete operations (pkg/clientset/v1/slik.go). [1] [2] [3]

Runtime and Signal Handling Enhancements:

  • Simplified and improved signal handling for clean shutdowns, ensuring signals are properly caught and handled only once (cmd/slik/main.go, pkg/helpers/signals.go). [1] [2] [3]
  • Fixed potential nil map panic by ensuring node labels are always initialized before use in slurmabler (cmd/slurmabler/main.go).
  • Improved error reporting for local address detection by returning a descriptive error if the address is not UDP (cmd/slik/config/config.go, cmd/slurmabler/config/config.go). [1] [2] [3] [4]

Other Improvements:

  • Added a new Slurmabler wait timeout constant for improved control over startup timing (pkg/slurm/constants.go).

These changes collectively modernize the SLiK project, improve user experience, and lay the groundwork for future development.

@happytreees happytreees self-assigned this Jun 12, 2026
@github-actions

Copy link
Copy Markdown

Unit Tests and Coverage

Show Output
 github.com/vultr/slik/cmd/slik/metrics coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/api/types/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/clientset/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/helpers coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/connectors coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/labeler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/munge coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/probes coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/reconciler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/str coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/rnd coverage: 0.0%25 of statements%0A=== RUN TestCreateSlurm%0A create_test.go:89: %0A happy path for job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for cron job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for pod%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for job with gpu%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for command and args%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A quantity failure 1%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A--- FAIL: TestCreateSlurm (0.00s)%0A=== RUN TestSlurmDelete%0A--- PASS: TestSlurmDelete (0.00s)%0A=== RUN TestSlurmExists%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A bad path%0A expect: true%0A actual: false%0A--- FAIL: TestSlurmExists (0.00s)%0A=== RUN TestGetPodStatus%0A--- PASS: TestGetPodStatus (0.00s)%0A=== RUN TestGetAllNodes%0A--- PASS: TestGetAllNodes (0.00s)%0A=== RUN TestGetDeploymentStatus%0A--- PASS: TestGetDeploymentStatus (0.00s)%0AFAIL%0Acoverage: 42.8%25 of statements%0AFAIL github.com/vultr/slik/pkg/slurm 0.013s%0AFAIL

Pusher: @happytreees, Action: pull_request_target

@github-actions

Copy link
Copy Markdown

Unit Tests and Coverage

Show Output
 github.com/vultr/slik/cmd/slik coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/metrics coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/api/types/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/clientset/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/connectors coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/munge coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/labeler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/helpers coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/probes coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/reconciler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/rnd coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/str coverage: 0.0%25 of statements%0A=== RUN TestCreateSlurm%0A create_test.go:89: %0A happy path for job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for cron job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for pod%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for job with gpu%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for command and args%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A quantity failure 1%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A--- FAIL: TestCreateSlurm (0.00s)%0A=== RUN TestSlurmDelete%0A--- PASS: TestSlurmDelete (0.00s)%0A=== RUN TestSlurmExists%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A bad path%0A expect: true%0A actual: false%0A--- FAIL: TestSlurmExists (0.00s)%0A=== RUN TestGetPodStatus%0A--- PASS: TestGetPodStatus (0.00s)%0A=== RUN TestGetAllNodes%0A--- PASS: TestGetAllNodes (0.00s)%0A=== RUN TestGetDeploymentStatus%0A--- PASS: TestGetDeploymentStatus (0.00s)%0AFAIL%0Acoverage: 42.8%25 of statements%0AFAIL github.com/vultr/slik/pkg/slurm 0.012s%0AFAIL

Pusher: @happytreees, Action: pull_request_target

@github-actions

Copy link
Copy Markdown

Unit Tests and Coverage

Show Output
go: downloading go.uber.org/zap v1.27.0%0Ago: downloading gopkg.in/yaml.v3 v3.0.1%0Ago: downloading golang.org/x/sync v0.19.0%0Ago: downloading k8s.io/apimachinery v0.36.0%0Ago: downloading k8s.io/client-go v0.36.0%0Ago: downloading github.com/prometheus/client_golang v1.19.1%0Ago: downloading golang.org/x/crypto v0.47.0%0Ago: downloading github.com/ansrivas/fiberprometheus/v2 v2.6.1%0Ago: downloading github.com/gofiber/fiber/v2 v2.52.4%0Ago: downloading k8s.io/api v0.36.0%0Ago: downloading go.uber.org/multierr v1.10.0%0Ago: downloading k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2%0Ago: downloading sigs.k8s.io/randfill v1.0.0%0Ago: downloading k8s.io/klog/v2 v2.140.0%0Ago: downloading k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a%0Ago: downloading sigs.k8s.io/structured-merge-diff/v6 v6.3.2%0Ago: downloading github.com/beorn7/perks v1.0.1%0Ago: downloading github.com/cespare/xxhash/v2 v2.2.0%0Ago: downloading github.com/prometheus/client_model v0.5.0%0Ago: downloading github.com/prometheus/common v0.48.0%0Ago: downloading github.com/prometheus/procfs v0.12.0%0Ago: downloading google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af%0Ago: downloading github.com/gofiber/adaptor/v2 v2.2.1%0Ago: downloading github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822%0Ago: downloading golang.org/x/net v0.49.0%0Ago: downloading gopkg.in/inf.v0 v0.9.1%0Ago: downloading sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730%0Ago: downloading github.com/go-logr/logr v1.4.3%0Ago: downloading github.com/google/uuid v1.6.0%0Ago: downloading github.com/mattn/go-colorable v0.1.13%0Ago: downloading github.com/mattn/go-isatty v0.0.20%0Ago: downloading github.com/mattn/go-runewidth v0.0.15%0Ago: downloading github.com/valyala/bytebufferpool v1.0.0%0Ago: downloading github.com/valyala/fasthttp v1.51.0%0Ago: downloading github.com/json-iterator/go v1.1.12%0Ago: downloading go.yaml.in/yaml/v2 v2.4.3%0Ago: downloading golang.org/x/sys v0.40.0%0Ago: downloading github.com/fxamacker/cbor/v2 v2.9.0%0Ago: downloading golang.org/x/term v0.39.0%0Ago: downloading golang.org/x/oauth2 v0.34.0%0Ago: downloading golang.org/x/time v0.14.0%0Ago: downloading github.com/google/gnostic-models v0.7.0%0Ago: downloading gopkg.in/evanphx/json-patch.v4 v4.13.0%0Ago: downloading sigs.k8s.io/yaml v1.6.0%0Ago: downloading github.com/rivo/uniseg v0.4.4%0Ago: downloading github.com/andybalholm/brotli v1.0.5%0Ago: downloading github.com/klauspost/compress v1.17.0%0Ago: downloading github.com/valyala/tcplisten v1.0.0%0Ago: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd%0Ago: downloading github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee%0Ago: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc%0Ago: downloading github.com/x448/float16 v0.8.4%0Ago: downloading golang.org/x/text v0.33.0%0Ago: downloading go.yaml.in/yaml/v3 v3.0.4%0Ago: downloading github.com/go-openapi/swag v0.23.0%0Ago: downloading github.com/go-openapi/jsonreference v0.20.2%0Ago: downloading github.com/emicklei/go-restful/v3 v3.13.0%0Ago: downloading github.com/mailru/easyjson v0.7.7%0Ago: downloading github.com/go-openapi/jsonpointer v0.21.0%0Ago: downloading github.com/josharian/intern v1.0.0%0A github.com/vultr/slik/cmd/slik coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/metrics coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/api/types/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/clientset/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/connectors coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/helpers coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/labeler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/munge coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/probes coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/reconciler coverage: 0.0%25 of statements%0A=== RUN TestCreateSlurm%0A--- PASS: TestCreateSlurm (0.01s)%0A=== RUN TestSlurmDelete%0A--- PASS: TestSlurmDelete (0.00s)%0A=== RUN TestPendingSlurmableLabelsIgnoresBlockedNodes%0A--- PASS: TestPendingSlurmableLabelsIgnoresBlockedNodes (0.00s)%0A=== RUN TestSlurmNodesReturnsOnlyEligibleLabeledNodes%0A--- PASS: TestSlurmNodesReturnsOnlyEligibleLabeledNodes (0.00s)%0A=== RUN TestSlurmExists%0A--- PASS: TestSlurmExists (0.00s)%0A=== RUN TestGetPodStatus%0A--- PASS: TestGetPodStatus (0.00s)%0A=== RUN TestGetAllNodes%0A--- PASS: TestGetAllNodes (0.00s)%0A=== RUN TestGetDeploymentStatus%0A--- PASS: TestGetDeploymentStatus (0.00s)%0APASS%0Acoverage: 54.9%25 of statements%0Aok github.com/vultr/slik/pkg/slurm 0.032s coverage: 54.9%25 of statements%0A github.com/vultr/slik/pkg/util/rnd coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/str coverage: 0.0%25 of statements

Pusher: @happytreees, Action: pull_request

@happytreees happytreees merged commit 1a38c81 into master Jun 12, 2026
6 of 9 checks passed
@happytreees happytreees deleted the update branch June 12, 2026 19:54
@github-actions

Copy link
Copy Markdown

Unit Tests and Coverage

Show Output
 github.com/vultr/slik/cmd/slik coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/metrics coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/api/types/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/clientset/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/connectors coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/helpers coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/labeler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/munge coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/probes coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/reconciler coverage: 0.0%25 of statements%0A=== RUN TestCreateSlurm%0A--- PASS: TestCreateSlurm (0.01s)%0A=== RUN TestSlurmDelete%0A--- PASS: TestSlurmDelete (0.00s)%0A=== RUN TestPendingSlurmableLabelsIgnoresBlockedNodes%0A--- PASS: TestPendingSlurmableLabelsIgnoresBlockedNodes (0.00s)%0A=== RUN TestSlurmNodesReturnsOnlyEligibleLabeledNodes%0A--- PASS: TestSlurmNodesReturnsOnlyEligibleLabeledNodes (0.00s)%0A=== RUN TestSlurmExists%0A--- PASS: TestSlurmExists (0.00s)%0A=== RUN TestGetPodStatus%0A--- PASS: TestGetPodStatus (0.00s)%0A=== RUN TestGetAllNodes%0A--- PASS: TestGetAllNodes (0.00s)%0A=== RUN TestGetDeploymentStatus%0A--- PASS: TestGetDeploymentStatus (0.00s)%0APASS%0Acoverage: 54.9%25 of statements%0Aok github.com/vultr/slik/pkg/slurm (cached) coverage: 54.9%25 of statements%0A github.com/vultr/slik/pkg/util/rnd coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/str coverage: 0.0%25 of statements

Pusher: @happytreees, Action: pull_request

@github-actions

Copy link
Copy Markdown

Unit Tests and Coverage

Show Output
 github.com/vultr/slik/cmd/slik coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slik/metrics coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/clientset/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/api/types/v1 coverage: 0.0%25 of statements%0A github.com/vultr/slik/cmd/slurmabler/config coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/helpers coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/connectors coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/munge coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/labeler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/probes coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/reconciler coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/str coverage: 0.0%25 of statements%0A github.com/vultr/slik/pkg/util/rnd coverage: 0.0%25 of statements%0A=== RUN TestCreateSlurm%0A create_test.go:89: %0A happy path for job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for cron job%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for pod%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for job with gpu%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A happy path for command and args%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A create_test.go:89: %0A quantity failure 1%0A expect: %25!s(<nil>)%0A actual: daemonsets.apps "-slurmabler" already exists%0A--- FAIL: TestCreateSlurm (0.00s)%0A=== RUN TestSlurmDelete%0A--- PASS: TestSlurmDelete (0.00s)%0A=== RUN TestSlurmExists%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A happy path%0A expect: true%0A actual: false%0A read_test.go:186: %0A bad path%0A expect: true%0A actual: false%0A--- FAIL: TestSlurmExists (0.00s)%0A=== RUN TestGetPodStatus%0A--- PASS: TestGetPodStatus (0.00s)%0A=== RUN TestGetAllNodes%0A--- PASS: TestGetAllNodes (0.00s)%0A=== RUN TestGetDeploymentStatus%0A--- PASS: TestGetDeploymentStatus (0.00s)%0AFAIL%0Acoverage: 42.8%25 of statements%0AFAIL github.com/vultr/slik/pkg/slurm 0.012s%0AFAIL

Pusher: @happytreees, Action: pull_request_target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant