Skip to content

Commit

Permalink
000 gcr readme update (#206)
Browse files Browse the repository at this point in the history
+ adds all options to cloud run's readme, let's discuss which ones to
leave out if they're not relevant.
  • Loading branch information
TriPSs authored Jan 7, 2024
2 parents 568811d + e2ea0b6 commit d2e79b8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
35 changes: 24 additions & 11 deletions packages/gcp-cloud-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,27 @@ npm install -D @nx-extend/gcp-cloud-run

#### Available options:

| name | type | default | description |
|------------------------------|-----------|------------------|------------------------------------------------------|
| **`--site`** | `string` | `null` | specify the site to deploy from the `.firebase.json` |
| **`--region`** | `string` | | region to deploy to |
| **`--project`** | `string` | | GCP project to deploy to |
| **`--name`** | `string` | `project.prefix` | name of the cloud run instance |
| **`--allowUnauthenticated`** | `boolean` | `true` | allow unauthenticated requests |
| **`--concurrency`** | `number` | 250 | amount of concurrent requests for instance |
| **`--maxInstances`** | `number` | 10 | maximum amount of instances |
| **`--minInstances`** | `number` | 0 | minimum amount of instances |

| name | type | default | description |
|----------------------------------|----------------------|------------------|-------------------------------------------------------------------------|
| **`--region`** | `string` | - | Region to deploy cloud run revision to.
| **`--project`** | `string` | - | GCP project to deploy cloud run revision to.
| **`--name`** | `string` | `project name` | Name of the cloud run revision.
| **`--concurrency`** | `number` | 250 | Maximum number of concurrent requests allowed per container instance.
| **`--maxInstances`** | `number` | 10 | Maximum number of container instances to run.
| **`--minInstances`** | `number` | 0 | Minimum number of container instances to run.
| **`--allowUnauthenticated`** | `boolean` | `true` | Whether to allow unauthenticated requests to cloud run service.
| **`--envVars`** | `{[k: string]: string}` | - | Environment variables to load into cloud run instance's environment.
| **`--secrets`** | `string[]` | - | Secrets to load into cloud run instance's environment.
| **`--memory`** | `string` | `128Mi` | Amount of memory to reserve for cloud run instance.
| **`--cloudSqlInstance`** | `string` | - | Name of the cloud SQL instance to connect to run instance.
| **`--http2`** | `boolean` | `false` | Whether or not to enforce run instance to use HTTP/2 for all end-to-end connections.
| **`--serviceAccount`** | `string` | - | Service account email of another identity if not using compute engine's default service account.
| **`--buildWith`** | `string` | `artifact-registry` | Only accepts value `artifact-registry`. ***If provided***, deploy is ran with the `--source` options set to current app's directory. ***If not provided***, submits a build to Cloud Build, sourcing app's dist directory. Deploy is then ran using `--image`, which is given the location of the previous Cloud Build's built image.
| **`--logsDir`** | `string` | - | ***Note***: only relevant if not specifying `--buildWith`. Directory in GCS where to hold Cloud Build's build logs.
| **`--tagWithVersion`** | `string` | - | Whether or not to tag run service with a version. (**note**: sources version from package.json)
| **`--noTraffic`** | `boolean` | `false` | Set to true to ensure cloud run avoids sending traffic to the revision being deployed.
| **`--revisionSuffix`** | `boolean` | `false` | Set to append to deployed revision's name.
| **`--timeout`** | `number` | - | set the maximum request execution time.
| **`--cpu`** | `number` | - | set a CPU limit in Kubernetes cpu units.
| **`--cpuBoost`** | `boolean` | - | Whether to allocate extra CPU to containers on startup to reduce the perceived latency of a cold start request.
| **`--ingress`** | `string` | - | Set the ingress traffic sources allowed to call the service.
11 changes: 0 additions & 11 deletions packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export async function deployExecutor(
revisionSuffix = false,
buildWith = 'artifact-registry',
autoCreateArtifactsRepo = true,
generateRepoInfoFile = false,
timeout = null,

cpu,
Expand Down Expand Up @@ -118,16 +117,6 @@ export async function deployExecutor(
return { success: false }
}

if (generateRepoInfoFile) {
logger.info('Generating repo info file')

execCommand(buildCommand([
'gcloud debug source gen-repo-info-file',
`--source-directory=${sourceRoot || './'}`,
`--output-directory=${distDirectory}`
]))
}

const deployCommand = buildCommand([
`gcloud run deploy ${name}`,
!buildWithArtifactRegistry && `--image=${containerName}`,
Expand Down
1 change: 0 additions & 1 deletion packages/gcp-cloud-run/src/executors/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface ExecutorSchema {
buildWith?: 'artifact-registry'
autoCreateArtifactsRepo?: boolean
noTraffic?: boolean
generateRepoInfoFile?: boolean
timeout?: number
cpu?: number
cpuBoost?: boolean
Expand Down

0 comments on commit d2e79b8

Please sign in to comment.