Skip to content

Commit

Permalink
version: update builds and ci to go 1.22
Browse files Browse the repository at this point in the history
Problem: the upstream scheduler-plugins is now using 1.22.0.
Solution: we should do the same.
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Sep 1, 2024
1 parent ad764b9 commit 7d2b66b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Build Containers
run: |
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Build Containers
run: |
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Build Container
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Build Containers
run: |
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Build Container
run: |
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Download fluence artifact
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ^1.21
go-version: ^1.22

- name: Run Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PLATFORMS ?= linux/amd64
BUILDER ?= docker

# We match this to the fluence build (see src/build/scheduler/Dockerfile)
GO_VERSION ?= 1.21.9
GO_VERSION ?= 1.22.0
GO_BASE_IMAGE ?= golang:${GO_VERSION}
DISTROLESS_BASE_IMAGE ?= gcr.io/distroless/static:nonroot

Expand Down
20 changes: 10 additions & 10 deletions sig-scheduler-plugins/apis/scheduling/v1alpha1/podgroup_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ var (
// NewMutatingWebhook allows us to keep the sidecarInjector private
// If it's public it's exported and kubebuilder tries to add to zz_generated_deepcopy
// and you get all kinds of terrible errors about admission.Decoder missing DeepCopyInto
func NewMutatingWebhook(mgr manager.Manager) *fluenceWatcher {
return &fluenceWatcher{decoder: admission.NewDecoder(mgr.GetScheme())}
func NewMutatingWebhook(mgr manager.Manager) fluenceWatcher {
return fluenceWatcher{decoder: admission.NewDecoder(mgr.GetScheme())}
}

// mutate-v1-fluence
type fluenceWatcher struct {
decoder *admission.Decoder
decoder admission.Decoder
}

// Handle is the main handler for the webhook, which is looking for jobs and pods (in that order)
// If a job comes in (with a pod template) first, we add the labels there first (and they will
// not be added again).
func (hook *fluenceWatcher) Handle(ctx context.Context, req admission.Request) admission.Response {
func (hook fluenceWatcher) Handle(ctx context.Context, req admission.Request) admission.Response {

logger.Info("Running webhook handle, determining pod wrapper abstraction...")

Expand Down Expand Up @@ -145,7 +145,7 @@ func (hook *fluenceWatcher) Handle(ctx context.Context, req admission.Request) a
}

// Default is the expected entrypoint for a webhook...
func (hook *fluenceWatcher) Default(ctx context.Context, obj runtime.Object) error {
func (hook fluenceWatcher) Default(ctx context.Context, obj runtime.Object) error {

switch obj.(type) {
case *batchv1.Job:
Expand Down Expand Up @@ -179,7 +179,7 @@ func (hook *fluenceWatcher) Default(ctx context.Context, obj runtime.Object) err
// Note that we need to do similar for Job.
// A pod without a job wrapper, and without metadata is a group
// of size 1.
func (hook *fluenceWatcher) EnsureGroup(pod *corev1.Pod) error {
func (hook fluenceWatcher) EnsureGroup(pod *corev1.Pod) error {

// Add labels if we don't have anything. Everything is a group!
if pod.Labels == nil {
Expand Down Expand Up @@ -221,7 +221,7 @@ func getJobLabel(job *batchv1.Job, labelName, defaultLabel string) string {
// EnsureGroupOnJob looks for fluence labels (size and name) on both the job
// and the pod template. We ultimately put on the pod, the lowest level unit.
// Since we have the size of the job (parallelism) we can use that for the size
func (a *fluenceWatcher) EnsureGroupOnJob(job *batchv1.Job) error {
func (a fluenceWatcher) EnsureGroupOnJob(job *batchv1.Job) error {

// Be forgiving - allow the person to specify it on the job directly or on the Podtemplate
// We will ultimately put the metadata on the Pod.
Expand Down Expand Up @@ -251,7 +251,7 @@ func (a *fluenceWatcher) EnsureGroupOnJob(job *batchv1.Job) error {
}

// EnsureGroupStatefulSet creates a PodGroup for a StatefulSet
func (hook *fluenceWatcher) EnsureGroupStatefulSet(set *appsv1.StatefulSet) error {
func (hook fluenceWatcher) EnsureGroupStatefulSet(set *appsv1.StatefulSet) error {

// StatefulSet requires on top level explicitly
if set.Labels == nil {
Expand Down Expand Up @@ -279,7 +279,7 @@ func (hook *fluenceWatcher) EnsureGroupStatefulSet(set *appsv1.StatefulSet) erro
}

// EnsureGroupStatefulSet creates a PodGroup for a StatefulSet
func (a *fluenceWatcher) EnsureGroupReplicaSet(set *appsv1.ReplicaSet) error {
func (a fluenceWatcher) EnsureGroupReplicaSet(set *appsv1.ReplicaSet) error {

// StatefulSet requires on top level explicitly
if set.Labels == nil {
Expand Down Expand Up @@ -308,7 +308,7 @@ func (a *fluenceWatcher) EnsureGroupReplicaSet(set *appsv1.ReplicaSet) error {

// EnsureGroupDeployment creates a PodGroup for a Deployment
// This is redundant, can refactor later
func (a *fluenceWatcher) EnsureGroupDeployment(d *appsv1.Deployment) error {
func (a fluenceWatcher) EnsureGroupDeployment(d *appsv1.Deployment) error {

// StatefulSet requires on top level explicitly
if d.Labels == nil {
Expand Down
2 changes: 1 addition & 1 deletion src/build/scheduler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM fluxrm/flux-sched:jammy

USER root
ENV DEBIAN_FRONTEND=noninteractive
ENV GO_VERSION=1.21.9
ENV GO_VERSION=1.22.0

RUN apt-get update && apt-get clean -y && apt -y autoremove

Expand Down
2 changes: 1 addition & 1 deletion src/fluence/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/flux-framework/flux-k8s/flux-plugin/fluence

go 1.21
go 1.22

require (
github.com/flux-framework/fluxion-go v0.32.1-0.20240420052153-909523c84ca2
Expand Down

0 comments on commit 7d2b66b

Please sign in to comment.