Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

chore: release/v0.8.0 #947

Merged
merged 14 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/auto-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ language:
website:
.: 'javascript'
images: 'svg'
requestsize:
enabled: true
staleness:
pullrequest: true
old: 30
extraold: 60
8 changes: 0 additions & 8 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ workloads run using [GitHub self-hosted runners](https://help.github.com/en/acti
- builds and pushes images to official GCR repo tagged with git commit
- builds and pushes images to official GCR repo tagged as latest

### Push-Tags.yaml

#### Triggers
- tags pushed to repo

#### Actions
- builds and pushes images to official GCR repo tagged with git tag name

### E2E-Latest.yaml

#### Triggers
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ jobs:
- name: License Check
run: |
set -x
git init
git add --all
git -c user.name="CI Bot" -c user.email="<>" commit -m "initial state"
addlicense ./
if [[ -n $(git status -s) ]]; then
exit 1
fi
addlicense --check ./
- name: Validate Schema of SRE Recipes Configs
run: |
set -x
Expand Down Expand Up @@ -70,6 +64,7 @@ jobs:
skaffold config set --global local-cluster true
skaffold run -p local --status-check=false
# setup dummy RATING_SERVICE_ADDR; without it frontend microservice will not run
kubectl wait \-\-for=condition=available \-\-timeout=600s deployment/frontend
kubectl set env deployment.apps/frontend RATING_SERVICE_ADDR=http://some.host
- name: Wait For Pods
timeout-minutes: 10
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/e2e-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,19 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
# run tests
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }}
PROJECT_NUMBER=$(gcloud projects describe ${{ env.PROJECT_ID }} --format="value(projectNumber)")
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }} $PROJECT_NUMBER
- name: Run Rating Service Test
timeout-minutes: 30
run: |
set -x
# install dependencies
python3 -m pip install -r tests/ratingservice/requirements.txt
python3 -m pip install --user -r tests/ratingservice/requirements.txt
# get service URL
RATING_SERVICE_URL="https://ratingservice-dot-$(gcloud app describe --format='value(defaultHostname)' --project=${{ env.PROJECT_ID }})"
# run test
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ jobs:
# change to previous release code state
cd ./release-code
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
# run tests
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }}
PROJECT_NUMBER=$(gcloud projects describe ${{ env.PROJECT_ID }} --format="value(projectNumber)")
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }} $PROJECT_NUMBER
- name: Test Using Existing Project
timeout-minutes: 30
run: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/e2e-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,19 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
# run tests
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }}
PROJECT_NUMBER=$(gcloud projects describe ${{ env.PROJECT_ID }} --format="value(projectNumber)")
python3 tests/monitoring_integration_test.py ${{ env.PROJECT_ID }} $PROJECT_NUMBER
- name: Run Rating Service Test
timeout-minutes: 30
run: |
set -x
# install dependencies
python3 -m pip install -r tests/ratingservice/requirements.txt
python3 -m pip install --user -r tests/ratingservice/requirements.txt
# get service URL
RATING_SERVICE_URL="https://ratingservice-dot-$(gcloud app describe --format='value(defaultHostname)' --project=${{ env.PROJECT_ID }})"
# run test
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/e2e_scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export PROJECT_ID=$(gcloud config get-value project)
export WORKDIR=$(dirname $(realpath $0))

# clear monitoring
python3 -m pip install -r ${WORKDIR}/requirements.txt
python3 -m pip install --user -r ${WORKDIR}/requirements.txt
python3 ${WORKDIR}/cleanup_monitoring.py "projects/$PROJECT_ID"

# delete cluster
Expand Down Expand Up @@ -109,3 +109,9 @@ for INSTANCE_NAME in $(gcloud sql instances list --project=$PROJECT_ID --format=
echo "deleting Cloud SQL instance $INSTANCE_NAME..."
gcloud sql instances delete $INSTANCE_NAME --project=$PROJECT_ID --quiet
done

# delete GKE hub clusters
for MEMBER_NAME in $(gcloud beta container hub memberships list --format="value(NAME)"); do
echo "deleting GKE hub membership $MEMBER_NAME"
gcloud beta container hub memberships delete $MEMBER_NAME --quiet
done
15 changes: 6 additions & 9 deletions .github/workflows/e2e_scripts/cleanup_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ def cleanupDashboards(project_name):

def cleanupLogBasedMetrics(project_name):
""" Deletes all log-based metrics. """
client = logging_v2.MetricsServiceV2Client()
metrics = True
while metrics:
metrics = ["{}/metrics/{}".format(project_name, metric.name) for metric in client.list_log_metrics(project_name)]
for metric in metrics:
try:
client.delete_log_metric(metric)
except:
print('Could not delete metric: ' + metric)
client = logging_v2.Client()
for metric in client.list_metrics():
try:
metric.delete(metric)
except:
print(f'Could not delete metric: {metric}')

def cleanupPolicies(project_name):
""" Delete all alerting policies for both uptime checks and SLOs. """
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e_scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
google-cloud-monitoring>=1.0.0
google-cloud-monitoring-dashboards>=1.0.0
google-cloud-monitoring==1.0.0
google-cloud-monitoring-dashboards==1.0.0
google-cloud-logging==3.0.0
15 changes: 7 additions & 8 deletions .github/workflows/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ set -euo pipefail
sudo apt-get -y install git kubectl

# install go
curl -O https://storage.googleapis.com/golang/go1.12.9.linux-amd64.tar.gz
tar -xvf go1.12.9.linux-amd64.tar.gz
curl -O https://go.dev/dl/go1.18.2.linux-amd64.tar.gz
tar -xvf go1.18.2.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile
source ~/.profile

# install addlicense
go get -u github.com/google/addlicense
go install github.com/google/addlicense@latest
sudo ln -s $HOME/go/bin/addlicense /bin

# install kind
curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64" && \
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.13.0/kind-linux-amd64
chmod +x ./kind && \
sudo mv ./kind /usr/local/bin

Expand All @@ -52,9 +52,8 @@ sudo usermod -aG docker ${USER}
# docker auth with service account used for CI
gcloud auth configure-docker --quiet

# install pip3
sudo apt-get install python3-pip

# reboot to complete docker setup
sudo reboot

# install pip3
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
29 changes: 29 additions & 0 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
version:
description: 'New Version Number'
required: true
env:
PROJECT_ID: stackdriver-sandbox-230822
jobs:
make-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -142,3 +144,30 @@ jobs:
PULL_REQUEST_FROM_BRANCH: "release/${{ github.event.inputs.version }}"
PULL_REQUEST_TITLE: "chore: release/${{ github.event.inputs.version }}"
PULL_REQUEST_BRANCH: "main"
push-release-containers:
needs: make-release
runs-on: [self-hosted, push-privilege]
steps:
- uses: actions/checkout@v2
- name: Trigger Cloud Shell Re-build
id: cloud_build
run: |
set -x
gcloud builds submit \
--config cloud-shell/cloudbuild.yaml --async
- name: Push Service Images to GCR
timeout-minutes: 20
run: |
set -x
skaffold config set --global local-cluster false
# tag with release version
skaffold build --default-repo=gcr.io/${{ env.PROJECT_ID }} \
--tag=${{ github.event.inputs.version }}
- name: Push Load Generator Image to GCR
timeout-minutes: 20
run: |
set -x
gcloud auth configure-docker --quiet
IMAGE=gcr.io/${{ env.PROJECT_ID }}/sandbox/loadgenerator/gke:${{ github.event.inputs.version }}
docker build -t $IMAGE ./src/loadgenerator
docker push $IMAGE
45 changes: 0 additions & 45 deletions .github/workflows/push-tags.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/update-custom-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
# run after pushing new tags
tags:
- 'v*'
workflow_run:
workflows: [Make Release]
types:
- completed
workflow_dispatch:
# trigger through UI or API
jobs:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ gcloud auth configure-docker -q
application.

```bash
INGRESS_HOST="$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
INGRESS_HOST="$(kubectl -n asm-ingress get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
echo "$INGRESS_HOST"
curl -v "http://$INGRESS_HOST"
```
Expand Down Expand Up @@ -248,7 +248,7 @@ curl -X POST 'https://ratingservice-dot-$AE_DOMAIN/ratings:recollect'
application.

```bash
INGRESS_HOST="$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
INGRESS_HOST="$(kubectl -n asm-ingress get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
echo "$INGRESS_HOST"
curl -v "http://$INGRESS_HOST"
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ With Sandbox, we provide a tool that automatically provisions a new demo cluster

Click the Cloud Shell button for automated one-click installation of a new Sandbox cluster in a new Google Cloud Project.

[![Open in Cloud Shell](http://www.gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/cloud-ops-sandbox.git&cloudshell_git_branch=v0.7.6&shellonly=true&cloudshell_image=gcr.io/stackdriver-sandbox-230822/cloudshell-image/uncertified:v0.7.6&cloudshell_tutorial=docs/tutorial.md)
[![Open in Cloud Shell](http://www.gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/cloud-ops-sandbox.git&cloudshell_git_branch=v0.8.0&shellonly=true&cloudshell_image=gcr.io/stackdriver-sandbox-230822/cloudshell-image/uncertified:v0.8.0&cloudshell_tutorial=docs/tutorial.md)

__Note__: If installation stops due to billing account errors, set up the billing account and type: `sandboxctl create`.

Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ There are two artifacts that make up a Cloud Operations Sandbox release:
- website/deploy/index.html""
- terraform/telemetry.py should be set to prod
- a new git tag should have been pushed for the new release version
- the new tags should trigger a [CI job](https://github.com/GoogleCloudPlatform/cloud-ops-sandbox/blob/main/.github/workflows/push-tags.yml),
and updated container images should appear in the [`stackdriver-sandbox-230822` GCR repo](http://console.cloud.google.com/gcr/images/stackdriver-sandbox-230822)
- updated container images (hipstershop services, loadgenerator, cloud shell container) should be pushed in the [`stackdriver-sandbox-230822` GCR repo](http://console.cloud.google.com/gcr/images/stackdriver-sandbox-230822)
1. Review the new release pull request.
- Hint: use `sandboxctl test` to run tests on a live, newly-created sandbox environment
- If any issues arise, delete the branch and tag, push new changes to develop, and start the release process again (see [Reverting Faulty Releases](#reverting-faulty-releases))
1. When the PR has been reviewed and thoroughly tested, merge it into main
- Don't squash; we want to keep the git history
Expand Down
7 changes: 6 additions & 1 deletion cloud-shell/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

FROM gcr.io/cloudshell-images/cloudshell:latest

# update gcloud version to support asm installation
# asm needs gcloud 389 for `gcloud container fleet mesh enable`
RUN sudo apt-get update
RUN sudo apt-get -y --only-upgrade install google-cloud-sdk-anthos-auth google-cloud-sdk

# install Terraform 1.0.0
RUN sudo apt-get install unzip && \
wget -q https://releases.hashicorp.com/terraform/1.0.0/terraform_1.0.0_linux_amd64.zip -O ./terraform.zip && \
Expand All @@ -32,7 +37,7 @@ RUN python3 -m pip install click==8.0.1
RUN python3 -m pip install google-cloud-monitoring==2.4.0

# set env var
RUN echo "VERSION=v0.7.6" >> /etc/environment
RUN echo "VERSION=v0.8.0" >> /etc/environment

# Change "Open in Cloudshell" script to run `sandboxctl create` using local file and changing it
COPY cloudshell_open_cp.sh /google/devshell/bashrc.google.d/cloudshell_open.sh
2 changes: 1 addition & 1 deletion kubernetes-manifests/adservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
terminationGracePeriodSeconds: 5
containers:
- name: adservice
image: gcr.io/stackdriver-sandbox-230822/sandbox/adservice:v0.7.6
image: gcr.io/stackdriver-sandbox-230822/sandbox/adservice:v0.8.0
ports:
- containerPort: 9555
env:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-manifests/cartservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
command: ['bin/sh', '-c', 'until nslookup redis-cart; do echo waiting for redis; sleep 2; done;']
containers:
- name: cartservice
image: gcr.io/stackdriver-sandbox-230822/sandbox/cartservice:v0.7.6
image: gcr.io/stackdriver-sandbox-230822/sandbox/cartservice:v0.8.0
ports:
- containerPort: 7070
env:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-manifests/checkoutservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
containers:
- name: checkoutservice
image: gcr.io/stackdriver-sandbox-230822/sandbox/checkoutservice:v0.7.6
image: gcr.io/stackdriver-sandbox-230822/sandbox/checkoutservice:v0.8.0
ports:
- containerPort: 5050
readinessProbe:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-manifests/currencyservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
terminationGracePeriodSeconds: 5
containers:
- name: currencyservice
image: gcr.io/stackdriver-sandbox-230822/sandbox/currencyservice:v0.7.6
image: gcr.io/stackdriver-sandbox-230822/sandbox/currencyservice:v0.8.0
ports:
- name: grpc
containerPort: 7000
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-manifests/emailservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
terminationGracePeriodSeconds: 5
containers:
- name: emailservice
image: gcr.io/stackdriver-sandbox-230822/sandbox/emailservice:v0.7.6
image: gcr.io/stackdriver-sandbox-230822/sandbox/emailservice:v0.8.0
ports:
- containerPort: 8080
readinessProbe:
Expand Down
Loading