Fork me on GitHub
#google-cloud
<
2023-03-21
>
Sam12:03:29

I would like to package and clojure server and deploy it to google cloud. Is there a good tutorial to follow? This https://www.metosin.fi/blog/packaging-clojure/ gives a good overview, but I'd love something specific to GCP.

oly15:03:05

I am doing this so may be able to help if you get stuck, the biggest issue you have is the jvm startup time as one of the advantages of google cloud is that it only spins up the instance when it receives a request but the jvm makes this to slow so you need to tick the always running button, unless someone knows something I don't obviously you could potentially use graalvm to get around this.

Sam07:03:30

Thank you! I've been following this: https://hannuhartikainen.fi/blog/clojure-cloud-run/ and it seems to work. It should be getting frequent enough visits that at least one instance is always running.

oly14:03:22

There is this as well for jib https://github.com/atomisthq/jibbit/ not sure what's going on with the repo it was updated yesterday and does not have code maybe a github glitch.

Sam14:03:53

That could potentially be a great resource, as I've run into some issues with the deployment: https://clojurians.slack.com/archives/C053AK3F9/p1679475021306579

Sam14:03:07

But I guess there's no way to get the old code back 😞

slimslenderslacks18:03:15

I’ve been maintaining https://github.com/atomisthq/jibbit/ and honestly, I don’t know how the main branch ref got deleted. But I’ve restored it and added a branch protection rule to it. Super weird.

slimslenderslacks18:03:30

but ya, if you’re using deps.edn, this is one way to package your app. You can use it with GCR or GAR, which will give you the ability to run a container on GKS or CloudRun.

Sam21:03:29

Thank you! I will take a look at it now that it's up. I have no particular preference between deps.edn and leiningen - whichever works is good with me.

lloydshark02:03:59

I recently tried out google cloud run for a minimal clojure webapp using deps and found it pretty smooth. Just back end though, haven't added in any clojurescript yet.