Skip to content

Commit

Permalink
Release v0.0.3 #patch (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vultj authored Jun 21, 2024
2 parents 5538806 + 1ed5ff7 commit 9e530ec
Show file tree
Hide file tree
Showing 46 changed files with 385 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/notify-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: New Issue Notification
steps:
- run: |
echo "{\"text\":\"slinkee : New Issue https://github.com/vultr/slinkee2/issues/${{ github.event.issue.number }} \"}" > mattermost.json
echo "{\"text\":\"slik : New Issue https://github.com/vultr/slik/issues/${{ github.event.issue.number }} \"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Pull Request Notification
steps:
- run: |
echo "{\"text\":\"slinkee : PR https://github.com/vultr/slinkee2/pull/${{ github.event.number }} \"}" > mattermost.json
echo "{\"text\":\"slik : PR https://github.com/vultr/slik/pull/${{ github.event.number }} \"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
Expand Down
38 changes: 19 additions & 19 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ before:
- go mod download

builds:
- id: slinkee
main: ./cmd/slinkee/main.go
binary: slinkee
- id: slik
main: ./cmd/slik/main.go
binary: slik
env:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
Expand All @@ -34,32 +34,32 @@ builds:
- arm64

dockers:
- dockerfile: cmd/slinkee/Dockerfile.goreleaser
- dockerfile: cmd/slik/Dockerfile.goreleaser
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
image_templates:
- "ewr.vultrcr.com/slurm/slinkee:latest-amd64"
- "ewr.vultrcr.com/slurm/slinkee:{{ .Tag }}-amd64"
- "ewr.vultrcr.com/slurm/slik:latest-amd64"
- "ewr.vultrcr.com/slurm/slik:{{ .Tag }}-amd64"
extra_files:
- "cmd/slinkee/config.yaml"
- "cmd/slik/config.yaml"
ids:
- slinkee
- slik

- dockerfile: cmd/slinkee/Dockerfile.goreleaser
- dockerfile: cmd/slik/Dockerfile.goreleaser
use: buildx
goarch: arm64
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
image_templates:
- "ewr.vultrcr.com/slurm/slinkee:latest-arm64"
- "ewr.vultrcr.com/slurm/slinkee:{{ .Tag }}-arm64"
- "ewr.vultrcr.com/slurm/slik:latest-arm64"
- "ewr.vultrcr.com/slurm/slik:{{ .Tag }}-arm64"
extra_files:
- "cmd/slinkee/config.yaml"
- "cmd/slik/config.yaml"
ids:
- slinkee
- slik

- dockerfile: cmd/slurmabler/Dockerfile.goreleaser
use: buildx
Expand All @@ -85,15 +85,15 @@ dockers:
- slurmabler

docker_manifests:
- name_template: 'ewr.vultrcr.com/slurm/slinkee:latest'
- name_template: 'ewr.vultrcr.com/slurm/slik:latest'
image_templates:
- 'ewr.vultrcr.com/slurm/slinkee:latest-amd64'
- 'ewr.vultrcr.com/slurm/slinkee:latest-arm64'
- 'ewr.vultrcr.com/slurm/slik:latest-amd64'
- 'ewr.vultrcr.com/slurm/slik:latest-arm64'

- name_template: 'ewr.vultrcr.com/slurm/slinkee:{{ .Tag }}'
- name_template: 'ewr.vultrcr.com/slurm/slik:{{ .Tag }}'
image_templates:
- 'ewr.vultrcr.com/slurm/slinkee:{{ .Tag }}-amd64'
- 'ewr.vultrcr.com/slurm/slinkee:{{ .Tag }}-arm64'
- 'ewr.vultrcr.com/slurm/slik:{{ .Tag }}-amd64'
- 'ewr.vultrcr.com/slurm/slik:{{ .Tag }}-arm64'

- name_template: 'ewr.vultrcr.com/slurm/slurmabler:latest'
image_templates:
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# SLinKee (SLurm in KubernEtEs)
# SLiK (SLurm in Kubernetes)

## Overview
An operator to deploy slurm in kubernetes.

[Everyone loves a slinky](https://www.youtube.com/watch?v=ltwxC19s5u8)

## Usage
Everything is public, including the slurm images. You do not need any auth or secret sauce to use this. If you intend to use in a different cloud platform you may need to make tweaks to the mariadb statefulset. If you intend to deploy slurm on arm you'll need to build arm images.

You can deploy slinkee into your kubernetes cluster simply with: `helm install -f helm/slinkee/values.yaml slinkee ./helm/slinkee/`
You can deploy slik into your kubernetes cluster simply with: `helm install -f helm/slik/values.yaml slik ./helm/slik/`

You can then deploy a slurm cluster with one of the samples: `kubectl apply -f payloads/simple.yaml`

Expand All @@ -20,7 +18,7 @@ Sample yaml:

```yaml
apiVersion: "hpc.vultr.com/v1"
kind: Slinkee
kind: Slik
metadata:
name: full
spec:
Expand All @@ -34,13 +32,11 @@ spec:
Update operations are not currently supported, you should rebuild the cluster instead. Delete the slurm deployment, then re-create it. If you use a PVC that is retained you should not lose any data.
You can list the slurm clusters: `kubectl get slinkees`

You can delete slurm clusters: `kubectl delete slinkee <name>`
You can list the slurm clusters: `kubectl get sliks`

If you need to troubleshoot, check the logs for the operator: `kubectl logs slinkee-operator...`
You can delete slurm clusters: `kubectl delete slik <name>`

![Video summarizing usage](./docs/slinkee.mp4)
If you need to troubleshoot, check the logs for the operator: `kubectl logs slik-operator...`

## Contribution(s)
Please send any PRs for contributions/suggestions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:22.04
RUN apt update && apt install -y ca-certificates

WORKDIR /app
COPY slinkee slinkee
COPY cmd/slinkee/config.yaml config.yaml
COPY slik slik
COPY cmd/slik/config.yaml config.yaml

CMD "/app/slinkee"
CMD "/app/slik"
2 changes: 1 addition & 1 deletion cmd/slinkee/config.yaml → cmd/slik/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ probes_api:
slurm:
slurmabler:
image: "ewr.vultrcr.com/slurm/slurmabler:v0.0.120"
service_account: "slinkee"
service_account: "slik"
munged:
image: "ewr.vultrcr.com/slurm/munged:v0.0.120"
slurmctld:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/slinkee/config/config.go → cmd/slik/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewConfig(name string) (*Config, error) {
}

// initialize logging
logfile := fmt.Sprintf("%s/slinkee.log", GetLoggingPath())
logfile := fmt.Sprintf("%s/slik.log", GetLoggingPath())

if err := initLogging(logfile, true); err != nil {
return nil, err
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions cmd/slinkee/main.go → cmd/slik/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import (
"context"
"time"

"github.com/vultr/slinkee/cmd/slinkee/config"
"github.com/vultr/slinkee/cmd/slinkee/metrics"
"github.com/vultr/slinkee/pkg/helpers"
"github.com/vultr/slinkee/pkg/probes"
"github.com/vultr/slinkee/pkg/reconciler"
"github.com/vultr/slik/cmd/slik/config"
"github.com/vultr/slik/cmd/slik/metrics"
"github.com/vultr/slik/pkg/helpers"
"github.com/vultr/slik/pkg/probes"
"github.com/vultr/slik/pkg/reconciler"

"go.uber.org/zap"
"golang.org/x/sync/errgroup"
)

const (
name string = "slinkee"
name string = "slik"
)

var (
Expand All @@ -36,7 +36,7 @@ func main() { //nolint
log := zap.L().Sugar()

log.With(
"context", "slinkee",
"context", name,
"version", version,
"commit", commit,
"date", date,
Expand All @@ -56,7 +56,7 @@ func main() { //nolint
metrics.NewMetrics()

log.With(
"context", "slinkee",
"context", name,
).Info("initializing probes api")

probe, err := probes.NewProbesAPI(name, config.GetProbesAPIListen(), config.GetProbesAPIPort())
Expand All @@ -72,13 +72,13 @@ func main() { //nolint
select {
case <-gCtx.Done():
log.With(
"context", "slinkee",
"context", name,
).Info("probes: exited")

return nil
default:
log.With(
"context", "slinkee",
"context", name,
).Info("probes: starting")

if err2 := probe.Start(); err2 != nil {
Expand All @@ -93,13 +93,13 @@ func main() { //nolint
select {
case <-gCtx.Done():
log.With(
"context", "slinkee",
"context", name,
).Info("reconciler: exited")

return nil
default:
log.With(
"context", "slinkee",
"context", name,
).Info("reconciler: starting")

recon.Run()

Check failure on line 105 in cmd/slik/main.go

View workflow job for this annotation

GitHub Actions / Golangci-Lint

Function `Run->loop->SlurmDelete->GetAllNodes` should pass the context parameter (contextcheck)
Expand All @@ -121,7 +121,7 @@ func main() { //nolint

if err := probe.Shutdown(); err != nil {
log.With(
"context", "slinkee",
"context", name,
).Error(err)
}

Expand All @@ -132,13 +132,13 @@ func main() { //nolint

if err := g.Wait(); err != nil {
log.With(
"context", "slinkee",
"context", name,
).Errorf("exit reason: %s", err)
}

delta = time.Since(start)

log.With(
"context", "slinkee",
"context", name,
).Infof("shutdown in %s", delta.Round(time.Millisecond))
}
File renamed without changes.
22 changes: 11 additions & 11 deletions cmd/slurmabler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os/exec"
"time"

"github.com/vultr/slinkee/cmd/slurmabler/config"
"github.com/vultr/slinkee/pkg/connectors"
"github.com/vultr/slinkee/pkg/labeler"
"github.com/vultr/slinkee/pkg/slurm"
"github.com/vultr/slik/cmd/slurmabler/config"
"github.com/vultr/slik/pkg/connectors"
"github.com/vultr/slik/pkg/labeler"
"github.com/vultr/slik/pkg/slurm"

"go.uber.org/zap"
)
Expand Down Expand Up @@ -61,13 +61,13 @@ func main() { //nolint
}

labels := node.GetLabels()
labels["slinkee.vultr.com/nodename"] = labeler.NodeName
labels["slinkee.vultr.com/cpus"] = fmt.Sprintf("%d", labeler.CPUs)
labels["slinkee.vultr.com/boards"] = fmt.Sprintf("%d", labeler.Boards)
labels["slinkee.vultr.com/sockets_per_board"] = fmt.Sprintf("%d", labeler.SocketsPerBoard)
labels["slinkee.vultr.com/cores_per_socket"] = fmt.Sprintf("%d", labeler.CoresPerSocket)
labels["slinkee.vultr.com/threads_per_core"] = fmt.Sprintf("%d", labeler.ThreadsPerCore)
labels["slinkee.vultr.com/real_memory"] = fmt.Sprintf("%d", labeler.RealMemory)
labels["slik.vultr.com/nodename"] = labeler.NodeName
labels["slik.vultr.com/cpus"] = fmt.Sprintf("%d", labeler.CPUs)
labels["slik.vultr.com/boards"] = fmt.Sprintf("%d", labeler.Boards)
labels["slik.vultr.com/sockets_per_board"] = fmt.Sprintf("%d", labeler.SocketsPerBoard)
labels["slik.vultr.com/cores_per_socket"] = fmt.Sprintf("%d", labeler.CoresPerSocket)
labels["slik.vultr.com/threads_per_core"] = fmt.Sprintf("%d", labeler.ThreadsPerCore)
labels["slik.vultr.com/real_memory"] = fmt.Sprintf("%d", labeler.RealMemory)

node.Labels = labels

Expand Down
12 changes: 5 additions & 7 deletions crds/v1/crds.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: slinkees.hpc.vultr.com
name: sliks.hpc.vultr.com
spec:
group: hpc.vultr.com
versions:
Expand Down Expand Up @@ -54,10 +54,8 @@ spec:
status: {}
scope: Namespaced
names:
plural: slinkees
singular: slinkee
kind: Slinkee
plural: sliks
singular: slik
kind: Slik
shortNames:
- slinkee
- slink
- slurm
- slik
Binary file removed docs/slinkee.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/vultr/slinkee
module github.com/vultr/slik

go 1.22.0

Expand Down
8 changes: 4 additions & 4 deletions helm/slinkee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v2
name: slinkee
name: slik
version: 0.0.1
description: A Helm chart for slinkee
description: A Helm chart for slik
type: application
home: https://github.com/vultr/slinkee
home: https://github.com/vultr/slik
sources:
- https://github.com/vultr/slinkee
- https://github.com/vultr/slik
maintainers:
- name: Josten Landtroop
14 changes: 7 additions & 7 deletions helm/slinkee/templates/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: slinkee-operator
app: slik-operator
app.kubernetes.io/managed-by: {{ .Release.Service }}
name: slinkee-operator
name: slik-operator
namespace: {{ .Release.Namespace }}
data:
config.yaml: |-
---
logging:
debug: {{ .Values.slinkee.logging.debug }}
path: {{ .Values.slinkee.logging.path }}
encoding: {{ .Values.slinkee.logging.encoding }}
debug: {{ .Values.slik.logging.debug }}
path: {{ .Values.slik.logging.path }}
encoding: {{ .Values.slik.logging.encoding }}
probes_api:
listen: {{ .Values.slinkee.probes_api.listen }}
port: {{ .Values.slinkee.probes_api.port }}
listen: {{ .Values.slik.probes_api.listen }}
port: {{ .Values.slik.probes_api.port }}
slurm:
slurmabler:
image: {{ .Values.slurm.slurmabler.image }}
Expand Down
Loading

0 comments on commit 9e530ec

Please sign in to comment.