-
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.
Merge pull request #22 from linto-ai/next
merge next -> master
- Loading branch information
Showing
39 changed files
with
1,423 additions
and
366 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
# SERVING PARAMETERS | ||
SERVICE_MODE=task | ||
|
||
# SERVICE DISCOVERY | ||
SERVICE_NAME=diarization | ||
SERVICES_BROKER=redis://172.17.0.1:6379 | ||
BROKER_PASS= | ||
|
||
# CONCURRENCY | ||
CONCURRENCY=2 |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
start_container.sh | ||
start_container.sh | ||
__pycache__ |
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 |
---|---|---|
@@ -1,51 +1,79 @@ | ||
def buildDockerfile(main_folder, dockerfilePath, image_name, version, changedFiles) { | ||
if (changedFiles.contains(main_folder) || changedFiles.contains('celery_app') || changedFiles.contains('http_server') || changedFiles.contains('document') || changedFiles.contains('docker-entrypoint.sh') || changedFiles.contains('healthcheck.sh') || changedFiles.contains('wait-for-it.sh')) { | ||
echo "Building Dockerfile for ${image_name} with version ${version} (using ${dockerfilePath})" | ||
|
||
script { | ||
def image = docker.build(image_name, "-f ${dockerfilePath} .") | ||
|
||
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') { | ||
if (version == 'latest-unstable') { | ||
image.push('latest-unstable') | ||
} else { | ||
image.push('latest') | ||
image.push(version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
pipeline { | ||
agent any | ||
environment { | ||
DOCKER_HUB_REPO = "lintoai/linto-platform-diarization" | ||
DOCKER_HUB_CRED = 'docker-hub-credentials' | ||
|
||
VERSION = '' | ||
DOCKER_HUB_REPO_PYBK = "lintoai/linto-diarization-pybk" | ||
DOCKER_HUB_REPO_PYANNOTE = "lintoai/linto-diarization-pyannote" | ||
DOCKER_HUB_REPO_SIMPLE = "lintoai/linto-diarization-simple" | ||
} | ||
|
||
stages{ | ||
stage('Docker build for master branch'){ | ||
when{ | ||
stages { | ||
stage('Docker build for master branch') { | ||
when { | ||
branch 'master' | ||
} | ||
steps { | ||
echo 'Publishing latest' | ||
script { | ||
image = docker.build(env.DOCKER_HUB_REPO) | ||
VERSION = sh( | ||
def changedFiles = sh(returnStdout: true, script: 'git diff --name-only HEAD^ HEAD').trim() | ||
echo "My changed files: ${changedFiles}" | ||
|
||
version = sh( | ||
returnStdout: true, | ||
script: "awk -v RS='' '/#/ {print; exit}' RELEASE.md | head -1 | sed 's/#//' | sed 's/ //'" | ||
script: "awk -v RS='' '/#/ {print; exit}' simple/RELEASE.md | head -1 | sed 's/#//' | sed 's/ //'" | ||
).trim() | ||
buildDockerfile('simple', 'simple/Dockerfile', env.DOCKER_HUB_REPO_SIMPLE, version, changedFiles) | ||
|
||
docker.withRegistry('https://registry.hub.docker.com', env.DOCKER_HUB_CRED) { | ||
image.push("${VERSION}") | ||
image.push('latest') | ||
} | ||
version = sh( | ||
returnStdout: true, | ||
script: "awk -v RS='' '/#/ {print; exit}' pyannote/RELEASE.md | head -1 | sed 's/#//' | sed 's/ //'" | ||
).trim() | ||
buildDockerfile('pyannote', 'pyannote/Dockerfile', env.DOCKER_HUB_REPO_PYANNOTE, version, changedFiles) | ||
|
||
version = sh( | ||
returnStdout: true, | ||
script: "awk -v RS='' '/#/ {print; exit}' pybk/RELEASE.md | head -1 | sed 's/#//' | sed 's/ //'" | ||
).trim() | ||
buildDockerfile('pybk', 'pybk/Dockerfile', env.DOCKER_HUB_REPO_PYBK, version, changedFiles) | ||
} | ||
} | ||
} | ||
|
||
stage('Docker build for next (unstable) branch'){ | ||
when{ | ||
stage('Docker build for next (unstable) branch') { | ||
when { | ||
branch 'next' | ||
} | ||
steps { | ||
echo 'Publishing unstable' | ||
script { | ||
image = docker.build(env.DOCKER_HUB_REPO) | ||
VERSION = sh( | ||
returnStdout: true, | ||
script: "awk -v RS='' '/#/ {print; exit}' RELEASE.md | head -1 | sed 's/#//' | sed 's/ //'" | ||
).trim() | ||
docker.withRegistry('https://registry.hub.docker.com', env.DOCKER_HUB_CRED) { | ||
image.push('latest-unstable') | ||
} | ||
def changedFiles = sh(returnStdout: true, script: 'git diff --name-only HEAD^ HEAD').trim() | ||
echo "My changed files: ${changedFiles}" | ||
|
||
version = 'latest-unstable' | ||
|
||
buildDockerfile('simple', 'simple/Dockerfile', env.DOCKER_HUB_REPO_SIMPLE, version, changedFiles) | ||
buildDockerfile('pyannote', 'pyannote/Dockerfile', env.DOCKER_HUB_REPO_PYANNOTE, version, changedFiles) | ||
buildDockerfile('pybk', 'pybk/Dockerfile', env.DOCKER_HUB_REPO_PYBK, version, changedFiles) | ||
} | ||
} | ||
} | ||
}// end stages | ||
} | ||
} |
Oops, something went wrong.