portkey

Portkey: from REPL to Serverless in one call
viesti 2018-03-17T12:14:18.000012Z

hmm

cgrand 2018-03-17T12:15:58.000165Z

?

viesti 2018-03-17T12:44:45.000069Z

happened to look into Cloudformation (the Yaml format, json used to be quite verbose and not even handcrafted but drawn with an editor leading to awkward layout data intermixed with resource definition)

viesti 2018-03-17T12:47:58.000014Z

the thing seems quite nice, a spec for that would allow some amount of local validation, would need to parse Refs though

viesti 2018-03-17T12:48:27.000002Z

for a moment though of local cloudformation interpreter

viesti 2018-03-17T12:49:03.000021Z

but that scope gets out of hand quick :)

viesti 2018-03-17T12:49:27.000073Z

maybe just trying to get the next goal of portkey

viesti 2018-03-17T12:55:40.000035Z

although there's already some amount of work in github issues also :)

chris_johnson 2018-03-17T14:53:57.000111Z

@viesti If you’re looking to add CloudFormation to portkey in terms of being able to say “and I also want this fn to store its output in a new Dynamo table” or similar …I guess I assume you know about this already, but SAM (https://github.com/awslabs/serverless-application-model) might act as a force multiplier there

cgrand 2018-03-17T15:41:35.000151Z

Should we schedule a hackday?

viesti 2018-03-18T12:55:21.000019Z

If this ia in Finland, we have to have sauna too :)

cgrand 2018-03-18T14:56:59.000065Z

I don’t know if it’s feasible though/if there would be interest

viesti 2018-03-18T18:39:45.000076Z

yeah, can accept sunny place in France too :)

viesti 2018-03-18T18:53:56.000054Z

so hmm, when and where would be next opportunity

cgrand 2018-03-18T20:24:58.000026Z

The feasibility was not on the location but on the idea in general!

🎯 1
cgrand 2018-03-18T20:25:51.000130Z

Next opportunity for? A sabbhacktical week or a hackday?

viesti 2018-03-19T17:54:08.000426Z

Learned a new word, sabbhacktical :)

viesti 2018-03-19T17:58:52.000342Z

For ClojuTre last fall, we did a couple remote idea/knowledge transfer sessions. They might have worked better when at same location

viesti 2018-03-19T18:00:55.000806Z

teleportation doesn't yet exist, so hmm

viesti 2018-03-19T18:02:55.000681Z

at work and at university we used to have codecamps. Work (possibly) and University are good places to gather people together.

viesti 2018-03-20T09:52:56.000409Z

anyways, I don't have any planned travels to conferences yet, excluding ClojuTre (but that doesn't require travel)

cgrand 2018-03-20T09:53:53.000368Z

I know in about one month if I can attend ClojuTRE

viesti 2018-03-20T09:58:06.000036Z

do you have other conference travels before ClojuTre?

cgrand 2018-03-20T09:58:15.000281Z

no

viesti 2018-03-20T09:59:37.000139Z

extreme talk driven development: hackday just before ClojuTre

viesti 2018-03-20T09:59:47.000375Z

maybe I should calm down :)

cgrand 2018-03-20T11:56:51.000043Z

Calmed now?

viesti 2018-03-20T12:07:59.000085Z

enough so that I need more coffee

viesti 2018-03-17T17:08:39.000058Z

@chris_johnson yeah, whipped up a SAM example with two lambdas and one proxy route. Neat to express the configuration in one file (and more can be done). CF wise I guess this is done as a transform that expands into more verbose resource definition.

viesti 2018-03-17T17:09:27.000038Z

no clear thoughts yet though on CF

viesti 2018-03-17T17:09:48.000010Z

but hackday sounds like a good idea!

chris_johnson 2018-03-17T17:42:34.000068Z

Yeah, that’s exactly what it is - the SAM declaration at the top of the template file gets “macro expanded” into a bunch of stuff that is effective but not optimized for developer readability

valtteri 2018-03-17T18:05:42.000018Z

Personally I find even the CF/SAM/ServerlessFramework yaml syntax quite terrible to work with. It would be awesome to be able to manifest AWS infra as Clojure data structures and call a function to deploy it from REPL… 🙂

valtteri 2018-03-17T18:16:02.000089Z

Heh.. Just needed to google for it https://github.com/brabster/crucible

viesti 2018-03-17T18:48:22.000011Z

true for CF data formats not being neat to work with, remembers me of Ansible (Ansible is imperative so even more awkwardness there)

viesti 2018-03-17T19:08:49.000089Z

Python alternative to crucible seems to be troposphere https://github.com/cloudtools/troposphere

viesti 2018-03-17T19:09:47.000043Z

wonder if there are models for CF language, as there are models for AWS API shapes

viesti 2018-03-17T19:10:16.000057Z

thinking spec generation like in aws-clj-sdk

viesti 2018-03-17T19:13:58.000071Z

CF has a service api within AWS so one can distribute the resulting data (ideally) without requiring the consumer to have anything else (say a box for running a tool that interprets the data)

viesti 2018-03-17T19:16:17.000077Z

although I guess a home grown interpreter could do more than the one provided by AWS

viesti 2018-03-17T19:18:08.000079Z

crucible could use aws-clj-sdk to call CF apis to create/update stack

viesti 2018-03-17T19:24:20.000104Z

another idea: keep CF as edn, but allow expansion with tagged literals

cgrand 2018-03-17T19:42:07.000030Z

First hackday was before a talk I gave at clojure berlin (the user group). Second was before clojureD.

cgrand 2018-03-17T19:42:34.000040Z

Somehow we had a hack morning in Helsinki

valtteri 2018-03-17T19:43:59.000035Z

I’ve used Troposphere at work but the Python code tends to get verbose / hacky pretty quickly and it loses the benefit. At the moment my favourite is writing simple, clean and parameterised CF templates by hand. But I’m going to give Crucible a try!

dominicm 2018-03-17T19:49:40.000057Z

For terraform, we do edn-like. There's a postwalk-ish thing done, when we encounter a namespaced key, we call a multimethod with the namespaced key. The arguments are the path to the current location, the whole map as currently resolved, the value of the key, and this context (for us, that's the config file). We use it to do things like project/dns-route "x.t" which then associates a matching route 53 (`(assoc-in whole [:route53-route (last path)] {...})`). We stop when the map stops changing.

valtteri 2018-03-17T19:56:22.000108Z

It would maintain readability but it would still be nice to work with both programmatically and ‘by hand’. Promising! 🙂

cgrand 2018-03-17T20:10:20.000130Z

I have never tried the remote formula.

valtteri 2018-03-17T20:10:58.000033Z

In my case, edn is probably what I actually want. In my early CF-days templates felt overwhelmingly complex and generating the JSON using DSL (Troposphere) felt like a good idea. But after a while I began to “think in CF” and it started to feel more natural to just write the CF directly.

valtteri 2018-03-17T20:13:34.000062Z

I just dislike yaml. And JSON lacks comments etc.

cgrand 2018-03-17T20:14:14.000014Z

At times I entertain the idea of renting a large guest house (or a group of) in a sunny place in France to host some extended hack days/unconf. Family accepted.

viesti 2018-03-17T21:29:07.000105Z

somehow integrant came to my mind, and remembering that Leiningen project.clj has this form ~(fn [here-be-current-project-map] although it's not edn. Saw https://github.com/walmartlabs/dyn-edn, but having whole map as resolved as argument allows access to more data, just thinking how dependencies work... data readers could be relatively easy to do, but to watch out not making edn into a "Clojure" :)