Skip to content

Commit

Permalink
Merge pull request #22 from linto-ai/next
Browse files Browse the repository at this point in the history
merge next -> master
  • Loading branch information
Jeronymous authored Feb 7, 2024
2 parents 07cb3cf + 8dfc7d4 commit ebb6f96
Show file tree
Hide file tree
Showing 39 changed files with 1,423 additions and 366 deletions.
8 changes: 0 additions & 8 deletions .env_default_http

This file was deleted.

15 changes: 0 additions & 15 deletions .env_default_task

This file was deleted.

10 changes: 10 additions & 0 deletions .envdefault
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
28 changes: 25 additions & 3 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- README.md
- .github/workflows/dockerhub-description.yml
jobs:
dockerHubDescription:
dockerHubDescriptionPybk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -16,5 +16,27 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: lintoai/linto-platform-diarization
readme-filepath: ./README.md
repository: lintoai/linto-diarization-pybk
readme-filepath: ./pybk/README.md
dockerHubDescriptionPyannote:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: lintoai/linto-diarization-pyannote
readme-filepath: ./pyannote/README.md
dockerHubDescriptionSimple:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: lintoai/linto-diarization-simple
readme-filepath: ./simple/README.md
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
start_container.sh
start_container.sh
__pycache__
80 changes: 54 additions & 26 deletions Jenkinsfile
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
}
}
Loading

0 comments on commit ebb6f96

Please sign in to comment.