From aff820a6f2a12178a83394e907336407e9fcad10 Mon Sep 17 00:00:00 2001 From: SLO Generator <71889107+slo-generator-bot@users.noreply.github.com> Date: Mon, 31 May 2021 18:57:02 +0200 Subject: [PATCH 1/8] chore: release 2.0.0 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ade52e19..80ffc0e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.0.0](https://www.github.com/google/slo-generator/compare/v1.5.1...v2.0.0) (2021-05-31) + + +### ⚠ BREAKING CHANGES + +* Upgrade slo-generator CLI to Click library (#131) +* Support slo-generator config v2 format (core changes) (#126) +* Split dependencies by backend (#129) + +### Features + +* Add migrator for v1 to v2 migration ([#127](https://www.github.com/google/slo-generator/issues/127)) ([796442e](https://www.github.com/google/slo-generator/commit/796442e92e35d2ceeecd12635a6e1a057791427b)) +* Add slo-generator Functions Framework API ([#130](https://www.github.com/google/slo-generator/issues/130)) ([ab1d57c](https://www.github.com/google/slo-generator/commit/ab1d57c8a1b4ad1c7183e03f1cd98db136306ef2)) +* Split dependencies by backend ([#129](https://www.github.com/google/slo-generator/issues/129)) ([c640a1d](https://www.github.com/google/slo-generator/commit/c640a1d9235c9cf24243beabc5609efecbcc9d62)) +* Support slo-generator config v2 format (core changes) ([#126](https://www.github.com/google/slo-generator/issues/126)) ([bf5e6b4](https://www.github.com/google/slo-generator/commit/bf5e6b4167a7081f03ca373c11e06be70da66fd5)) +* Upgrade slo-generator CLI to Click library ([#131](https://www.github.com/google/slo-generator/issues/131)) ([5b2635b](https://www.github.com/google/slo-generator/commit/5b2635b05e6d7434f54eb95fb4d3445d88ce29f0)) + + +### Bug Fixes + +* Migrate sample configurations to v2 ([#128](https://www.github.com/google/slo-generator/issues/128)) ([bafaf51](https://www.github.com/google/slo-generator/commit/bafaf5178b827ece5da7d204e8dc982916a1ad5f)) +* Minor v2 fixes ([#142](https://www.github.com/google/slo-generator/issues/142)) ([2d48d61](https://www.github.com/google/slo-generator/commit/2d48d617e124f58e307d9ec64da44e67df9bb611)) + + +### Documentation + +* Update documentation for v2 ([#133](https://www.github.com/google/slo-generator/issues/133)) ([0a9cd38](https://www.github.com/google/slo-generator/commit/0a9cd38a507c9559ecb97b6d55eca3b8bc9d20bc)) + ### [1.5.1](https://www.github.com/google/slo-generator/compare/v1.5.0...v1.5.1) (2021-02-12) diff --git a/setup.py b/setup.py index af7b009c..6c69a9d3 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ # Package metadata. name = "slo-generator" description = "SLO Generator" -version = "1.5.1" +version = "2.0.0" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From db59507a9685abab126e310fc9956c66a4e3fe83 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Tue, 1 Jun 2021 18:28:26 +0200 Subject: [PATCH 2/8] Add --project-id to Cloud Run deployment --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fceab9b6..cb7b0691 100644 --- a/Makefile +++ b/Makefile @@ -137,4 +137,5 @@ cloudrun: --args=api \ --args=--signature-type="${SIGNATURE_TYPE}" \ --min-instances 1 \ - --allow-unauthenticated + --allow-unauthenticated \ + --project=${CLOUDRUN_PROJECT_ID} From b63151b04f9528a3ddcb0d194cd09efbee6f337e Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Tue, 1 Jun 2021 18:28:46 +0200 Subject: [PATCH 3/8] Add GCR release --- .github/workflows/release.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38b7d168..a1741f59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: tags: - v*.*.* jobs: - release-version: + release-pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@master @@ -25,3 +25,19 @@ jobs: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ + release-gcr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@master + with: + project_id: ${{ secrets.PROJECT_ID }} + service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + export_default_credentials: true + + - name: Build Docker container and publish on GCR + run: make cloudbuild + env: + GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }} + CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }} From 7765f934b1af5a716d2ef74b174f96d97a88263c Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Tue, 1 Jun 2021 18:29:14 +0200 Subject: [PATCH 4/8] Fix API Cloud Scheduler --- slo_generator/api/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slo_generator/api/main.py b/slo_generator/api/main.py index 29d0ede7..78963115 100644 --- a/slo_generator/api/main.py +++ b/slo_generator/api/main.py @@ -51,14 +51,13 @@ def run_compute(request): # Get SLO config if API_SIGNATURE_TYPE == 'http': timestamp = None - data = str(request.get_json()) + data = str(request.data.decode('utf-8')) LOGGER.info('Loading SLO config from Flask request') elif API_SIGNATURE_TYPE == 'cloudevent': timestamp = int( datetime.strptime(request["time"], TIME_FORMAT).timestamp()) data = base64.b64decode(request.data).decode('utf-8') LOGGER.info(f'Loading SLO config from Cloud Event "{request["id"]}"') - slo_config = load_config(data) # Get slo-generator config From e338c0ba30dbbe1c76b108363e3de2622012c48e Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Wed, 2 Jun 2021 11:34:00 +0200 Subject: [PATCH 5/8] Restore changelog --- CHANGELOG.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ffc0e6..ade52e19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,5 @@ # Changelog -## [2.0.0](https://www.github.com/google/slo-generator/compare/v1.5.1...v2.0.0) (2021-05-31) - - -### ⚠ BREAKING CHANGES - -* Upgrade slo-generator CLI to Click library (#131) -* Support slo-generator config v2 format (core changes) (#126) -* Split dependencies by backend (#129) - -### Features - -* Add migrator for v1 to v2 migration ([#127](https://www.github.com/google/slo-generator/issues/127)) ([796442e](https://www.github.com/google/slo-generator/commit/796442e92e35d2ceeecd12635a6e1a057791427b)) -* Add slo-generator Functions Framework API ([#130](https://www.github.com/google/slo-generator/issues/130)) ([ab1d57c](https://www.github.com/google/slo-generator/commit/ab1d57c8a1b4ad1c7183e03f1cd98db136306ef2)) -* Split dependencies by backend ([#129](https://www.github.com/google/slo-generator/issues/129)) ([c640a1d](https://www.github.com/google/slo-generator/commit/c640a1d9235c9cf24243beabc5609efecbcc9d62)) -* Support slo-generator config v2 format (core changes) ([#126](https://www.github.com/google/slo-generator/issues/126)) ([bf5e6b4](https://www.github.com/google/slo-generator/commit/bf5e6b4167a7081f03ca373c11e06be70da66fd5)) -* Upgrade slo-generator CLI to Click library ([#131](https://www.github.com/google/slo-generator/issues/131)) ([5b2635b](https://www.github.com/google/slo-generator/commit/5b2635b05e6d7434f54eb95fb4d3445d88ce29f0)) - - -### Bug Fixes - -* Migrate sample configurations to v2 ([#128](https://www.github.com/google/slo-generator/issues/128)) ([bafaf51](https://www.github.com/google/slo-generator/commit/bafaf5178b827ece5da7d204e8dc982916a1ad5f)) -* Minor v2 fixes ([#142](https://www.github.com/google/slo-generator/issues/142)) ([2d48d61](https://www.github.com/google/slo-generator/commit/2d48d617e124f58e307d9ec64da44e67df9bb611)) - - -### Documentation - -* Update documentation for v2 ([#133](https://www.github.com/google/slo-generator/issues/133)) ([0a9cd38](https://www.github.com/google/slo-generator/commit/0a9cd38a507c9559ecb97b6d55eca3b8bc9d20bc)) - ### [1.5.1](https://www.github.com/google/slo-generator/compare/v1.5.0...v1.5.1) (2021-02-12) From 18377a952794ce2f1b95ee5b1f22416fe3e6fc48 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Wed, 2 Jun 2021 11:34:23 +0200 Subject: [PATCH 6/8] Restore setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6c69a9d3..af7b009c 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ # Package metadata. name = "slo-generator" description = "SLO Generator" -version = "2.0.0" +version = "1.5.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From 30fe5e8f450d5c650aed15bee263b66458c7eb68 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Wed, 2 Jun 2021 11:37:16 +0200 Subject: [PATCH 7/8] Update release yaml --- .github/workflows/release.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1741f59..ee14574b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,8 @@ jobs: project_id: ${{ secrets.PROJECT_ID }} service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} export_default_credentials: true - - - name: Build Docker container and publish on GCR - run: make cloudbuild - env: - GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }} - CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }} + - name: Build Docker container and publish on GCR + run: make cloudbuild + env: + GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }} + CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }} From 33450973fa1b80537acc4bbf27c5831904cc9ac8 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Wed, 2 Jun 2021 11:55:45 +0200 Subject: [PATCH 8/8] Update github workflow --- .github/workflows/cloudbuild.yml | 19 -------------- .github/workflows/rc-release.yml | 45 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 6 ++--- 3 files changed, 48 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/cloudbuild.yml create mode 100644 .github/workflows/rc-release.yml diff --git a/.github/workflows/cloudbuild.yml b/.github/workflows/cloudbuild.yml deleted file mode 100644 index dee4d277..00000000 --- a/.github/workflows/cloudbuild.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: cloudbuild -on: - push: - branches: - - master - - release-* -jobs: - cloudbuild: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - fetch-depth: 1 - - uses: actions-hub/gcloud@master - env: - PROJECT_ID: ${{ secrets.PROJECT_ID }} - APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} - with: - args: builds submit . --timeout="10m" diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml new file mode 100644 index 00000000..c065a70e --- /dev/null +++ b/.github/workflows/rc-release.yml @@ -0,0 +1,45 @@ +name: rc-release-version +on: + push: + branches: + - release-v*.*.*-rc* +jobs: + release-pypi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Verify version is a release candidate" + run: | + cat "setup.py" | grep "version = .*-rc*" + - uses: actions/setup-python@master + with: + python-version: '3.x' + architecture: 'x64' + + - name: Run all tests + run: make + env: + MIN_VALID_EVENTS: "10" + GOOGLE_APPLICATION_CREDENTIALS: tests/unit/fixtures/fake_credentials.json + + - name: Release PyPI package + run: make deploy + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ + release-gcr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@master + with: + project_id: ${{ secrets.PROJECT_ID }} + service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + export_default_credentials: true + - name: Build Docker container and publish on GCR + run: make cloudbuild + env: + GCR_PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }} + CLOUDBUILD_PROJECT_ID: ${{ secrets.CLOUDBUILD_PROJECT_ID }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee14574b..cfd69274 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,8 +7,8 @@ jobs: release-pypi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions/setup-python@v2 + - uses: actions/checkout@v2 + - uses: actions/setup-python@master with: python-version: '3.x' architecture: 'x64' @@ -28,7 +28,7 @@ jobs: release-gcr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@master with: