diff --git a/Makefile b/Makefile index ad9b370..273e8c0 100644 --- a/Makefile +++ b/Makefile @@ -37,11 +37,13 @@ prepare: clone # These are entirely new directory structures rm -rf $(CLONE_UPSTREAM)/pkg/fluence rm -rf $(CLONE_UPSTREAM)/pkg/logger + rm -rf $(CLONE_UPSTREAM)/build/scheduler # rm -rf $(CLONE_UPSTREAM)/cmd/app rm -rf $(CLONE_UPSTREAM)/pkg/controllers/podgroup_controller.go rm -rf $(CLONE_UPSTREAM)/cmd/controller/app/server.go cp -R sig-scheduler-plugins/pkg/logger $(CLONE_UPSTREAM)/pkg/logger cp -R sig-scheduler-plugins/pkg/fluence $(CLONE_UPSTREAM)/pkg/fluence + cp -R sig-scheduler-plugins/build/scheduler $(CLONE_UPSTREAM)/build/scheduler cp -R sig-scheduler-plugins/pkg/controllers/* $(CLONE_UPSTREAM)/pkg/controllers/ # This is the one exception not from sig-scheduler-plugins because it is needed in both spots cp -R src/fluence/fluxcli-grpc $(CLONE_UPSTREAM)/pkg/fluence/fluxcli-grpc diff --git a/sig-scheduler-plugins/build/scheduler/Dockerfile b/sig-scheduler-plugins/build/scheduler/Dockerfile new file mode 100644 index 0000000..fbbd96a --- /dev/null +++ b/sig-scheduler-plugins/build/scheduler/Dockerfile @@ -0,0 +1,32 @@ +# Copyright 2020 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG GO_BASE_IMAGE=golang +ARG DISTROLESS_BASE_IMAGE=gcr.io/distroless/static:nonroot +FROM --platform=${BUILDPLATFORM} $GO_BASE_IMAGE AS builder + +WORKDIR /workspace +COPY . . +ARG TARGETARCH +RUN make build-scheduler GO_BUILD_ENV='CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH}' && \ + cp /workspace/bin/kube-scheduler /bin/kube-scheduler + +# Disable distroless because we are wanting a filesystem to preserve logs, etc. +FROM alpine:3.20 +# FROM --platform=${BUILDPLATFORM} $DISTROLESS_BASE_IMAGE + +WORKDIR /bin +COPY --from=builder /workspace/bin/kube-scheduler . +USER 65532:65532 + +ENTRYPOINT ["/bin/kube-scheduler"] diff --git a/src/fluence/go.mod b/src/fluence/go.mod index a8a54ed..05a7801 100644 --- a/src/fluence/go.mod +++ b/src/fluence/go.mod @@ -3,7 +3,7 @@ module github.com/flux-framework/flux-k8s/flux-plugin/fluence go 1.22 require ( - github.com/flux-framework/fluxion-go v0.32.1-0.20240420052153-909523c84ca2 + github.com/flux-framework/fluxion-go v0.39.0 github.com/stretchr/testify v1.7.0 google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 diff --git a/src/fluence/go.sum b/src/fluence/go.sum index c7291ca..40c5ae3 100644 --- a/src/fluence/go.sum +++ b/src/fluence/go.sum @@ -98,8 +98,8 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flux-framework/fluxion-go v0.32.1-0.20240420052153-909523c84ca2 h1:Yz/vVX0XfB2q51ZLh2p8YI5vphvv0rZF4PqtKPscvsY= -github.com/flux-framework/fluxion-go v0.32.1-0.20240420052153-909523c84ca2/go.mod h1:jA5+kOSLxchFzixzYEvMAGjkXB5yszO/HxUwdhX/5/U= +github.com/flux-framework/fluxion-go v0.39.0 h1:f68CTxHouyOvjfgu5YKYFHQ405vxtdSlG8crPph8+DU= +github.com/flux-framework/fluxion-go v0.39.0/go.mod h1:jA5+kOSLxchFzixzYEvMAGjkXB5yszO/HxUwdhX/5/U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= diff --git a/src/fluence/utils/utils.go b/src/fluence/utils/utils.go index 19fadf8..5f628dc 100644 --- a/src/fluence/utils/utils.go +++ b/src/fluence/utils/utils.go @@ -258,7 +258,6 @@ func computeTotalRequests(podList *corev1.PodList) (total map[corev1.ResourceNam type allocation struct { Type string - Name string Basename string CoreCount int } @@ -292,7 +291,6 @@ func ParseAllocResult(allocated, podName string) []allocation { if metadata["type"].(string) == jgf.NodeType { result = append(result, allocation{ Type: metadata["type"].(string), - Name: metadata["name"].(string), Basename: metadata["basename"].(string), CoreCount: corecount, }) @@ -303,9 +301,9 @@ func ParseAllocResult(allocated, podName string) []allocation { } fmt.Printf("Final node result for %s\n", podName) for i, alloc := range result { - fmt.Printf("Node %d: %s\n", i, alloc.Name) - fmt.Printf(" Type: %s\n Name: %s\n Basename: %s\n CoreCount: %d\n", - alloc.Type, alloc.Name, alloc.Basename, alloc.CoreCount) + fmt.Printf("Node %d: %s\n", i, alloc.Basename) + fmt.Printf(" Type: %s\n Basename: %s\n CoreCount: %d\n", + alloc.Type, alloc.Basename, alloc.CoreCount) } return result