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

Deploying google cloud function as a JAR with gen2 #260

Open
fancywriter opened this issue Jan 3, 2024 · 0 comments
Open

Deploying google cloud function as a JAR with gen2 #260

fancywriter opened this issue Jan 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request P2

Comments

@fancywriter
Copy link

Hello!
I tried to follow this tutorial to deploy JAR without any sort of Maven/Gradle plugins (was going to try both uber and thin, so far thin with "hello world" code worked).
https://cloud.google.com/functions/docs/concepts/java-deploy#build_and_deploy_an_uber_jar

However, if I add --gen2 option, it doesn't seem to work.

$ gcloud functions deploy gcloud-functions-example-gen2 --gen2 --runtime=java17 --source=./deployment/ --entry-point com.example.HelloHttpFunction --trigger-http --region europe-west1 
ERROR: (gcloud.functions.deploy) Invalid value for [--source]: Provided source directory does not have file [pom.xml] which is required for [java17]. Did you specify the right source?

It complains about mission pom.xml, which I obviously do not have, I have only

$ ls deployment/
gcloud-functions-example.jar
$ jar -tf deployment/gcloud-functions-example.jar 
META-INF/MANIFEST.MF
com/
com/example/
com/example/HelloHttpFunction.class
com/example/HelloHttpFunction.tasty

Is this not supported for gen2 deliberately or could it be a bug/missing feature?

What I wish eventually is to deploy thin JAR with only my code with changes often... using some fat libraries which change rarely. Is this even possible? Documentation page was not 100% clear about that. It says that I have to add line to Manifest

Class-Path: libs/dep1.jar libs/dep2.jar

What happens with these two lib/dev1.jar and lib/dev2.jar files? Are they deployed just once and reused on further redeployments? Are they redeployed if their checksum is changed (let's say if I upgrade library)?

@kenneth-rosario kenneth-rosario added bug Something isn't working P2 enhancement New feature or request labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request P2
Projects
None yet
Development

No branches or pull requests

3 participants