google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
qqq 2017-01-20T00:02:20.000423Z

======================== @mobileink : so now, the thing that @nickbauman and I want (which I think you also want is): when deplying to remote cloud gae server, can we do this faster than 10-20 seconds? and the answer, we believe is "yes" -- because gae jvm allows you to run clojure's eval so the idea is: new way of deploying to gae cloud 1) take all your clj files 2) store the clj files in datastore/storage 3) when the server needs to run a handler, it (1) pulls clj files from datastore/storage -- and evals it on the fly this of course, is too ezpensive for production, but fine for "testing on remote cloud gae"

2017-01-20T00:18:13.000424Z

ok, i'm trying to digest the lambda-startup thing. looks like it runs a jetty that is not the official gae jetty.

qqq 2017-01-20T00:18:33.000425Z

in my understanding, it's about doing two things:

2017-01-20T00:18:52.000426Z

boot-gae never does that.

qqq 2017-01-20T00:19:02.000427Z

boot-gae never does what ?

2017-01-20T00:19:12.000428Z

only the official stuff.

2017-01-20T00:19:45.000429Z

i.e. to test you run the googly devserver.

qqq 2017-01-20T00:20:13.000430Z

with lambdastartup, you also run the "googly devserver" with all it's stubs for datastore/storage/....

2017-01-20T00:20:42.000431Z

regarding deployment, i'm not sure i see the problem.

qqq 2017-01-20T00:20:46.000432Z

the "googly devsever" provides some code for simulating APIs, but afaik is not in itself a jetty server

qqq 2017-01-20T00:21:33.000433Z

deployment: some ppl, myself included, don't like wiating 20 seconds for the WAR to package then naother 10 seconds for google to restart the jvm -- just to test it on the actual gae cloud server

2017-01-20T00:21:35.000434Z

the devserver, like the prod server, is a jetty derivative.

qqq 2017-01-20T00:23:10.000435Z

hmm, at this point, I should probably study boot / migae before making more comments

qqq 2017-01-20T00:23:17.000436Z

as I feel like I'm misunderstanding fundamentals

2017-01-20T00:23:36.000437Z

i think we might be tslking past each other. to me, you deploy rarely. get it right in dev/test, then deploy. so its not a productivity issue, to me.

✅ 1
qqq 2017-01-20T00:25:05.000438Z

a while back, I had this crazy bug where things worked fine in local/dev but always died on cloud/gae ... and after that, I wanted "faster deploy" ever since, -- since deploy time was my ottleneck

2017-01-20T00:29:40.000439Z

all the other gae solutions i've seen (not sayig i've seen them all) aot everything and (sometimes) use sth other the google-supplied devserver for local dev testing. boot-gae was partially inspired by the desire to always use the google devserver, and only aot compile what is necessary, not everything.

2017-01-20T00:30:42.000440Z

i'm not understanding why deploy time is a problem.

2017-01-20T00:31:23.000441Z

you should not deploy sth unless you already know it's good, no?

nickbauman 2017-01-20T00:32:33.000442Z

Yeah my concern had always been in developer flow locally. Once in a blue moon I have a test that passes locally but the code fails in the cloud.

2017-01-20T00:33:05.000443Z

if you're deploying to test, then you're doing it wrong. boot-gae helps you get it right before you deoloy (in theory).

qqq 2017-01-20T00:33:57.000444Z

I don't buy that argument; if I could have my cider repl connected to remote-cloud-gae insta4d of local-dev, I would.

2017-01-20T00:35:00.000445Z

@nickbauman yes, this can happen. the local test env is unfortunately not quite an exact replica of the prod wnv.

2017-01-20T00:38:33.000446Z

@qqq can you elaborate? when i dev a gae thing cider is largely irrelevant. you're scaring me again; i intuit that i'm about to find out that i've been doing it all wrong. which would not be a new thing.

qqq 2017-01-20T00:42:48.000447Z

@mobileink : at this point, it's clear both you and nickbauman know much more about GAE than I do; so I don't think you're doing anything wrong when developing, I like being connected to a live repl ;; right now, I can only be connected to my local-dev ;; in a hypothetical world where I could run nrepl on gae (we can't), I'd love to have my cider directly talking to the nrepl on gae

2017-01-20T00:47:14.000448Z

@qqq ok, but you're a great test case ;). one point that may not be clear: there is no genuine REPL in gae dev. But there is a quasi-REPL, at least in boot-gae: edit code, save changes, refresh page, see changes. that's not so bad, is it?

2017-01-20T00:53:27.000449Z

of course, tmyou might be able to enbed an nrepl thingie in your app, but that's a whole 'nother story.

qqq 2017-01-20T00:56:48.000450Z

there is genuine repl for local-dev-gae -- that's what the lambda startup page achieves, but I do agree there's no repl for remote-cloud-gae

2017-01-20T00:58:02.000451Z

@qqq you said "a while back, I had this crazy bug where things worked fine in local/dev but always died on cloud/gae". it would be useful to have more info. in particular, what exactly does "local/dev" mean? a third party server, or the gae devserver?

qqq 2017-01-20T00:59:43.000452Z

local/dev = running on localhost, the google dev app server thingy remote/cloud = running on google cloud

qqq 2017-01-20T01:00:21.000453Z

in particular, my bug was: requesting /ah/_start = causes the jvm to throw an exception and die so on localhost, everything worked fine on google cloud -- google checks if the jvm is up yet -- and kills the jvm in the processes

qqq 2017-01-20T01:00:27.000454Z

took me an afternoon to figure out wtf was going on

2017-01-20T12:14:14.000455Z

i took a look at http://lambda-startup.com/developing-clojure-on-app-engine/ and as I suspected, to get repl-like behavior it is running Jetty, not Google’s devserver. That means it has to mock stuff that the devserver already does. I definitely wanted a solution that uses the devserver. the techniques boot-gae uses eliminate the need to restart to eval changed code, but still use the devserver.

2017-01-20T13:39:39.000457Z

FYI a blog post on boot-gae: http://blog.mobileink.com/2017/01/building-clojure-apps-on-google-app.html

2017-01-20T16:10:27.000459Z

@qqq, @nickbauman it may be possible to embed an nrepl server in a gae app using https://github.com/cemerick/drawbridge/blob/master/README.md. haven't tried it myself.

✅ 1
nickbauman 2017-01-20T16:12:34.000461Z

It's funny but the Python SDK has allowed interaction with your cloud service through the remote API for almost a decade.

2017-01-20T16:13:26.000463Z

link?

nickbauman 2017-01-20T16:14:46.000465Z

I don't think this exists on the Java side though.

nickbauman 2017-01-20T16:22:08.000466Z

For Python projects, I use (and maintain) this library: https://github.com/agostodev/substrate You can connect to your project with it using a simple command in the root of your project, like so: ./manage.py rshell Note, however, the code that executes is your local codebase, not the remote, so it’s kinda dangerous.

2017-01-20T16:31:01.000468Z

https://cloud.google.com/appengine/docs/java/tools/remoteapi. but that's not a repl.

✅ 1
qqq 2017-01-20T16:32:01.000469Z

@mobileink : drawbridge is very nice, but I thikn gae assumes it can kill / restart jvms at will

qqq 2017-01-20T16:32:12.000470Z

which would mean all def/local bindings would vanish

2017-01-20T16:37:20.000471Z

you can run a resident instance, see https://cloud.google.com/appengine/docs/java/how-instances-are-managed

nickbauman 2017-01-20T20:31:53.000472Z

@kurtc