From 59a0d4d80b1a1efe9d12f5ac1dbedc5fd03cdc6e Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 12:44:32 +0200 Subject: [PATCH 01/13] bump octavia with same version as airbyte --- .bumpversion.cfg | 6 ++++++ octavia-cli/Dockerfile | 2 -- octavia-cli/README.md | 2 +- octavia-cli/install.sh | 2 +- octavia-cli/publish.sh | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 31225cc6ee595..67dbbafd22791 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -41,3 +41,9 @@ serialize = [bumpversion:file:kube/overlays/stable-with-resource-limits/.env] [bumpversion:file:kube/overlays/stable-with-resource-limits/kustomization.yaml] + +[bumpversion:file:octavia-cli/publish.sh] + +[bumpversion:file:octavia-cli/install.sh] + +[bumpversion:file:octavia-cli/README.md] diff --git a/octavia-cli/Dockerfile b/octavia-cli/Dockerfile index 040a18665e5ed..77f68eff2b50b 100644 --- a/octavia-cli/Dockerfile +++ b/octavia-cli/Dockerfile @@ -14,5 +14,3 @@ USER octavia-cli WORKDIR /home/octavia-project ENTRYPOINT ["octavia"] -LABEL io.airbyte.version=dev -LABEL io.airbyte.name=airbyte/octavia-cli diff --git a/octavia-cli/README.md b/octavia-cli/README.md index f86948b5d3a42..55db0c4091b5a 100644 --- a/octavia-cli/README.md +++ b/octavia-cli/README.md @@ -104,7 +104,7 @@ This script: ```bash touch ~/.octavia # Create a file to store env variables that will be mapped the octavia-cli container mkdir my_octavia_project_directory # Create your octavia project directory where YAML configurations will be stored. -docker run --name octavia-cli -i --rm -v my_octavia_project_directory:/home/octavia-project --network host --user $(id -u):$(id -g) --env-file ~/.octavia airbyte/octavia-cli:latest +docker run --name octavia-cli -i --rm -v my_octavia_project_directory:/home/octavia-project --network host --user $(id -u):$(id -g) --env-file ~/.octavia airbyte/octavia-cli:0.35.60-alpha ``` ### Using `docker-compose` diff --git a/octavia-cli/install.sh b/octavia-cli/install.sh index 89e4d5339fba0..e1134f65eab53 100755 --- a/octavia-cli/install.sh +++ b/octavia-cli/install.sh @@ -3,7 +3,7 @@ # This install scripts currently only works for ZSH and Bash profiles. # It creates an octavia alias in your profile bound to a docker run command and your current user. -VERSION=0.1.0 +VERSION=0.35.60-alpha OCTAVIA_ENV_FILE=${HOME}/.octavia detect_profile() { diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index 557b411ebc2c4..ec5f55c7a9ddd 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -ux -VERSION=$1 +VERSION=0.35.60-alpha SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker buildx create --name octavia_builder > /dev/null 2>&1 From 7cd56e90fb7f68be297a80ca6af96ea7cb0f6584 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 12:59:37 +0200 Subject: [PATCH 02/13] publish octavia from release_version.sh --- tools/bin/release_version.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/bin/release_version.sh b/tools/bin/release_version.sh index e2e246aa2842d..10e9ce97e8923 100755 --- a/tools/bin/release_version.sh +++ b/tools/bin/release_version.sh @@ -42,3 +42,8 @@ VERSION=$NEW_VERSION SUB_BUILD=PLATFORM ./gradlew clean build SUB_BUILD=PLATFORM ./gradlew publish VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push echo "Completed building and publishing..." + +# TODO alafanechere: does SUB_BUILD=OCTAVIA_CLI ./gradlew publish would work? +echo "Build and publish octavia-cli..." +VERSION=$NEW_VERSION SUB_BUILD=OCTAVIA_CLI ./gradlew clean build +./octavia-cli/publish.sh From 0a3b729bae660e677f31aab4f5713bc78c341055 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 19:43:26 +0200 Subject: [PATCH 03/13] try publish --- .github/workflows/gradle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9ba4d57dc45fd..8d049691a282e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -123,6 +123,9 @@ jobs: run: | SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:build javadoc --scan + - name: Publish + run: ./octavia-cli/publish.sh + - name: Slack Notification - Failure if: failure() && github.ref == 'refs/heads/master' uses: rtCamp/action-slack-notify@master From f2fa2645ee07803f6b0c50319d14d553ebbe8de6 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 19:58:11 +0200 Subject: [PATCH 04/13] try publish --- .bumpversion.cfg | 2 -- octavia-cli/publish.sh | 2 +- tools/bin/release_version.sh | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 67dbbafd22791..3db9a513be7f3 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -42,8 +42,6 @@ serialize = [bumpversion:file:kube/overlays/stable-with-resource-limits/kustomization.yaml] -[bumpversion:file:octavia-cli/publish.sh] - [bumpversion:file:octavia-cli/install.sh] [bumpversion:file:octavia-cli/README.md] diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index ec5f55c7a9ddd..557b411ebc2c4 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -ux -VERSION=0.35.60-alpha +VERSION=$1 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker buildx create --name octavia_builder > /dev/null 2>&1 diff --git a/tools/bin/release_version.sh b/tools/bin/release_version.sh index 10e9ce97e8923..f5649108d9c51 100755 --- a/tools/bin/release_version.sh +++ b/tools/bin/release_version.sh @@ -46,4 +46,4 @@ echo "Completed building and publishing..." # TODO alafanechere: does SUB_BUILD=OCTAVIA_CLI ./gradlew publish would work? echo "Build and publish octavia-cli..." VERSION=$NEW_VERSION SUB_BUILD=OCTAVIA_CLI ./gradlew clean build -./octavia-cli/publish.sh +./octavia-cli/publish.sh ${NEW_VERSION} From 3487c5f4a79780684a1ffe71e0401517c0a810bc Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 19:59:00 +0200 Subject: [PATCH 05/13] test publish --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8d049691a282e..0191af6af3fc3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -124,7 +124,7 @@ jobs: SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:build javadoc --scan - name: Publish - run: ./octavia-cli/publish.sh + run: ./octavia-cli/publish.sh 0.1.1 - name: Slack Notification - Failure if: failure() && github.ref == 'refs/heads/master' From 1ad0cb7f0e106e74c3363fa09647ca474395c7e2 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 20:13:17 +0200 Subject: [PATCH 06/13] fix docker --- .bumpversion.cfg | 2 ++ octavia-cli/Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3db9a513be7f3..15781e3539945 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -45,3 +45,5 @@ serialize = [bumpversion:file:octavia-cli/install.sh] [bumpversion:file:octavia-cli/README.md] + +[bumpversion:file:octavia-cli/Dockerfile] diff --git a/octavia-cli/Dockerfile b/octavia-cli/Dockerfile index 77f68eff2b50b..6158d3eee02d6 100644 --- a/octavia-cli/Dockerfile +++ b/octavia-cli/Dockerfile @@ -14,3 +14,5 @@ USER octavia-cli WORKDIR /home/octavia-project ENTRYPOINT ["octavia"] +LABEL io.airbyte.version=0.35.60-alpha +LABEL io.airbyte.name=airbyte/octavia-cli From 82807e5bb13a83742b9760b558e5c7340ddd6e5c Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 20:50:01 +0200 Subject: [PATCH 07/13] install emulators --- octavia-cli/publish.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index 557b411ebc2c4..34d690b444ec1 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -3,7 +3,8 @@ set -ux VERSION=$1 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - +docker run --privileged --rm tonistiigi/binfmt --install all +docker build --push --tag airbyte/octavia-cli:${VERSION} ${SCRIPT_DIR} docker buildx create --name octavia_builder > /dev/null 2>&1 set -e docker buildx use octavia_builder From 0886c0f8629c4103e3926630ed1c7655f1ea7f0b Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 28 Mar 2022 22:18:08 +0200 Subject: [PATCH 08/13] login --- octavia-cli/publish.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index 34d690b444ec1..3bff68971636e 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -2,6 +2,13 @@ set -ux VERSION=$1 + +if [[ -z "${DOCKER_PASSWORD}" ]]; then + echo 'DOCKER_PASSWORD for airbytebot not set.'; + exit 1; +fi +docker login -u airbytebot -p "${DOCKER_PASSWORD}" + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker run --privileged --rm tonistiigi/binfmt --install all docker build --push --tag airbyte/octavia-cli:${VERSION} ${SCRIPT_DIR} From 5ad69682095234a861c8c2c9822476168a4f9bba Mon Sep 17 00:00:00 2001 From: alafanechere Date: Tue, 29 Mar 2022 10:23:22 +0200 Subject: [PATCH 09/13] login --- .github/workflows/gradle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0191af6af3fc3..848e96c5a22c5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -124,6 +124,8 @@ jobs: SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:build javadoc --scan - name: Publish + env: + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} run: ./octavia-cli/publish.sh 0.1.1 - name: Slack Notification - Failure From aaad57e3ee7df7c5545e6fcd9f16401e5310a090 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Tue, 29 Mar 2022 13:38:26 +0200 Subject: [PATCH 10/13] remove publish step from gradle.yml --- .github/workflows/gradle.yml | 5 ----- octavia-cli/publish.sh | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 848e96c5a22c5..9ba4d57dc45fd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -123,11 +123,6 @@ jobs: run: | SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:build javadoc --scan - - name: Publish - env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: ./octavia-cli/publish.sh 0.1.1 - - name: Slack Notification - Failure if: failure() && github.ref == 'refs/heads/master' uses: rtCamp/action-slack-notify@master diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index 3bff68971636e..7cbdf47faf762 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -3,12 +3,7 @@ set -ux VERSION=$1 -if [[ -z "${DOCKER_PASSWORD}" ]]; then - echo 'DOCKER_PASSWORD for airbytebot not set.'; - exit 1; -fi docker login -u airbytebot -p "${DOCKER_PASSWORD}" - SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) docker run --privileged --rm tonistiigi/binfmt --install all docker build --push --tag airbyte/octavia-cli:${VERSION} ${SCRIPT_DIR} From 31cdc5627afab7807b336ab856617d3eb016711e Mon Sep 17 00:00:00 2001 From: alafanechere Date: Tue, 29 Mar 2022 13:40:46 +0200 Subject: [PATCH 11/13] update version --- octavia-cli/Dockerfile | 2 +- octavia-cli/README.md | 4 ++-- octavia-cli/install.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/octavia-cli/Dockerfile b/octavia-cli/Dockerfile index 6158d3eee02d6..13178532000b1 100644 --- a/octavia-cli/Dockerfile +++ b/octavia-cli/Dockerfile @@ -14,5 +14,5 @@ USER octavia-cli WORKDIR /home/octavia-project ENTRYPOINT ["octavia"] -LABEL io.airbyte.version=0.35.60-alpha +LABEL io.airbyte.version=0.35.61-alpha LABEL io.airbyte.name=airbyte/octavia-cli diff --git a/octavia-cli/README.md b/octavia-cli/README.md index 55db0c4091b5a..460d7150de2bf 100644 --- a/octavia-cli/README.md +++ b/octavia-cli/README.md @@ -104,7 +104,7 @@ This script: ```bash touch ~/.octavia # Create a file to store env variables that will be mapped the octavia-cli container mkdir my_octavia_project_directory # Create your octavia project directory where YAML configurations will be stored. -docker run --name octavia-cli -i --rm -v my_octavia_project_directory:/home/octavia-project --network host --user $(id -u):$(id -g) --env-file ~/.octavia airbyte/octavia-cli:0.35.60-alpha +docker run --name octavia-cli -i --rm -v my_octavia_project_directory:/home/octavia-project --network host --user $(id -u):$(id -g) --env-file ~/.octavia airbyte/octavia-cli:0.35.61-alpha ``` ### Using `docker-compose` @@ -352,4 +352,4 @@ $ octavia apply | Version | Date | Description | PR | |---------|------------|------------------|----------------------------------------------------------| -| 0.1.0 | 2022-04-07 | Alpha release | [EPIC](https://github.com/airbytehq/airbyte/issues/10704)| +| 0.35.61 | 2022-04-07 | Alpha release | [EPIC](https://github.com/airbytehq/airbyte/issues/10704)| diff --git a/octavia-cli/install.sh b/octavia-cli/install.sh index e1134f65eab53..7af5116b0c39d 100755 --- a/octavia-cli/install.sh +++ b/octavia-cli/install.sh @@ -3,7 +3,7 @@ # This install scripts currently only works for ZSH and Bash profiles. # It creates an octavia alias in your profile bound to a docker run command and your current user. -VERSION=0.35.60-alpha +VERSION=0.35.61-alpha OCTAVIA_ENV_FILE=${HOME}/.octavia detect_profile() { From fee28ecf2041a31156469ab4301a0b01604095d7 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Tue, 29 Mar 2022 19:18:50 +0200 Subject: [PATCH 12/13] make changes suggested by davin and chris --- octavia-cli/publish.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/octavia-cli/publish.sh b/octavia-cli/publish.sh index 7cbdf47faf762..5a09728ddbed2 100755 --- a/octavia-cli/publish.sh +++ b/octavia-cli/publish.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -set -ux +set -uxe VERSION=$1 - -docker login -u airbytebot -p "${DOCKER_PASSWORD}" +GIT_REVISION=$2 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -docker run --privileged --rm tonistiigi/binfmt --install all -docker build --push --tag airbyte/octavia-cli:${VERSION} ${SCRIPT_DIR} + +docker run --privileged --rm tonistiigi/binfmt --install all # This installs the emulator to build multi-arch images +set +e # Disable exit if the next command fails if the builder already exist. docker buildx create --name octavia_builder > /dev/null 2>&1 -set -e +set -e # The previous command can fail safely if docker buildx use octavia_builder docker buildx inspect --bootstrap -docker buildx build --push --tag airbyte/octavia-cli:${VERSION} --platform=linux/arm64,linux/amd64 ${SCRIPT_DIR} +docker buildx build --push --tag airbyte/octavia-cli:${VERSION} --platform=linux/arm64,linux/amd64 --label "io.airbyte.git-revision=${GIT_REVISION}" ${SCRIPT_DIR} From 8c271493f3d181d3b7b986e422aadd7d164ea06e Mon Sep 17 00:00:00 2001 From: alafanechere Date: Tue, 29 Mar 2022 19:20:44 +0200 Subject: [PATCH 13/13] make changes suggested by davin and chris --- tools/bin/release_version.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/bin/release_version.sh b/tools/bin/release_version.sh index f5649108d9c51..8dd02fd21c08b 100755 --- a/tools/bin/release_version.sh +++ b/tools/bin/release_version.sh @@ -43,7 +43,5 @@ SUB_BUILD=PLATFORM ./gradlew publish VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push echo "Completed building and publishing..." -# TODO alafanechere: does SUB_BUILD=OCTAVIA_CLI ./gradlew publish would work? -echo "Build and publish octavia-cli..." VERSION=$NEW_VERSION SUB_BUILD=OCTAVIA_CLI ./gradlew clean build -./octavia-cli/publish.sh ${NEW_VERSION} +./octavia-cli/publish.sh ${NEW_VERSION} ${GIT_REVISION}