Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update sample configurations for new Flex runtimes #3105

Merged
merged 7 commits into from
Apr 10, 2023
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
8 changes: 6 additions & 2 deletions appengine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Refer to the `README.md` file in the sample folder.

Many samples in this folder can be deployed to both App Engine Node.js standard
environment and flexible environment. Those samples come with two different
App Engine configuration files: `app.flexible.yaml` for flexible environment,
App Engine configuration files: `app.flexible.yaml` for flexible environment Node.js 16 and earlier, `app.flexible_os.yaml` for Node.js 18 and later
and `app.standard.yaml` for standard environment.

Samples with one single configuration file, `app.yaml`, can only be deployed
Expand All @@ -76,9 +76,13 @@ Generally speaking, to deploy a sample application:

gcloud app deploy app.standard.yaml

To deploy to App Engine Node.js Flexible Environment, run
To deploy to App Engine Flexible Environment Node.js 16 and earlier , run

gcloud app deploy app.flexible.yaml

For App Engine Flexible Environment Node.js 18 and later, run

gclooud app deploy app.flexible_os.yaml

For samples with one configuration file (`app.yaml`), run

Expand Down
8 changes: 7 additions & 1 deletion appengine/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ Before you can run or deploy the sample, you need to do the following:
gcloud app deploy app.standard.yaml
```

## Deploying to App Engine flexible Environment
## Deploying to App Engine flexible Environment for Node.js 16 and earlier

```
gcloud app deploy app.flexible.yaml
```

## Deploying to App Engine flexible Environment for Node.js 18 and later

```
gcloud app deploy app.flexible_os.yaml
```


## Running the tests

Expand Down
22 changes: 22 additions & 0 deletions appengine/analytics/app.flexible_os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

runtime: nodejs
env: flex
runtime_config:
operating_system: ubuntu22
runtime_version: 18

env_variables:
GA_TRACKING_ID: YOUR_TRACKING_ID
6 changes: 5 additions & 1 deletion appengine/datastore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ Before you can run or deploy the sample, you need to do the following:

gcloud app deploy app.standard.yaml

## Deploying to App Engine flexible environment
## Deploying to App Engine flexible environment for Node.js 16 and earlier

gcloud app deploy app.flexible.yaml

## Deploying to App Engine flexible environment for Node.js 18 and later

gcloud app deploy app.flexible_os.yaml

## Running the tests

See [Contributing][contributing].
Expand Down
19 changes: 19 additions & 0 deletions appengine/datastore/app.flexible_os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

runtime: nodejs
env: flex
runtime_config:
operating_system: ubuntu22
runtime_version: 18
8 changes: 5 additions & 3 deletions appengine/hello-world/flexible/app.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2017, Google, Inc.
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,7 +15,8 @@
# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex

runtime_config:
operating_system: ubuntu22
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
Expand Down
2 changes: 1 addition & 1 deletion appengine/hello-world/flexible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": "=v16.19.1"
"node": ">=18.x.x"
},
"scripts": {
"start": "node app.js",
Expand Down
7 changes: 5 additions & 2 deletions appengine/metadata/flexible/app.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2016, Google, Inc.
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -13,3 +14,5 @@

runtime: nodejs
env: flex
runtime_config:
operating_system: ubuntu22
2 changes: 1 addition & 1 deletion appengine/metadata/flexible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": "16.x.x"
"node": ">= 18.x.x"
},
"scripts": {
"system-test": "mocha --exit test/*.test.js",
Expand Down
6 changes: 5 additions & 1 deletion appengine/pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ In the current directory, deploy using `gcloud`:

gcloud app deploy app.standard.yaml

To deploy to App Engine Node.js Flexible Environment, run
To deploy to App Engine Node.js Flexible Environment for Node.js 16 and earlier, run:

gcloud app deploy app.flexible.yaml

For App Engine Flexible deployments for 18 and later, deploy via:

gcloud app deploy app.flexible_os.yaml

You can now access the application at https://[your-app-id].appspot.com. You can use the form to submit messages, but it's non-deterministic which instance of your application will receive the notification. You can send multiple messages and refresh the page to see the received message.
20 changes: 20 additions & 0 deletions appengine/pubsub/app.flexible_os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

env_variables:
PUBSUB_TOPIC: YOUR_TOPIC_NAME
# This token is used to verify that requests originate from your
# application. It can be any sufficiently random string.
PUBSUB_VERIFICATION_TOKEN: YOUR_VERIFICATION_TOKEN

19 changes: 19 additions & 0 deletions appengine/static-files/app.flexible_os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

runtime: nodejs
env: flex
runtime_config:
operating_system: ubuntu22
runtime_version: 18
7 changes: 5 additions & 2 deletions appengine/storage/flexible/app.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2015-2016, Google, Inc.
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,6 +15,8 @@
# [START gae_flex_storage_yaml]
runtime: nodejs
env: flex
runtime_config:
operating_system: ubuntu22

env_variables:
GCLOUD_STORAGE_BUCKET: YOUR_BUCKET_NAME
Expand Down
2 changes: 1 addition & 1 deletion appengine/storage/flexible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "mocha system-test/*.test.js --exit --timeout=30000"
},
"engines": {
"node": ">=12.20.0"
"node": ">=18.x.x"
},
"dependencies": {
"@google-cloud/storage": "^6.9.3",
Expand Down