Skip to content

Commit

Permalink
init eks-1.29
Browse files Browse the repository at this point in the history
  • Loading branch information
zoe.chou committed Oct 9, 2024
1 parent 1fe4a59 commit 7571a46
Show file tree
Hide file tree
Showing 105 changed files with 24,280 additions and 32,838 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:1.21.13 AS build

ARG TARGETARCH
ENV GOPATH /gopath/
ENV PATH $GOPATH/bin:$PATH
ENV GO111MODULE auto
ENV GOARCH ${TARGETARCH}

RUN apt-get update && apt-get --yes install libseccomp-dev
RUN go version
RUN go get github.com/tools/godep
RUN godep version

WORKDIR /gopath/src/k8s.io/autoscaler/cluster-autoscaler
ADD . .
RUN CGO_ENABLED=0 GOOS=linux go build -o cluster-autoscaler --ldflags "-s"

FROM alpine
COPY --from=build /gopath/src/k8s.io/autoscaler/cluster-autoscaler/cluster-autoscaler /

CMD ["./cluster-autoscaler"]
88 changes: 88 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// throttle concurrent build
properties([[$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 1, maxConcurrentTotal: 1, paramsToUseForLimit: '', throttleEnabled: true, throttleOption: 'project']])

library(identifier: "visenze-lib@${params['VISENZE_LIB_BRANCH'] ?: 'master'}", changelog: false)

pipeline {
agent {
label "build-amd64"
}

options {
ansiColor('xterm')
}

tools {
go 'go1.20'
}

stages {
stage('Checkout') {
steps {
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions: [
[
$class: 'CloneOption',
noTags: true,
reference: '',
timeout: 60
],
[
$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: true,
recursiveSubmodules: true,
trackingSubmodules: true,
reference: '',
timeout: 60
],
[$class: 'CleanBeforeCheckout']
],
userRemoteConfigs: scm.userRemoteConfigs
])
}
}

stage('Test') {
when {
expression {
return canRun()
}
}
steps {
script {
dir('cluster-autoscaler') {
sh('make test-in-docker')
}
}
}
}

stage('Docker Build&Push') {
when {
expression {
return canRun()
}
}
steps {
script {
dir('cluster-autoscaler') {
def version = sh(script: "grep ClusterAutoscalerVersion version/version.go",
returnStdout: true).split('"')[-2]
docker.withRegistry('', 'docker-hub-credential') {
sh("docker buildx create --use")
sh("docker buildx build -t visenze/cluster-autoscaler:${version} --push --platform linux/arm64,linux/amd64 .")
}
}
}
}
}
}
}

def canRun() {
return env.BRANCH_NAME.startsWith('release-') || env.BRANCH_NAME == 'master'
}
4 changes: 4 additions & 0 deletions cluster-autoscaler/cloudprovider/aws/aws_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import (
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eks"
"k8s.io/autoscaler/cluster-autoscaler/config"
"k8s.io/autoscaler/cluster-autoscaler/utils/gpu"
"k8s.io/autoscaler/cluster-autoscaler/utils/gpumemory"
"k8s.io/autoscaler/cluster-autoscaler/utils/mpscontext"
)

const (
Expand Down Expand Up @@ -279,6 +281,8 @@ func (m *AwsManager) buildNodeFromTemplate(asg *asg, template *asgTemplate) (*ap
node.Status.Capacity[apiv1.ResourceCPU] = *resource.NewQuantity(template.InstanceType.VCPU, resource.DecimalSI)
node.Status.Capacity[gpu.ResourceNvidiaGPU] = *resource.NewQuantity(template.InstanceType.GPU, resource.DecimalSI)
node.Status.Capacity[apiv1.ResourceMemory] = *resource.NewQuantity(template.InstanceType.MemoryMb*1024*1024, resource.DecimalSI)
node.Status.Capacity[gpumemory.ResourceVisenzeGPUMemory] = *resource.NewQuantity(template.InstanceType.GPUMemory, resource.DecimalSI)
node.Status.Capacity[mpscontext.ResourceVisenzeMPSContext] = *resource.NewQuantity(template.InstanceType.MPSContext, resource.DecimalSI)

m.updateCapacityWithRequirementsOverrides(&node.Status.Capacity, asg.MixedInstancesPolicy)

Expand Down
Loading

0 comments on commit 7571a46

Please sign in to comment.