Fork me on GitHub
#aws
<
2021-01-04
>
stuarthalloway12:01:25

@borkdude is there a way to repro the http-client reflection warning on the JVM? I am happy to fix it but don't see a warning when loading the namespace (from Java 11).

borkdude12:01:04

@stuarthalloway After closer inspection, I think the warning came from using import java.lang.reflect.Array;. This is the warning I got from graalvm:

"Class java.nio.HeapByteBuffer[] is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection"
from around line 108 in the cognitect.http-client namespace and this config fixed it for me (using a reflection.json config file):
[
  {"name": "[Ljava.nio.HeapByteBuffer;"}
]
So it's no longer a problem for me and probably not something that can be fixed without avoiding reflect.Array, which is used by into-array (although it's the first time I encountered this specific problem with into-array). Thanks for looking into it and sorry for taking up your time.

stuarthalloway13:01:26

@borkdude Thanks for all you are doing exploring that is possible with GraalVM. I don't use it for day job stuff (yet?), but if there is low hanging fruit happy to help grab it.

👍 3
❤️ 3
borkdude13:01:50

Good to hear. For context, we are working on a babashka aws pod (which wraps aws-api), which runs natively, so you can use aws-api in scripts without a JVM with very fast startup time.

👀 1
🆒 1
borkdude13:01:18

Babashka pods are basically CLIs but they expose their data through EDN or Transit (or JSON) and can be called using normal functions instead of shelling out, RPC-style.

stuarthalloway13:01:47

that sounds terrific

borkdude13:01:46

This is a list of existing pods that can already be used from babashka: https://github.com/babashka/pod-registry A few of them are written in Clojure and compiled with GraalVM native-image.

ghadi19:01:34

Which AWS service(s) are you planning on exposing?

borkdude19:01:48

all that are available in aws-api

1
borkdude19:01:24

we have a working prototype, but there is some stuff around aws-api returning an inputstream for resources from s3 (and possibly others) which we have to translate into bytes, because it has to go over the wire via transit

borkdude19:01:48

it seems that aws-api turns a byte buffer into an inputstream for some reason

lukasz19:01:50

Any idea how to pass x-aws-acl header in the PutObject when using cognitect-labs/aws-api? - I tried overriding the default multimethod for modify-http-request but no luck so far. It's relevant when uploading files so s3 and making them publicly accessible in one request

lukasz19:01:50

Any idea how to pass x-aws-acl header in the PutObject when using cognitect-labs/aws-api? - I tried overriding the default multimethod for modify-http-request but no luck so far. It's relevant when uploading files so s3 and making them publicly accessible in one request

ghadi19:01:23

Which s3 API?

lukasz19:01:19

Ah, forgot to mention - :PutObject

dchelimsky20:01:40

You can (should?) use :PutObjectAcl for this instead of messing with headers.

dchelimsky20:01:32

I see you want to do it in one request, but that’s not how it’s designed.

ghadi20:01:02

is the ACL not available on PutObject? (aws/doc client :PutObject)

dchelimsky20:01:04

@U0JEFEZH6 it’s x-amz-acl, not x-aws-acl. Did your attempt with modify-http-request use the right header name?

ghadi20:01:34

you should not need to mess with with modify-http-request for this

ghadi20:01:42

pass :ACL

ghadi20:01:01

@U0JEFEZH6

dchelimsky20:01:13

> is the ACL not available on PutObject? No, @U050ECB92, it is not not available on PutObject.

dchelimsky20:01:51

FYI :ACL is also available on :CreateBucket

dchelimsky20:01:46

Apparently, my joke about “not not” was missed by at least one reader, so to clarify …. :ACL is absolutely, definitely, 100% a supported key on :PutObject

dchelimsky20:01:11

Got that @U0JEFEZH6?

lukasz20:01:39

I'll double check in ~45m, AFK right now. But thanks for the pointers - I'm fairy sure there were no typos, but I'll verify everything :thumbsup:

dchelimsky20:01:26

OK. I’d recommend you don’t worry about the header and just use the :ACL key in the :request map. Let us know how it goes!

lukasz21:01:15

@U0ENYLGTA that works, thank you! Next time, I'll check aws.client.api/doc

lukasz21:01:27

as the ACL param is listed there, of course facepalm

dchelimsky22:01:26

Glad that worked out.