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

Support deploying exploded WAR/JAR for Java11 #1006

Open
yuri-sergiichuk opened this issue Sep 6, 2020 · 10 comments
Open

Support deploying exploded WAR/JAR for Java11 #1006

yuri-sergiichuk opened this issue Sep 6, 2020 · 10 comments

Comments

@yuri-sergiichuk
Copy link

yuri-sergiichuk commented Sep 6, 2020

Currently, the artifact config is waiting for a single JAR/WAR/Binary file to be uploaded, but this constraint has nothing to do with the gcloud app deploy command.

The use case: explode WAR file in order to configure static resources with Java11 application.

I'm referring to the approach described in the docs that allows deploying static files for Spring Boot uber-jar app: https://cloud.google.com/appengine/docs/standard/java11/serving-static-files#configuring_your_static_file_handlers

@loosebazooka
Copy link
Contributor

@ludoch is this a supported runtime on appengine right now?

@yuri-sergiichuk
Copy link
Author

@loosebazooka AppEngine 11 is GA since October 2019. We're actively using the Gradle plugin for a couple of years already and it was a bit disappointing that the YAML part is much less powerful.
Jetty-related staging configs really made a difference and now I'm struggling to find a somewhat usable Gradle plugin to create the effective web.xml for Jetty and to explode the WAR to prepare the static resources.

@loosebazooka
Copy link
Contributor

Appegine 11 doesn't support war deployments as far as I can recall. Exploded war deployments are a Java 8 only feature.

@yuri-sergiichuk
Copy link
Author

yuri-sergiichuk commented Sep 7, 2020

AppEngine 11 supports custom entry points. And as far as I understood, if one wants to use the static_files, these static files should be available in the staged folder, so the custom entry point is the only solution.

So, if you have either a fat Jar or a .jar runner with a .war archive nearby, you'll not be able to use static_files.

In our case, we have a jetty-runner .jar with our .war application. So, what I'm willing to achieve is to explode the .war file into the staging folder and configure static_files with part of the .war file.

@loosebazooka
Copy link
Contributor

Right, at that point you're running an arbitrary container on appengine. Which is fine, but it's not a standard workflow for this plugin. But you are right, there is space for better static file support.

@yuri-sergiichuk
Copy link
Author

Yep. But it looks like with the currently supported workflow the static files are not supported at all for yaml-based deployments?

Could you please suggest some workaround?

@loosebazooka
Copy link
Contributor

Hrmm.. @saturnism I know we can probably do some work here? Any suggestions in the meantime?

@yuri-sergiichuk
Copy link
Author

@loosebazooka @saturnism are there any updates or suggestions on how to make it easier for developers to work with the static files? I would really appreciate some while we're moving forward with our migration to App Engine 11.

@loosebazooka
Copy link
Contributor

Well I think the static files can be supported, just not automatically as they were in java8 (since that was a well defined workflow).
I think it might be require more than a trivial amount of work. You would have to do it in your app.yaml directly using the handlers sub section. You can take a look at what the java8 staging does to fill this out.

Let me try to find some other people that can help document this. @ludoch @eamonnmcmanus ?

@saturnism
Copy link

eak! thnx for the ping. i totally missed this.

There are several ways to do this, but at the end of the day, the static files needs to be exploded within the app engine deployment directory, and then in app.yaml file, specify the static_files section.

Here is @ludoch's example handlers section for JHipster uberjar deployment:
jhipster/generator-jhipster#10331 (comment)

@JoeWang1127 JoeWang1127 transferred this issue from GoogleCloudPlatform/app-gradle-plugin Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants