-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into builder_suspend
- Loading branch information
Showing
97 changed files
with
2,600 additions
and
3,799 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ logs/ | |
*idmap*.txt | ||
__pycache__/ | ||
venv | ||
.idea | ||
.idea | ||
|
||
suites/ |
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
46 changes: 46 additions & 0 deletions
46
tests/milvus_benchmark/ci/jenkinsfile/publishDailyImages.groovy
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,46 @@ | ||
timeout(time: 15, unit: 'MINUTES') { | ||
def imageName = "milvus/engine:${DOCKER_VERSION}" | ||
def remoteImageName = "milvusdb/daily-build:${REMOTE_DOCKER_VERSION}" | ||
def localDockerRegistryImage = "${params.LOCAL_DOKCER_REGISTRY_URL}/${imageName}" | ||
def remoteDockerRegistryImage = "${params.REMOTE_DOKCER_REGISTRY_URL}/${remoteImageName}" | ||
try { | ||
deleteImages("${localDockerRegistryImage}", true) | ||
|
||
def pullSourceImageStatus = sh(returnStatus: true, script: "docker pull ${localDockerRegistryImage}") | ||
|
||
if (pullSourceImageStatus == 0) { | ||
def renameImageStatus = sh(returnStatus: true, script: "docker tag ${localDockerRegistryImage} ${remoteImageName} && docker rmi ${localDockerRegistryImage}") | ||
def sourceImage = docker.image("${remoteImageName}") | ||
docker.withRegistry("https://${params.REMOTE_DOKCER_REGISTRY_URL}", "${params.REMOTE_DOCKER_CREDENTIALS_ID}") { | ||
sourceImage.push() | ||
sourceImage.push("${REMOTE_DOCKER_LATEST_VERSION}") | ||
} | ||
} else { | ||
echo "\"${localDockerRegistryImage}\" image does not exist !" | ||
} | ||
} catch (exc) { | ||
throw exc | ||
} finally { | ||
deleteImages("${localDockerRegistryImage}", true) | ||
deleteImages("${remoteDockerRegistryImage}", true) | ||
} | ||
} | ||
|
||
boolean deleteImages(String imageName, boolean force) { | ||
def imageNameStr = imageName.trim() | ||
def isExistImage = sh(returnStatus: true, script: "docker inspect --type=image ${imageNameStr} 2>&1 > /dev/null") | ||
if (isExistImage == 0) { | ||
def deleteImageStatus = 0 | ||
if (force) { | ||
def imageID = sh(returnStdout: true, script: "docker inspect --type=image --format \"{{.ID}}\" ${imageNameStr}") | ||
deleteImageStatus = sh(returnStatus: true, script: "docker rmi -f ${imageID}") | ||
} else { | ||
deleteImageStatus = sh(returnStatus: true, script: "docker rmi ${imageNameStr}") | ||
} | ||
|
||
if (deleteImageStatus != 0) { | ||
return false | ||
} | ||
} | ||
return true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
pipeline { | ||
agent none | ||
|
||
options { | ||
timestamps() | ||
} | ||
|
||
parameters{ | ||
string defaultValue: 'registry.zilliz.com', description: 'Local Docker registry URL', name: 'LOCAL_DOKCER_REGISTRY_URL', trim: true | ||
string defaultValue: 'registry-1.docker.io', description: 'Remote Docker registry URL', name: 'REMOTE_DOKCER_REGISTRY_URL', trim: true | ||
string defaultValue: 'milvus-docker-access-token', description: 'Remote Docker credentials id', name: 'REMOTE_DOCKER_CREDENTIALS_ID', trim: true | ||
} | ||
|
||
environment { | ||
DAILY_BUILD_VERSION = VersionNumber([ | ||
versionNumberString : '${BUILD_DATE_FORMATTED, "yyyyMMdd"}' | ||
]); | ||
} | ||
|
||
stages { | ||
stage('Push Daily Docker Images') { | ||
matrix { | ||
agent none | ||
axes { | ||
axis { | ||
name 'OS_NAME' | ||
values 'ubuntu18.04', 'centos7' | ||
} | ||
|
||
axis { | ||
name 'CPU_ARCH' | ||
values 'amd64' | ||
} | ||
|
||
axis { | ||
name 'BINARY_VERSION' | ||
values 'gpu', 'cpu' | ||
} | ||
} | ||
|
||
stages { | ||
stage("Publish Docker Images") { | ||
environment { | ||
DOCKER_VERSION = "master-${BINARY_VERSION}-${OS_NAME}-release" | ||
REMOTE_DOCKER_VERSION = "${OS_NAME}-${BINARY_VERSION}-${DAILY_BUILD_VERSION}" | ||
REMOTE_DOCKER_LATEST_VERSION = "${OS_NAME}-${BINARY_VERSION}-latest" | ||
} | ||
|
||
agent { | ||
kubernetes { | ||
label "${OS_NAME}-${BINARY_VERSION}-publish-${env.BUILD_NUMBER}" | ||
defaultContainer 'jnlp' | ||
yaml """ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: publish | ||
componet: docker | ||
spec: | ||
containers: | ||
- name: publish-images | ||
image: registry.zilliz.com/library/docker:v1.0.0 | ||
securityContext: | ||
privileged: true | ||
command: | ||
- cat | ||
tty: true | ||
resources: | ||
limits: | ||
memory: "4Gi" | ||
cpu: "1.0" | ||
requests: | ||
memory: "2Gi" | ||
cpu: "0.5" | ||
volumeMounts: | ||
- name: docker-sock | ||
mountPath: /var/run/docker.sock | ||
volumes: | ||
- name: docker-sock | ||
hostPath: | ||
path: /var/run/docker.sock | ||
""" | ||
} | ||
} | ||
|
||
stages { | ||
stage('Publish') { | ||
steps { | ||
container('publish-images') { | ||
script { | ||
load "${env.WORKSPACE}/ci/jenkinsfile/publishDailyImages.groovy" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.