Skip to content

Commit

Permalink
next try
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Sep 22, 2023
1 parent 23b22df commit c25d6f9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 44 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ jobs:
name: Build Docker base images and setup environment
runs-on: ubuntu-22.04
env:
IMAGE_NAME: "europe-west3-docker.pkg.dev/rasa-releases/rasa-docker/rasa"
BASE_IMAGE_REGISTRY: "europe-west3-docker.pkg.dev/rasa-ci-cd/rasa"
outputs:
base_image_hash: ${{ steps.check_image.outputs.base_image_hash }}
base_mitie_image_hash: ${{ steps.check_image.outputs.base_mitie_image_hash }}
Expand Down Expand Up @@ -870,8 +870,17 @@ jobs:
echo "POETRY_VERSION=$(scripts/poetry-version.sh)" >> $GITHUB_ENV
shell: bash

- name: Login to DockerHub Registry 🔢
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ env.DOCKERHUB_USERNAME }} --password-stdin || true
# Authenticate and push to the release registry
- id: 'auth-release'
name: Authenticate with gcloud for dev registry 🎫
uses: 'google-github-actions/auth@e8df18b60c5dd38ba618c121b779307266153fbf'
with:
credentials_json: '${{ secrets.RASA_OSS_RELEASE_ACCOUNT_KEY }}'

- name: Authenticate docker for dev registry 🎫
run: |
# Set up docker to authenticate via gcloud command-line tool.
gcloud auth configure-docker europe-west3-docker.pkg.dev
- name: Check if tag version is equal or higher than the latest tagged Rasa version
id: rasa_get_version
Expand Down Expand Up @@ -1022,7 +1031,8 @@ jobs:
needs: [changes, build_docker_base_images_and_set_env]
env:
IMAGE_TAG: ${{ needs.build_docker_base_images_and_set_env.outputs.image_tag }}
IMAGE_NAME: "europe-west3-docker.pkg.dev/rasa-releases/rasa-docker/rasa"
BASE_IMAGE_REGISTRY: "europe-west3-docker.pkg.dev/rasa-ci-cd/rasa"
TARGET_IMAGE_REGISTRY: "europe-west3-docker.pkg.dev/rasa-releases/rasa-docker"
BASE_IMAGE_HASH: ${{ needs.build_docker_base_images_and_set_env.outputs.base_image_hash }}
BASE_MITIE_IMAGE_HASH: ${{ needs.build_docker_base_images_and_set_env.outputs.base_mitie_image_hash }}
BASE_BUILDER_IMAGE_HASH: ${{ needs.build_docker_base_images_and_set_env.outputs.base_builder_image_hash }}
Expand Down
93 changes: 53 additions & 40 deletions docker/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
variable "IMAGE_NAME" {
default = "rasa/rasa"
variable "BASE_IMAGE_REGISTRY" {
default = "rasa"
}

variable "TARGET_IMAGE_REGISTRY" {
default = "rasa"
}


variable "TARGET_IMAGE_NAME" {
default = "${TARGET_IMAGE_REGISTRY}/rasa"
}

variable "BASE_IMAGE_NAME" {
default = "${BASE_IMAGE_REGISTRY}/rasa"
}

variable "IMAGE_TAG" {
Expand Down Expand Up @@ -30,39 +43,39 @@ group "base-images" {

target "base" {
dockerfile = "docker/Dockerfile.base"
tags = ["${IMAGE_NAME}:base-${IMAGE_TAG}"]
tags = ["${BASE_IMAGE_NAME}:base-${IMAGE_TAG}"]
cache-to = ["type=inline"]
}

target "base-mitie" {
dockerfile = "docker/Dockerfile.base-mitie"
tags = ["${IMAGE_NAME}:base-mitie-${IMAGE_TAG}"]
tags = ["${BASE_IMAGE_NAME}:base-mitie-${IMAGE_TAG}"]
cache-to = ["type=inline"]
}

target "base-poetry" {
dockerfile = "docker/Dockerfile.base-poetry"
tags = ["${IMAGE_NAME}:base-poetry-${POETRY_VERSION}"]
tags = ["${BASE_IMAGE_NAME}:base-poetry-${POETRY_VERSION}"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
POETRY_VERSION = "${POETRY_VERSION}"
}

cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-poetry-${POETRY_VERSION}",
"type=registry,ref=${BASE_IMAGE_NAME}:base-poetry-${POETRY_VERSION}",
]
}

target "base-builder" {
dockerfile = "docker/Dockerfile.base-builder"
tags = ["${IMAGE_NAME}:base-builder-${IMAGE_TAG}"]
tags = ["${BASE_IMAGE_NAME}:base-builder-${IMAGE_TAG}"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
POETRY_VERSION = "${POETRY_VERSION}"
}

Expand All @@ -71,29 +84,29 @@ target "base-builder" {

target "default" {
dockerfile = "Dockerfile"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
}

cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest",
]
}

target "full" {
dockerfile = "docker/Dockerfile.full"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}-full"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}-full"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_MITIE_IMAGE_HASH = "${BASE_MITIE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
Expand All @@ -102,18 +115,18 @@ target "full" {
cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest-full",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest-full",
]
}

target "mitie-en" {
dockerfile = "docker/Dockerfile.pretrained_embeddings_mitie_en"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}-mitie-en"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}-mitie-en"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_MITIE_IMAGE_HASH = "${BASE_MITIE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
Expand All @@ -122,66 +135,66 @@ target "mitie-en" {
cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-mitie-${BASE_MITIE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest-mitie-en",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-mitie-${BASE_MITIE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest-mitie-en",
]
}

target "spacy-de" {
dockerfile = "docker/Dockerfile.pretrained_embeddings_spacy_de"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}-spacy-de"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}-spacy-de"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
}

cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest-spacy-de",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest-spacy-de",
]
}

target "spacy-it" {
dockerfile = "docker/Dockerfile.pretrained_embeddings_spacy_it"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}-spacy-it"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}-spacy-it"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
}

cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest-spacy-it",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest-spacy-it",
]
}

target "spacy-en" {
dockerfile = "docker/Dockerfile.pretrained_embeddings_spacy_en"
tags = ["${IMAGE_NAME}:${IMAGE_TAG}-spacy-en"]
tags = ["${TARGET_IMAGE_NAME}:${IMAGE_TAG}-spacy-en"]

args = {
IMAGE_BASE_NAME = "${IMAGE_NAME}"
IMAGE_BASE_NAME = "${BASE_IMAGE_NAME}"
BASE_IMAGE_HASH = "${BASE_IMAGE_HASH}"
BASE_BUILDER_IMAGE_HASH = "${BASE_BUILDER_IMAGE_HASH}"
}

cache-to = ["type=inline"]

cache-from = [
"type=registry,ref=${IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${IMAGE_NAME}:latest-spacy-en",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-${BASE_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH}",
"type=registry,ref=${TARGET_IMAGE_NAME}:latest-spacy-en",
]
}

0 comments on commit c25d6f9

Please sign in to comment.