portkey 2017-10-15

I'm also familiar with EC2 / Beanstalk / AuroraDB ... it's just Lambda that I'm new to.

baptiste-from-paris 2017-10-15T07:00:08.000030Z

Then, just try the hello word example

baptiste-from-paris 2017-10-15T07:00:42.000011Z

defn a hello-word that send back the string

I guess I was hoping to see a "Lambda/Portkey cookbook" -- and see if I can turn my entire server side serverless.

baptiste-from-paris 2017-10-15T07:00:48.000052Z

And mount it

I can already drop websocket needs -- so in theory, lambda + Aurora + Dynamo + S3 should be all I need.

Also, want to hear the most badass first sentence intro to a book? (technically part of the 'Foreword'):

baptiste-from-paris 2017-10-15T07:02:01.000053Z

It will package everything needed to make it run on a lambda, you can also access it with the api-gateway url that the function returns

baptiste-from-paris 2017-10-15T07:03:04.000056Z

Lol, go on!

Alright, I guess your suggestion is: 1. get the most basic hedllo world working 2. start porting app over 3. if something breaks, ask for help ?

Quote: Foreword: Page xv (first real sentence of the book) At some point in the next few years we're going to see the first billion-dollar startup with a single employee, the founder, and taht engineer will be using serverless technology. -- after that sentence, this became the first book where I read the foreword, preface, acknowledgement, and 'about this book' in great detail

baptiste-from-paris 2017-10-15T07:05:44.000014Z

Yes, get the hello world working, define what you want to do with your lambda, and really don’t hesitate to ping

@baptiste-from-paris: I have the following problem 1. I did lein install 2. I added "portkey-0.1.0-SNAPSHOT" to my boot.build 3. I can require portkey.ouroboros, but I can't require portkey.core (ns server.snip.aws (:require [portkey.ouroboros] #_ [portkey.core :as pk])) 4. When I try to require portkey.core, I get an error of:

2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling portkey/core.clj at (1:1)

1. Caused by java.lang.Exception
   namespace 'portkey.ouroboros' not found

baptiste-from-paris 2017-10-15T07:41:03.000043Z

You don’t need to require ouroboros

baptiste-from-paris 2017-10-15T07:41:19.000037Z

If you try only portkey core?

yeah, it gives me the exact same error (which is way I tried to see if I could require portkey.ouroboros on my own)

(ns server.snip.aws
  (:require [portkey.core :as pk]))
results in error:
1. Caused by java.lang.Exception
   namespace 'portkey.ouroboros' not found

baptiste-from-paris 2017-10-15T07:43:05.000024Z

It shouldn’t change anything but can you try from a lein template ?

is there a way I can run directly from the github repo I cloned of portkey? I get that you want to test boot vs lein, but I happen to know little lein.

baptiste-from-paris 2017-10-15T07:45:32.000004Z

I think you could as long as ouriboros eat itself, but it will be only in the repl

I'm perfectly willingto run the test to see if it works in lein,

but I don't know how to setup a lein template, so I'm asking if there is som existing repo I can clone

to see if portkey+lein works on my mchine

baptiste-from-paris 2017-10-15T07:46:40.000002Z

Lein new app-name

baptiste-from-paris 2017-10-15T07:46:48.000011Z

Minimal template

baptiste-from-paris 2017-10-15T07:47:07.000002Z

Then in project.clj your dependencies

baptiste-from-paris 2017-10-15T07:47:11.000013Z

And that’s it

okay, running lein repl

user=> (require 'portkey.core)
Preparing for self instrumentation.
Ouroboros succesfully eating its own tail!
Instrumenting clojure.lang.Var... done!

CompilerException java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class or clojure/spec/alpha.clj on classpath., compiling:(portkey/aws.clj:1:1) 

baptiste-from-paris 2017-10-15T07:49:09.000009Z

Try with clojure 1.9.

baptiste-from-paris 2017-10-15T07:49:14.000037Z

In your project template

baptiste-from-paris 2017-10-15T07:49:17.000026Z

Lein clean

baptiste-from-paris 2017-10-15T07:49:21.000034Z

Lein deps

should I change this liunein project.clj too? :dependencies [[org.clojure/clojure "1.8.0"]

baptiste-from-paris 2017-10-15T07:50:50.000066Z

That’s what I was trying to say ^_^

user=> (require 'portkey.core)
Preparing for self instrumentation.
Ouroboros succesfully eating its own tail!
Instrumenting clojure.lang.Var... done!
WARNING: get-method already refers to: #'clojure.core/get-method in namespace: portkey.aws.apigateway, being replaced by: #'portkey.aws.apigateway/get-method
nil

I think that means require portkey.core success ?

trying from boot repl:

(require 'portkey.core)
                    java.lang.Exception: namespace 'portkey.ouroboros' not found
clojure.lang.Compiler$CompilerException: java.lang.Exception: namespace 'portkey.ouroboros' not found, compiling:(portkey/core.clj:1:1)

baptiste-from-paris 2017-10-15T07:52:54.000052Z

Yes, it should be good

=== this makes no sense ===

boot.user> (require 'portkey.ouroboros)
nil
boot.user> (require 'portkey.core)
                    java.lang.Exception: namespace 'portkey.ouroboros' not found
clojure.lang.Compiler$CompilerException: java.lang.Exception: namespace 'portkey.ouroboros' not found, compiling:(portkey/core.clj:1:1)
boot.user> 
if I reuiqre portkey.ouroboros manually, it works fine, but if I require portkey.core, there's an error loading portkey.ouroboros

what is ouroboros anyway? I'm googling, and it sounds like a JVM in a JVM ?

baptiste-from-paris 2017-10-15T07:59:44.000067Z

It creates an agent that is attached to the current running VM in order to do some instrumentation of bytecode

baptiste-from-paris 2017-10-15T08:00:16.000011Z

Have you got the hello world running with lein ?

no, I was hoping to get portkey.core working in boot first

I don't have AWS IAM setup either yet.

baptiste-from-paris 2017-10-15T08:01:37.000069Z

Ok

I remember that we have an issue for getting started https://github.com/portkey-cloud/portkey/issues/30

baptiste-from-paris 2017-10-15T06:46:30.000027Z

1) set up an aws account

baptiste-from-paris 2017-10-15T06:47:04.000040Z

I am in the train today but I’ll send you examples at the end of the day

baptiste-from-paris 2017-10-15T06:47:29.000028Z

Dont Forget to add few € for your lambda

Oh, I have an AWS account with around 15k credit (due to a startup incubator.)

My copy of "AWS Lambda in Action" just arrived today.

baptiste-from-paris 2017-10-15T06:59:52.000022Z

Lol