portkey

Portkey: from REPL to Serverless in one call
cgrand 2018-03-06T16:44:26.000084Z

an ironic ❤️

viesti 2018-03-06T16:45:20.000627Z

HAL seems to gather those types of ❤️

cgrand 2018-03-06T16:46:20.000431Z

that’s the “good” old decision (for output) to state that 1-items lists can be simplified to the item alone

viesti 2018-03-06T16:48:31.000138Z

haa

cgrand 2018-03-06T16:53:33.000879Z

This decision has so many benefits: • when looking at samples you may overlook the fact that you may get several values for a field • if simplification is mandatory (or coder is mislead) then code outputting this stuff gets more complex because of a branch to check of there’s only one item • reader code has to deal with both cases all of these for saving two chars!

stathissideris 2018-03-06T16:55:48.000826Z

@cgrand I just discovered aws-clj-sdk, thanks for the good work! I noticed that only a subset of the SDK is currently supported. Since you have machine-readable descriptions to generate from, what’s preventing you from supporting everything?

viesti 2018-03-06T16:56:14.000547Z

xml?

viesti 2018-03-06T16:56:18.000086Z

🙂

stathissideris 2018-03-06T16:56:44.000234Z

and another question: I noticed you’re generating specs as well, could that lead to a good way of mocking AWS services for testing some day?

viesti 2018-03-06T16:57:51.000549Z

I guess mocking the data is one part, but testing against state and side-effects (some APIs don’t reflect changes immediately) is another thing to consider

cgrand 2018-03-06T16:58:34.000516Z

@stathissideris AWS services do not all use the same protocol, so you have to write a code generator for each protocol. Most of the time a generator|portocol is used by many services.

stathissideris 2018-03-06T16:58:39.000833Z

@viesti yes, I sure it’s not as easy as having specs for the API, but it’s a good basis I guess!

viesti 2018-03-06T16:58:41.000342Z

there’s https://github.com/juxt/mach but it doesn’t have the concept of state tracking like Terraform

cgrand 2018-03-06T16:59:21.000468Z

@baptiste-from-paris is working on the query protocol atm

viesti 2018-03-06T17:00:06.000231Z

haven’t actually used Mach (read: have not forced my colleagues to it :)) but should have another look, it can be used to make playing with Terraform nicer

stathissideris 2018-03-06T17:00:08.000122Z

@cgrand understood! that explains the “protocol” issues on github

viesti 2018-03-06T17:01:15.000205Z

a propos, was briefly looking at https://github.com/portkey-cloud/aws-clj-sdk/issues/8, seems that https://search.maven.org/#artifactdetails%7Ccom.amazonaws%7Caws-java-sdk-models%7C1.11.289%7Cjar contains models, but didn’t find partitions

stathissideris 2018-03-06T17:02:00.000768Z

@viesti yeah, I know about mach, but I’m thinking stand-alone clojure. Also terraform does not support the whole of AWS, it sounds like aws-clj-sdk some day will

cgrand 2018-03-06T17:02:45.000152Z

on specs: before a hiatus in dev I was working in splitting/refining generated specs

viesti 2018-03-06T17:03:17.000780Z

yeah, the goal is to find a nice description of stuff in AWS as data and then a way to put that data into the APIs

cgrand 2018-03-06T17:04:13.000319Z

see branch wip-before-end-of-2017

viesti 2018-03-06T17:04:45.000381Z

at some point I was toying with the idea of using weavejester’s integrant for defining the aws stack, as if to start/stop services with it

stathissideris 2018-03-06T17:05:17.000041Z

@viesti haha, that blew my mind a little 🙂

stathissideris 2018-03-06T17:05:41.000222Z

but then you’d have to persist the system structure somehow

cgrand 2018-03-06T17:06:05.000099Z

@stathissideris so all that is missing is someone willing (and having time) to tackle these protocols

stathissideris 2018-03-06T17:06:08.000460Z

because you want your clojure program to stop at some point without taking the remote stack with it

viesti 2018-03-06T17:07:42.000223Z

might end up with something like terraform, having previous state persisted somewhere, being able to diff it, and use this “lib” as a way to start new parts

stathissideris 2018-03-06T17:07:44.000925Z

@cgrand yeah, makes sense…

stathissideris 2018-03-06T17:08:32.000176Z

yeah I suspect when all protocols are in place, basic terraform-like functionality is a short hop

stathissideris 2018-03-06T17:09:01.000745Z

but then you have the problem of sharing the infrastructure state between multiple operators, locking etc

stathissideris 2018-03-06T17:10:05.000319Z

(terraform does it with dynamobdb and s3)

valtteri 2018-03-06T17:10:29.000618Z

What’s wrong with CloudFormation? 😮

stathissideris 2018-03-06T17:11:29.000701Z

@valtteri does it let you update existing stacks in a declarative manner?

cgrand 2018-03-06T17:12:34.000399Z

re: locking, would it be naive to go with an immutable description and a mutable reference (and a conditional write on it).

stathissideris 2018-03-06T17:13:47.000195Z

@cgrand I think the problem is more how you share state between multiple users on different machines, terraform enables that scenario

cgrand 2018-03-06T17:28:24.000723Z

@stathissideris I think that’s what I’m talking about too; nevermind I’m no infrastructure expert

stathissideris 2018-03-06T17:29:15.000579Z

@cgrand me neither, I’m a devops hack at most 🙂

viesti 2018-03-06T17:34:49.000304Z

I have fond memories of simple use of xml documents for a project file format for a desktop app, I guess bad practices kill minds, but there's needless complexity in xml (it being a markup language)

cgrand 2018-03-06T17:36:41.000056Z

yeah it’s a good markup language (mixed context etc.) that has been abused as a data language.

cgrand 2018-03-06T17:38:05.000611Z

so APIs were broader than required for data, allowing too many issues and the creation of a cottage industry to fix them through complexity

viesti 2018-03-06T17:38:35.000101Z

I guess Cloudformation solves this by having runner inside the aws environment and having it not run multiple copies of a stack

viesti 2018-03-06T17:39:31.000037Z

should probably look more into Cloudformation, but have been on Terraform track for now (after some maybe misguided fat fetching use of Ansible)

viesti 2018-03-06T17:41:04.000804Z

One tends to make modules in Terraform, each with own state, so less overlap

viesti 2018-03-06T17:41:48.000376Z

but hmm, would need some time for thought on aws-clj-sdk

dominicm 2018-03-06T18:56:50.000203Z

Cloudformation has something equivalent to modules too

valtteri 2018-03-06T19:24:50.000010Z

You can nest stacks in CloudFormation

valtteri 2018-03-06T19:28:15.000519Z

and have cross-references between stacks, whether nested or not.

baptiste-from-paris 2018-03-06T20:40:08.000254Z

@stathissideris there a 5 “protocol” implement, we’ve done rest-json and I am currently working on queryprotocol

baptiste-from-paris 2018-03-06T20:40:40.000167Z

note that all “shapes” are done (aws data structure, kind of a swagger)

baptiste-from-paris 2018-03-06T20:41:15.000585Z

so the job right now is to format requests for each kind of protocol

baptiste-from-paris 2018-03-06T20:41:53.000276Z

and then to deserialize the response

stathissideris 2018-03-06T21:16:28.000698Z

@baptiste-from-paris I really like the project, I wish I had some spare time to contribute!

👀 1