Fork me on GitHub
#portkey
<
2017-10-07
>
cgrand07:10:43

Btw I’m in the twilight zone: more logging reveals it’s my class that has extra fields… matching a jdk7 implementation while there’s no such thing on the class path.…

baptiste-from-paris14:10:40

hello all, little update. 1) I run a little lambda/portkey that send emails to customer in prod (for real clients) 2) I have a personal objective, understanding all that is happening in portkey I am currently playing with ouroboros, just got how to attach an Angent to the running vm, next step is understanding what’s happening with transformer’s functions. Thanks you for helping me understand global design

viesti15:10:24

akh, we can’t loose Christophe to the twilight zone of java classes

baptiste-from-paris15:10:47

by the way, do you know why when I launch the REPL I can retrieve the VM with attach but once I try do to it in my REPL I have this error UnsatisfiedLinkError Native Library /Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/lib/libattach.dylib already loaded in another classloader java.lang.ClassLoader.loadLibrary0 (ClassLoader.java:1907)

cgrand07:10:18

@baptiste-from-paris I’m a bit at lost between the two REPLs mentioned. Could you be more specific?

baptiste-from-paris08:10:07

don’t worry about this one, it’s indeed IntelliJ IDE

baptiste-from-paris08:10:20

If I use a classic REPL, all is working great

cgrand09:10:17

and do you know if it’s IntelliJ or Cursive (before I pester Colin)?

baptiste-from-paris12:10:00

but how could I really know, cursive might use instrumentation also right ?

viesti14:10:10

hum, Colin might know where to look anyway

cgrand16:10:39

Launch a java process with clojure.Main and the right classpath.

baptiste-from-paris08:10:44

@U3E46Q1DG sorry for the delay, it’s working great with clojure.main repl

baptiste-from-paris08:10:59

must be a cursive “bug” or design

viesti11:10:07

hum, ps aux while running repl from Cursive would reveal classpath generated by intellij for the subprocess, and maybe hint at what is happening

baptiste-from-paris12:10:53

/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=54123:/Applications/IntelliJ IDEA CE.app/Contents/bin

cgrand14:10:07

Very useful

cgrand15:10:25

@baptiste-from-paris could you try (Class/forName "com.sun.tools.attach.VirtualMachine") in a Cursive-sans-portkey repl?

baptiste-from-paris06:10:21

ok, do that right now + I now have full notifications for this channel ^^

baptiste-from-paris06:10:40

so, in a randam project clj repl WITH cursive and WITHOUT portkey, it’s working

baptiste-from-paris06:10:51

(let [loader (.getContextClassLoader (java.lang.Thread/currentThread))
      tools-jar (java.io.File. (System/getProperty "java.home") "../lib/tools.jar")
      tools-jar-loader (java.net.URLClassLoader. (into-array [(.toURL tools-jar)]))
      [_ pid] (re-matches #"([^@]*).*" (.getName (java.lang.management.ManagementFactory/getRuntimeMXBean)))]

  (-> (Class/forName "com.sun.tools.attach.VirtualMachine" true tools-jar-loader)
      (.getMethod "attach" (into-array [String]))
      (.invoke nil (object-array [pid]))))
=> #object[sun.tools.attach.BsdVirtualMachine 0x5d8f3c00 "sun.tools.attach.BsdAttachProvider@78025dc1: 2327"]

baptiste-from-paris15:10:10

with this one in the REPL

(-> (Class/forName "com.sun.tools.attach.VirtualMachine" true tools-jar-loader)
          (.getMethod "attach" (into-array [String]))
          (.invoke nil (object-array [pid])))

viesti15:10:50

hmm, same native library already loaded by IntelliJ?

cgrand21:10:35

“In another class loader” is an interesting twist. Open issue please.

viesti15:10:17

been using cider with nrepl so haven’t noticed, should try IntelliJ myselkf

baptiste-from-paris15:10:22

worked with both, and I found out that they are both excellent tools but I really love class navigation of IntelliJ products

viesti15:10:58

yes, I use it for Java browsing also

viesti20:10:36

and I have to thank you also, it’s really good to have someone embarking on a journey with portkey 🙂

baptiste-from-paris20:10:16

But the road will be long for me ^_^

viesti21:10:13

whoa, was looking at creating unmount! and undeploy! to have tests that actually hit api gateway, so that I can be a bit more certain on my code that uses aws, and for this I’d need to clean after test and maybe users would wan’t to clean mounts as well. Now that I say this, for tests I probably could just remove the whole API, but there was a limit on API deletions per minute that I hit quite easily http://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html, which is 2 per minute. Then again this could be done after running all tests.

viesti21:10:55

anyways, had a problem with aws-clj-sdk (apigw/get-resources) returning only first 25 items and I have more deployed

viesti21:10:59

reading the code (https://github.com/portkey-cloud/aws-clj-sdk/blob/master/src/portkey/aws.clj#L216), figured out that I can just pass query parameters of the actual rest api (https://docs.aws.amazon.com/apigateway/api-reference/link-relation/restapi-resources/) in the body, like (apigw/get-resources {:rest-api-id "xxxx" :limit 100})

viesti21:10:00

hmm, the link tracing for pagination though…