Score:0

Is there way to specify more resources for Google App Engine during build stage?

sa flag

Let me start with context. I have react app that takes around 8192MB to during build. Deployment to GAE has been failing as fax memory we can have is 3072 MB (using instance_class: F4_1G).

I was wondering we can we specify more resources during build on GAE deployment? After build app can run in smaller server like F2 (768 MB).

Score:0
kr flag

I would suggest to use the Google App Engine Flex Flexible Environment. This has an option to configure all the resource settings in app.yaml.

For example you can check this configuration:

resources:
  cpu: 2
  memory_gb: 2.3
  disk_size_gb: 10
  volumes:
  - name: ramdisk1
    volume_type: tmpfs
    size_gb: 0.5

You can increase your memory_gb, cpu, and disk_size_gb.

To learn more about app.yaml configuration file check this documentation

Hope it helps

Krishna Sunuwar avatar
sa flag
Hi thanks for answer. Let me explain my need 1) higher resources during build, 2) normal server like F1 or F2 after deployment.
Score:0
sa flag

Seems GAE doesn't have option to define higher resources during build and change that after. Besides that GAE is max F4_1G (3072 MB, 2.4 GHz). So I decided on a different approach.

  1. Use cloud build to build (where we can provision machines with higher resources)
  2. on app.yaml, override standard npm build with blank.

So my cloudbuild.yaml looks like:

    steps:
      - name: 'node:14.21-buster'
        entrypoint: 'npm'
        args: ['install']
      - name: 'node:14.21-buster'
        entrypoint: 'npm'
        args: ['run', 'build']
        env:
          - NODE_OPTIONS=--max-old-space-size=8192
          - GENERATE_SOURCEMAP=false

      .... MORE STEPS HERE .....

      - name: 'gcr.io/cloud-builders/gcloud'
        entrypoint: 'gcloud'
        args: ['app', 'deploy']

    substitutions:
      _CLOUDSDK_COMPUTE_ZONE: us-central1-c
      _CLOUDSDK_COMPUTE_REGION: us-central1

    options:
      machine_type: E2_HIGHCPU_8

app.yaml looks like:

    runtime: nodejs14
    build_env_variables:
      GOOGLE_NODE_RUN_SCRIPTS: '' # prevent running npm run build on GAE
    entrypoint: node server/server.js
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.