microservices-demo icon indicating copy to clipboard operation
microservices-demo copied to clipboard

Decouple release manifests

Open bourgeoisor opened this issue 3 years ago • 3 comments

This PR simplifies the release making process and increases the consistency with the Bank of Anthos process (https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/main/release/make-release.sh)

Changes to note:

  • the make-release.sh script(s) has had its lines-of-code reduced by 120 (from 190 to 70)
  • the kubernetes-manifests/ directory was renamed to dev-kubernetes-manifests/ (the "dev" manifests)
  • the release/ directory was renamed to kubernetes-manifests/ (the "release" manifests)
  • the istio-manifests/ directory stays as-is

TODOs:

  • [ ] Updated docs
  • [ ] Update .yaml files of GitHub workflows
  • [ ] Reinstate the region tags

Open questions:

  • should we also rename the hacks/ directory to release/ to match Bank of Anthos (https://github.com/GoogleCloudPlatform/bank-of-anthos/tree/main/release)?

Testing

I have tested this with a fake release (v1.1.1):

~ ./hack/make-release.sh

+ REPO_PREFIX=gcr.io/<project-id>/msd
+ REPO_PREFIX_SED='gcr.io\/<project-id>\/msd'
+++ realpath -s ./hack/make-release.sh
++ dirname /Users/obourgeois/workspace/repos/microservices-demo/hack/make-release.sh
+ SCRIPT_DIR=/Users/obourgeois/workspace/repos/microservices-demo/hack
+ REPO_ROOT=/Users/obourgeois/workspace/repos/microservices-demo/hack/..
+ cd /Users/obourgeois/workspace/repos/microservices-demo/hack/..
+ [[ ! v1.1.1 =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
+ command -v gcloud
+ rm -rf /Users/obourgeois/workspace/repos/microservices-demo/hack/../kubernetes-manifests
+ mkdir /Users/obourgeois/workspace/repos/microservices-demo/hack/../kubernetes-manifests
+ cp -a /Users/obourgeois/workspace/repos/microservices-demo/hack/../dev-kubernetes-manifests/. /Users/obourgeois/workspace/repos/microservices-demo/hack/../kubernetes-manifests/
+ find /Users/obourgeois/workspace/repos/microservices-demo/hack/../kubernetes-manifests -name '*.yaml' -exec sed -i -e 's'\''image: \(.*\)'\''image: gcr.io/<project-id>/msd\/\1:v1.1.1'\''g' '{}' ';'
+ skaffold config set local-cluster false
set value local-cluster to false for context gke_<project-id>_us-central1-c_boa-tests
+ skaffold build --default-repo=gcr.io/<project-id>/msd --tag=v1.1.1
Generating tags...
 - emailservice -> gcr.io/<project-id>/msd/emailservice:v1.1.1
 - productcatalogservice -> gcr.io/<project-id>/msd/productcatalogservice:v1.1.1
 - recommendationservice -> gcr.io/<project-id>/msd/recommendationservice:v1.1.1
 - shippingservice -> gcr.io/<project-id>/msd/shippingservice:v1.1.1
 - checkoutservice -> gcr.io/<project-id>/msd/checkoutservice:v1.1.1
 - paymentservice -> gcr.io/<project-id>/msd/paymentservice:v1.1.1
 - currencyservice -> gcr.io/<project-id>/msd/currencyservice:v1.1.1
 - cartservice -> gcr.io/<project-id>/msd/cartservice:v1.1.1
 - frontend -> gcr.io/<project-id>/msd/frontend:v1.1.1
 - adservice -> gcr.io/<project-id>/msd/adservice:v1.1.1
 - loadgenerator -> gcr.io/<project-id>/msd/loadgenerator:v1.1.1

The images were pushed on my registry:

image image

bourgeoisor avatar Feb 10 '22 19:02 bourgeoisor

Here is the summary of changes.

You are about to delete 2 region tags.

This comment is generated by snippet-bot. If you find problems with this result, please file an issue at: https://github.com/googleapis/repo-automation-bots/issues. To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • [ ] Refresh this comment

snippet-bot[bot] avatar Feb 10 '22 19:02 snippet-bot[bot]

Thanks for initiating this, @bourgeoisor! This PR is definitely going to take us some time.

I assume the changes from the PR will definitely require a "major" bump in the versioning of Online Boutique. So the release after merging this PR would be v1.0.0 — not v0.3.x. Reason: kubectl apply -f ./release/kubernetes-manifests.yaml will no longer work — which is used by a lot of docs/videos/README.md/etc. Do you think we should create a separate v0.3.7 release first — since a lot has changed on main since v0.3.6?

NimJay avatar Feb 10 '22 19:02 NimJay

Note from 1-on-1 with Olivier: We can keep the release/ folder (until all tutorials/docs are updated).

NimJay avatar Mar 25 '22 20:03 NimJay

Out of curiosity, @NimJay and @bourgeoisor, is this PR still a thing? Or should we close it and reconsider this in a future/following PR? We have limited number of PR opened with Renovate, so wondering if we can close this one?

mathieu-benoit avatar Aug 30 '22 21:08 mathieu-benoit

I'm happy with closing it (but also fine with leaving it open, especially, if we expect to make progress on this in the coming weeks). I'll leave it up to @bourgeoisor to decide. :)

NimJay avatar Aug 31 '22 14:08 NimJay

Let's close for now -- We can revisit when we implement kustomize and co.

bourgeoisor avatar Aug 31 '22 15:08 bourgeoisor