-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metrics: add documentation for updating Cloud Run (#3779)
* chore: add .gitignore with metrics-processor-service-key.json * metrics(process-cloudflare): add update instructions * metrics(summaries): add update instructions * metrics(index-generator): add update instructions * chore: remove copy from secrets/build/infra * metrics: remove .gitignore * metrics: remove metrics-processor-service-key.json from client params * metrics: remove step for copying credentials file * metrics: attach service account in gcloud run deploy command * metrics: remove Storage Legacy Bucket Writer permission * metrics: sort roles whose permissions are required * metrics: provide correct service-account details * chore: move region after at the end of gcloud run deploy Since the region is generic, and can be set as default in gcloud CLI
- Loading branch information
Showing
6 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# index-generator | ||
|
||
## Prerequisites | ||
|
||
- Ensure that you have following roles on GCP: | ||
- `Cloud Run Developer` | ||
- `Service Account User` | ||
- `Storage Object User` | ||
- Example request: [nodejs/build#3774][cloud-run-roles-request] | ||
- Install [Node.js][install-nodejs]. | ||
- Install [gcloud CLI][install-gcloud-cli]. | ||
- Authenticate using [`gcloud auth`][gcloud-auth]. | ||
- Install [Docker Desktop][install-docker-desktop]. | ||
- Authenticate using [`gcloud auth configure-docker`][gcloud-auth-docker]. | ||
|
||
## Setup | ||
|
||
- Build Dockerfile | ||
- `docker buildx build --platform linux/amd64 -t gcr.io/nodejs-org/index-generator:latest .` | ||
- Push Docker image to GCR | ||
- `docker push gcr.io/nodejs-org/index-generator:latest` | ||
- Deploy Cloud Run service | ||
- `gcloud run deploy index-generator --image gcr.io/nodejs-org/index-generator:latest --service-account [email protected] --no-allow-unauthenticated --region us-central1` | ||
- If traffic is not routed to the new revision, update the service to send all traffic to the new revision | ||
- `gcloud run services update-traffic index-generator --to-latest --region us-central1` | ||
|
||
[cloud-run-roles-request]: https://github.com/nodejs/build/issues/3774 | ||
[gcloud-auth]: https://cloud.google.com/sdk/gcloud/reference/auth | ||
[gcloud-auth-docker]: https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker | ||
[install-docker-desktop]: https://www.docker.com/products/docker-desktop | ||
[install-gcloud-cli]: https://cloud.google.com/sdk/docs/install | ||
[install-nodejs]: https://nodejs.org/en/learn/getting-started/how-to-install-nodejs |
4 changes: 1 addition & 3 deletions
4
ansible/roles/metrics/files/index-generator/index-generator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# process-cloudflare | ||
|
||
## Prerequisites | ||
|
||
- Ensure that you have following roles on GCP: | ||
- `Cloud Run Developer` | ||
- `Service Account User` | ||
- `Storage Object User` | ||
- Example request: [nodejs/build#3774][cloud-run-roles-request] | ||
- Install [Node.js][install-nodejs]. | ||
- Install [gcloud CLI][install-gcloud-cli]. | ||
- Authenticate using [`gcloud auth`][gcloud-auth]. | ||
- Install [Docker Desktop][install-docker-desktop]. | ||
- Authenticate using [`gcloud auth configure-docker`][gcloud-auth-docker]. | ||
|
||
## Setup | ||
|
||
- Build Dockerfile | ||
- `docker buildx build --platform linux/amd64 -t gcr.io/nodejs-org/processcloudflare:latest .` | ||
- Push Docker image to GCR | ||
- `docker push gcr.io/nodejs-org/processcloudflare:latest` | ||
- Deploy Cloud Run service | ||
- `gcloud run deploy processlogs --image gcr.io/nodejs-org/processcloudflare:latest --service-account [email protected] --no-allow-unauthenticated --region us-central1` | ||
- If traffic is not routed to the new revision, update the service to send all traffic to the new revision | ||
- `gcloud run services update-traffic processlogs --to-latest --region us-central1` | ||
|
||
[cloud-run-roles-request]: https://github.com/nodejs/build/issues/3774 | ||
[gcloud-auth]: https://cloud.google.com/sdk/gcloud/reference/auth | ||
[gcloud-auth-docker]: https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker | ||
[install-docker-desktop]: https://www.docker.com/products/docker-desktop | ||
[install-gcloud-cli]: https://cloud.google.com/sdk/docs/install | ||
[install-nodejs]: https://nodejs.org/en/learn/getting-started/how-to-install-nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# summaries | ||
|
||
## Prerequisites | ||
|
||
- Ensure that you have following roles on GCP: | ||
- `Cloud Run Developer` | ||
- `Service Account User` | ||
- `Storage Object User` | ||
- Example request: [nodejs/build#3774][cloud-run-roles-request] | ||
- Install [Node.js][install-nodejs]. | ||
- Install [gcloud CLI][install-gcloud-cli]. | ||
- Authenticate using [`gcloud auth`][gcloud-auth]. | ||
- Install [Docker Desktop][install-docker-desktop]. | ||
- Authenticate using [`gcloud auth configure-docker`][gcloud-auth-docker]. | ||
|
||
## Setup | ||
|
||
- Build Dockerfile | ||
- `docker buildx build --platform linux/amd64 -t gcr.io/nodejs-org/producesummaries:latest .` | ||
- Push Docker image to GCR | ||
- `docker push gcr.io/nodejs-org/producesummaries:latest` | ||
- Deploy Cloud Run service | ||
- `gcloud run deploy produce-summaries --image gcr.io/nodejs-org/producesummaries:latest --service-account [email protected] --no-allow-unauthenticated --region us-central1` | ||
- If traffic is not routed to the new revision, update the service to send all traffic to the new revision | ||
- `gcloud run services update-traffic produce-summaries --to-latest --region us-central1` | ||
|
||
[cloud-run-roles-request]: https://github.com/nodejs/build/issues/3774 | ||
[gcloud-auth]: https://cloud.google.com/sdk/gcloud/reference/auth | ||
[gcloud-auth-docker]: https://cloud.google.com/sdk/gcloud/reference/auth/configure-docker | ||
[install-docker-desktop]: https://www.docker.com/products/docker-desktop | ||
[install-gcloud-cli]: https://cloud.google.com/sdk/docs/install | ||
[install-nodejs]: https://nodejs.org/en/learn/getting-started/how-to-install-nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters