forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change the agent add readme Update aws_ec2_instance_types.go update g4dn.xlarge feat: support multi-arch feat: change the agent feat: change to amd64, arm64 would coredump fix: update the exec path fix: change to use alpine as base image fix: add more compilation args update update
- Loading branch information
Jinyu Pan
committed
Oct 24, 2023
1 parent
ad004fe
commit d3cb401
Showing
15 changed files
with
6,012 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// 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.15' | ||
} | ||
|
||
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 .") | ||
} | ||
|
||
build(job: 'devops_docker_registry_copy_image', parameters: [ | ||
string(name: 'REPOSITORY', value: "visenze/cluster-autoscaler"), | ||
string(name: 'DOCKER_TAG', value: version), | ||
string(name: 'TIMEOUT', value: "30"), | ||
string(name: 'SOURCE_DOCKER_REGISTRY_CREDENTIAL', value: "docker-hub-credential"), | ||
string(name: 'DEST_DOCKER_REGISTRY', value: "https://741813507711.dkr.ecr.cn-northwest-1.amazonaws.com.cn"), | ||
string(name: 'DEST_DOCKER_REGISTRY_CREDENTIAL', value: "ecr:cn-northwest-1:aws-cn-jenkins"), | ||
]) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def canRun() { | ||
return env.BRANCH_NAME.startsWith('release-') || env.BRANCH_NAME == 'master' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM golang:1.19.7 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.