google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
claudiu 2018-03-29T07:38:39.000292Z

Hi, is anybody doing appengine development in clojure ? About to start a clojure gae project targeting the standard Java runtime. I've only built apps appengine with python. Having Clojure->Java makes it a bit harder to get my head around how things should work. Now trying out https://github.com/alpeware/lein-jaq & https://github.com/xlfe/clojure-app-engine

claudiu 2018-03-29T07:40:03.000005Z

There seem to be a few projects out there for gae, but most of them seem old & not maintained 🙂

claudiu 2018-03-29T07:43:15.000166Z

Jaq looks really nice for management & dev-server, but the repl flow seems to be missing. It xlfe/clojure-app-engine just fire a repl and then (start-it) 🙂

domparry 2018-03-29T07:44:03.000277Z

hi there.

domparry 2018-03-29T07:44:07.000278Z

We have done some.

domparry 2018-03-29T07:44:44.000485Z

We have 1 app deployed in app engine.

domparry 2018-03-29T07:45:28.000537Z

but we’re in App engine Flex

domparry 2018-03-29T07:52:56.000251Z

I’m more than happy to share our build scripts and dockerfile stuff with you…

domparry 2018-03-29T07:55:31.000177Z

But basically, what we do is to build an uberjar and use the openjdk jre (v8 at the moment)

domparry 2018-03-29T07:56:33.000406Z

our DockerFile looks like this:

domparry 2018-03-29T07:56:37.000034Z

FROM java:openjdk-8-jre

# Prepare the image.
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y -qq --no-install-recommends wget unzip python php5-mysql php5-cli php5-cgi openssh-client python-openssl && apt-get clean

# Install the Google Cloud SDK.
ENV HOME /
ENV CLOUDSDK_PYTHON_SITEPACKAGES 1
RUN wget <https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip> &amp;&amp; unzip google-cloud-sdk.zip &amp;&amp; rm google-cloud-sdk.zip
RUN google-cloud-sdk/install.sh --usage-reporting=true --path-update=true --bash-completion=true --rc-path=/.bashrc


# Disable updater check for the whole installation.
# Users won't be bugged with notifications to update to the latest version of gcloud.
RUN google-cloud-sdk/bin/gcloud config set --installation component_manager/disable_update_check true

# Disable updater completely.
# Running `gcloud components update` doesn't really do anything in a union FS.
# Changes are lost on a subsequent run.
RUN sed -i -- 's/\"disable_updater\": false/\"disable_updater\": true/g' /google-cloud-sdk/lib/googlecloudsdk/core/config.json


RUN mkdir /.ssh
ENV PATH /google-cloud-sdk/bin:$PATH

ENV PORT 8080

EXPOSE 8080
COPY target/standalone.jar standalone.jar
CMD ["java", "-jar", "standalone.jar"]

domparry 2018-03-29T07:58:03.000144Z

@claudiu: ☝️

domparry 2018-03-29T07:58:22.000350Z

app.yaml looks like this:

domparry 2018-03-29T07:58:43.000466Z

# [START appyaml]
runtime: java
env: flex
service: fulliautomatix
manual_scaling:
  instances: 1

handlers:
- url: /.*
  script: this field is required, but ignored


# [END appyaml]

claudiu 2018-03-29T08:43:17.000457Z

@domparry Thank you for sharing. Trying to see if I can get things rolling in the standard env. Mostly because of billing 😄 running a python website 1k visitors a day for free is nice, should be the same in java

claudiu 2018-03-29T08:44:03.000338Z

Are you also using the datastore & tasks ? Trying to get my head around how the local dev work. So far seems like I have to make a war, unpack and run devserver on that build 🙂

domparry 2018-03-29T08:44:08.000395Z

I was thinking of trying to do the same, but had other priorities to worry about. Please share if you manage to get it going…

domparry 2018-03-29T08:44:18.000472Z

We are using tasks. It works super well.

domparry 2018-03-29T08:44:37.000274Z

I’m using this app to kick off cloud dataflow jobs…

✅ 1
claudiu 2018-03-29T08:45:33.000043Z

nice :slightly_smiling_face: did you get the project with repl to work with _ah/admin ? :slightly_smiling_face:

domparry 2018-03-29T08:46:09.000092Z

I didn’t try to get the repl working for this, because you can’t really repl into a running dataflow pipeline

claudiu 2018-03-29T09:48:12.000454Z

cool. I'm building a webapp. Standard stuff api + server side rendering. Repl really helps 🙂

claudiu 2018-03-29T09:49:47.000461Z

Hi, @alpeware Thank you for open-sourcing jaq 🙂 Noticed there's an https://github.com/alpeware/jaq-example. Any chance the meetup demo was recorded ? 🙂