forked from logicalclocks/kserve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HWORKS-1555] Add Jenkins pipeline for building sklearnserver img (lo…
- Loading branch information
1 parent
d4fab9a
commit ab93d74
Showing
3 changed files
with
47 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,39 @@ | ||
@Library("jenkins-library@main") | ||
|
||
import com.logicalclocks.jenkins.k8s.ImageBuilder | ||
|
||
properties([ | ||
parameters([ | ||
choice(name: 'image', choices: ['all', 'sklearnserver'], description: 'Which docker image to build'), | ||
choice(name: 'branch', choices: ['', 'master', 'release-0.11.2'], description: 'Which branch to build'), | ||
]) | ||
]) | ||
|
||
node("local") { | ||
stage('Clone repository') { | ||
if (params.branch == '' || params.branch == 'master'){ | ||
checkout scm | ||
} else { | ||
sshagent (credentials: ['id_rsa']) { | ||
sh """ | ||
git fetch --all | ||
git checkout ${params.branch} | ||
git pull | ||
""" | ||
} | ||
} | ||
} | ||
|
||
stage('Build and push image(s)') { | ||
version = readFile "${env.WORKSPACE}/VERSION" | ||
withEnv(["VERSION=${version.trim()}"]) { | ||
|
||
if(params.image == 'all' || params.image == 'sklearnserver'){ | ||
|
||
def builder = new ImageBuilder(this) | ||
m = readFile "${env.WORKSPACE}/python/sklearn-build-manifest.json" | ||
builder.run(m) | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
4.0.0 |
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,7 @@ | ||
[ | ||
{ | ||
"name": "hopsworks/sklearnserver", | ||
"version": "env:VERSION", | ||
"dockerFile": "python/sklearn.Dockerfile" | ||
} | ||
] |