diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index 529b61298498..a2fad9b5e120 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -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 }} @@ -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 @@ -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 }} diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index 00e1471d0804..a007272864e7 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -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" { @@ -30,22 +43,22 @@ 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}" } @@ -53,16 +66,16 @@ target "base-poetry" { 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}" } @@ -71,10 +84,10 @@ 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}" } @@ -82,18 +95,18 @@ target "default" { 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}" @@ -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}" @@ -122,19 +135,19 @@ 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}" } @@ -142,18 +155,18 @@ target "spacy-de" { 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}" } @@ -161,18 +174,18 @@ target "spacy-it" { 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}" } @@ -180,8 +193,8 @@ target "spacy-en" { 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", ] }