3

I am trying to deploy an Helidon MP project to Google Cloud App Engine using java11 runtime but having trouble to define the app.yaml properly.

  1. Tried to deploy the jar file directly using the below app.yaml using the command $ gcloud app deploy cord.jar. The app gets deployed but empty page on view.

    runtime: java11
    entrypoint: 'java -jar cord.jar'    
    
  2. Tried to modify the codewbase adding appengine\app.yaml to <project>\src\main\appengine\app.yaml and with contents as below and using command $ gcloud app deploy pom.xml:

    runtime: java11
    instance_class: F1
    

In all cases, the app got deployed but page loads empty.

enter image description here

They have examples on github but unfortunately not yet with Helidon.

Suren Konathala
  • 3,497
  • 5
  • 43
  • 73

3 Answers3

2

I've put together an example for Helidon.

A couple things to note:

  1. Make sure your application obeys the PORT environment variable, and configures its server to use that port.
  2. Make sure your app.yaml is in the same directory as your jar and defines a custom entry point. For example:
runtime: java11
entrypoint: java -Xmx64m -jar helidon-quickstart-se.jar

Helidon uses "thin" jars and App Engine seems to handle this AOK as mentioned here: https://cloud.google.com/appengine/docs/standard/java11/runtime#application_startup

Barchetta
  • 251
  • 2
  • 4
1

There is a github thread regarding this and so far the current workaround is to add an app.yaml file similar to the one for the frameworks like Spring Boot or Vert.x

I have followed the tutorial where the github sample of the other responses is and it worked for me.

First I have cloned the repository and I used the quickstart mp:

git clone https://github.com/barchetta/helidon-google-app-engine-example/
cd helidon-google-app-engine-example/helidon-quickstart-mp

Then I have built and run the application and check if the port responds.

mvn package
export PORT=8888
java -jar target/helidon-quickstart-mp.jar

After all these previous steps I was able to see in localhost the result of the application.

For deploying I created the app.yaml file named "helidon-mp-app.yaml" and wrote this configuration inside:

runtime: java11
entrypoint: java -Xmx64m -jar helidon-quickstart-mp.jar

And copied it to the target/ directory:

cp helidon-mp-app.yaml target/

As the last configuration file, the file ".gcloudingonre" which also needs to be moved to target/

# Exclude everything. Then include just the app jar and runtime
# dependencies in libs/
*
*/
*/**
!helidon-quickstart-mp.jar
!libs/
!libs/**

Then as all the configuration files are ready, I executed

gcloud app deploy target/helidon-mp-app.yaml
gcloud app browse

And appending "/greet" in the URL we can see the result:

{"message":"Hello World!"}

iker lasaga
  • 330
  • 1
  • 3
  • 18
1

As an answer to my question.. issue for the page not loading was because of port 9090 that we were using (defined in src/main/resources/META-INF/microprofile-config.properties file). After i changed it to default 8080, my app worked.

microprofile-config.properties:

# Application properties. This is the default greeting
app.greeting=Hello

# Microprofile server properties
server.port=8080
server.host=0.0.0.0

References:

  1. Helidon MP example for Google App Engine
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73