Skip to content

Commit

Permalink
Merge pull request #85 from flux-framework/control-builds
Browse files Browse the repository at this point in the history
Bug: JGF Name was removed, and build with distroless destroyed logging
  • Loading branch information
vsoch authored Oct 10, 2024
2 parents 35291fe + 5047dc1 commit 29f411e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions sig-scheduler-plugins/build/scheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion src/fluence/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/fluence/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 3 additions & 5 deletions src/fluence/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ func computeTotalRequests(podList *corev1.PodList) (total map[corev1.ResourceNam

type allocation struct {
Type string
Name string
Basename string
CoreCount int
}
Expand Down Expand Up @@ -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,
})
Expand All @@ -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
Expand Down

0 comments on commit 29f411e

Please sign in to comment.