Fork me on GitHub
#portkey
<
2017-10-15
>
baptiste-from-paris06:10:30

1) set up an aws account

baptiste-from-paris06:10:04

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

baptiste-from-paris06:10:29

Dont Forget to add few € for your lambda

qqq06:10:34

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

qqq06:10:46

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

qqq07:10:02

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

baptiste-from-paris07:10:08

Then, just try the hello word example

baptiste-from-paris07:10:42

defn a hello-word that send back the string

qqq07:10:45

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

qqq07:10:10

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

qqq07:10:56

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

baptiste-from-paris07:10:01

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

qqq07:10:12

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 ?

qqq07:10:33

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-paris07:10:44

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

qqq07:10:33

@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-paris07:10:03

You don’t need to require ouroboros

baptiste-from-paris07:10:19

If you try only portkey core?

qqq07:10:07

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

qqq07:10:43

(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-paris07:10:05

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

qqq07:10:37

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-paris07:10:32

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

qqq07:10:14

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

qqq07:10:27

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

qqq07:10:33

to see if portkey+lein works on my mchine

baptiste-from-paris07:10:07

Then in project.clj your dependencies

qqq07:10:12

okay, running lein repl

qqq07:10:31

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-paris07:10:09

Try with clojure 1.9.

baptiste-from-paris07:10:14

In your project template

qqq07:10:23

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

baptiste-from-paris07:10:50

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

qqq07:10:50

yeah, -alpha17

qqq07:10:21

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

qqq07:10:28

I think that means require portkey.core success ?

qqq07:10:01

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-paris07:10:54

Yes, it should be good

qqq07:10:11

=== 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

qqq07:10:24

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

baptiste-from-paris07:10:44

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

baptiste-from-paris08:10:16

Have you got the hello world running with lein ?

qqq08:10:25

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

qqq08:10:33

I don't have AWS IAM setup either yet.

viesti14:10:39

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