google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
qqq 2017-02-25T00:49:00.001164Z

has anyone here used GAE together with Google Drive API ? I want to store user uploaded data to Google Drive (which I don't pay for) instead of Google Cloud (which I do pay for). I don't care that the user can upload/edit/delete the data -- it's the user's own documents anyway.

qqq 2017-02-25T04:55:55.001165Z

is there a nice way to structure code so it says: use gae remote when not running on gae servers, and use standard gae api when on gae servers?

qqq 2017-02-25T05:40:21.001166Z

I'm finding gae to be way too restrictive and need ot switch to GCE. What do I lose in terms of auto scaling / other things I now have to take care of once I switch to GCE? (it's just GCE + bare bones ubuntu + java)

qqq 2017-02-25T08:04:51.001167Z

========= when doing a deploy with 89 jars totalling 44M, is it normal for appcfg_update.sh . to take 9 fucking minutes ? (9 minutes 18 seconds to be precise)

domparry 2017-02-25T19:41:57.001168Z

@qqq I haven’t used the Drive API, but we moved to GKE. Once you wrap your head around it, it’s awesome. You can still set the autoscaling however you like. I haven’t dived into autoscaling GCE, but apparently you can. The other things you lose if you leave GAE are things like caching, A/B testing out the box, and I think some multi-zone redundancy.

2017-02-25T19:43:40.001170Z

@qqq sometimes it takes 9 stinkin' minutes, other times 9 damn minutes. it varies.

2017-02-25T19:44:54.001171Z

can you split into multiple services? you can upload services separately.

qqq 2017-02-25T23:17:51.001172Z

now that we have established I'm doing it wrong

qqq 2017-02-25T23:17:58.001173Z

can you please explain to me how boot-gae does the reload thing?

qqq 2017-02-25T23:18:17.001174Z

in particular, when using boot-gae, when I modify a *.clj file, what is the step by step process which leads to the local gae server running the new servlet?

2017-02-25T23:23:35.001175Z

what do you mean by "new servlet"? yes, if you add a new servlet you must reboot. since that is rare, i make no special accomodations for it- just start over.

2017-02-25T23:24:42.001176Z

but modifying the code for an existing servlet is another story.

qqq 2017-02-25T23:25:51.001177Z

I have a servlet hello.clj, on an incoming request, it says "Hello mobileInk" I modify hello.clj so that on incoming requests, it says "Hi mobileInk" in boot-gae, after I modify the hello.clj, what happens to cause the local gae server to now respond with "Hi mobileInk" ?

2017-02-25T23:30:46.001178Z

ok. you have to grok gen-class. the :impl thingie allows you to delegate java method calls to clojure fns. run boot-gae with --keep to retain the transient stuff.

qqq 2017-02-25T23:31:03.001179Z

I know how to use gen-class.

qqq 2017-02-25T23:31:28.001180Z

My problem is: after hello.clj is modified, how does jetty reload it? My understanding is: 1) modify hello.clj 2) a new hello$blah.class is generated 3) we need to tell jetty to reload it

qqq 2017-02-25T23:31:36.001181Z

(2) = aot (3) = touch appengine-web.xml

2017-02-25T23:32:45.001182Z

once you have gen-class sth, with the :impl-ns or whatever (going fron weak mem),

2017-02-25T23:34:00.001183Z

then the gen-classed thingie will fwd method calls to your clojure fns.

2017-02-25T23:35:03.001184Z

so you can change you clojure fns without recompiling your gen-classcthibgie.

2017-02-25T23:36:01.001185Z

NO! jetty does not reload it, clojure reloads it!

2017-02-25T23:37:03.001186Z

obviously i need to write a blog article explaining all this.

qqq 2017-02-25T23:39:33.001187Z

ah, I see;

my approach =
  hello.clj -> hello.class -> jetty runs hello.class
  when hello.clj changes, generate new hello.class, jetty has to reload

your approach =
  create a hello_wrapper.class -> jetty runs hello_wrapper.class
  when hello.clj changes, hello_wrapper.class reloads the new hello.clj
in a high level, is the above true?

2017-02-25T23:39:45.001188Z

gen-class is clearly under-explained and under-appreciated!

2017-02-25T23:42:17.001189Z

well, it's not my approach, it's just the way gen-class works.

2017-02-25T23:43:21.001190Z

there is no wrapping. think "delegation".

qqq 2017-02-25T23:44:21.001191Z

how do you run the local gae server? for me, I create a war directory, and I run dev_appserver.sh path-to-war how are you starting it?

2017-02-25T23:46:35.001192Z

see the code in boot-gae. 😉

2017-02-25T23:48:16.001193Z

but based on this conversation, i am convinced i need to write a detailed article on how gen-class works.

2017-02-25T23:50:30.001194Z

regarding your guess above (my aaproach, your approach): no.

2017-02-25T23:51:48.001195Z

there are no "wrappers" for servlets in boot-gae.