Skip to content

Commit

Permalink
[HWORKS-1555] Add Jenkins pipeline for building sklearnserver img
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdlrm committed Aug 26, 2024
1 parent 790dc37 commit 9a93dc6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@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: ['release-0.11.2'], description: 'Which branch to build'),
])
])

node("local") {
stage('Clone repository') {
sshagent (credentials: ['id_rsa']) {
sh """
git fetch --all
git checkout ${params.branch}
git pull
git submodule update --recursive --remote
"""
}
}

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)
}
}
}
}
7 changes: 7 additions & 0 deletions python/sklearn-build-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name": "hopsworks/sklearnserver",
"version": "env:VERSION",
"dockerFile": "python/sklearn.Dockerfile"
}
]

0 comments on commit 9a93dc6

Please sign in to comment.