I am trying to deploy the app.yaml file to appengine flexible.
Here is my app.yaml file
runtime: java
env: flex
manual_scaling:
instances: 1
handlers:
- url: /.*
script: this field is required, but ignored
secure: always
runtime_config: # Optional
jdk: openjdk8
server: jetty9
resources:
cpu: 0.5
memory_gb: 0.18
disk_size_gb: 10
I am trying to deploy it with this command:
gcloud app deploy app.yaml --verbosity=debug
And this is the error I get:
DEBUG: No staging command found for runtime [java] and environment [FLEX].
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta
Building and pushing image for service [my-service]
DEBUG: Could not call git with args ('config', '--get-regexp', 'remote\\.(.*)\\.url'): [Error 2] The system cannot find the file specified
INFO: Not checking for [Custom] because runtime is [java]
INFO: Not checking for [Go] because runtime is [java]
INFO: Not checking for [Ruby] because runtime is [java]
INFO: Not checking for [Node.js] because runtime is [java]
INFO: Checking for Java.
INFO: Not checking for [Python Compat] because runtime is [java]
INFO: Not checking for [Python] because runtime is [java]
INFO: Not checking for [PHP] because runtime is [java]
DEBUG: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 742, in Execute
resources = args.calliope_command.Run(cli=self, args=args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 739, in Run
resources = command_instance.Run(args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\app\deploy.py", line 59, in Run
return deploy_util.RunDeploy(args)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 413, in RunDeploy
all_services)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 241, in Deploy
new_version, service, source_dir, image, code_bucket_ref)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 176, in _PossiblyBuildAndPush
code_bucket_ref, self.deploy_options.use_runtime_builders)
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 206, in BuildAndPushDockerImage
gen_files.update(_GetDockerfiles(service, source_dir))
File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 139, in _GetDockerfiles
'again.'.format(info.runtime))
UnsatisfiedRequirementsError: Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again.
So it ends up not deploying the app.yaml. However, if I run this command:
gcloud app deploy cron.yaml
It will work just fine.
The app. yaml file defines your configuration settings for your runtime as well as general app, network, and other resource settings.
The handlers element is a required element in the app. yaml configuration file. The element provides a list of URL patterns and descriptions of how they should be handled. App Engine can handle URLs by executing application code, or by serving static files uploaded with the code, such as images, CSS, or JavaScript.
The standard environment can scale from zero instances up to thousands very quickly. In contrast, the flexible environment must have at least one instance running for each active version and can take longer to scale up in response to traffic. Standard environment uses a custom-designed autoscaling algorithm.
Do not add app.yaml to the .gcloudignore file. app.yaml might be required for deployment, and adding it to .gcloudignore will cause the deployment to fail. The syntax of the app.yaml file is the YAML format .
The app.yaml file defines your configuration settings for your Go runtime as well as general app, network, and other resource settings. For more information and an example, see Defining Runtime Settings .
You can specify a unique name for your app.yaml files, but then you must specify the file name with the deployment command as well. For example, if you name your app.yaml file service-name-app.yaml or app.flexible.yaml, then you must deploy your app using either:
A Java app in App Engine is configured using an app.yaml file, that contains CPU, memory, network and disk resources, scaling, and other general settings including environment variables. You can select the Eclipse Jetty 9.3 Runtime or the Java 8 Runtime .
Yeah, this is a gap right now :/ You can't actually deploy a Java app to App Engine flexible via gcloud app deploy
. You need to use the Maven or Gradle plugins.
Sorry for the trouble!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With