google-cloud

Sam 2023-03-21T12:39:29.227599Z

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.

lloydshark 2023-03-25T02:57:59.097339Z

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.

Sam 2023-03-23T14:48:22.669389Z

This worked right out of the gate: https://github.com/metosin/packaging-clojure-examples/tree/master/lein

slimslenderslacks 2023-03-23T18:51:15.867259Z

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.

slimslenderslacks 2023-03-23T18:54:30.675899Z

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.

Sam 2023-03-23T21:57:29.585949Z

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.

Sam 2023-03-22T07:36:30.994749Z

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.

oly 2023-03-22T14:14:22.768749Z

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.

Sam 2023-03-22T14:15:53.117799Z

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

Sam 2023-03-22T14:16:07.925999Z

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

Sam 2023-03-21T12:41:14.692779Z

Also https://circleci.com/blog/deploying-clojure-applications-to-google-cloud/ seems promising

oly 2023-03-21T15:55:05.384029Z

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.