Skip to content
This repository has been archived by the owner on Oct 22, 2022. It is now read-only.

Use AWS SDK, rather than CLI #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use AWS SDK, rather than CLI #84

wants to merge 1 commit into from

Conversation

moea
Copy link
Member

@moea moea commented May 24, 2017

@zrzka This is published as 0.7.0-SNAPSHOT. Note that it requires leiningen 2.7.2-SNAPSHOT - which is awkward enough to install that release will have to wait until 2.7.2 - unless there's some way to override Leiningen's (unused) Jackson dependency, so it doesn't conflict with the AWS SDK's - but I don't think there is, because of differences between plugins and projects.

I'll leave this open until then, let me know if you encounter any issues - it should operate identically to the existing project.

@zrzka
Copy link
Contributor

zrzka commented May 24, 2017

@moea cool, will finish something and will give it a spin. Thx for the info.

@zrzka
Copy link
Contributor

zrzka commented May 29, 2017

Simple lein cljs-lambda $name deploy leads to (lein 2.7.2-SNAPSHOT from master installed):

java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
 at java.util.concurrent.FutureTask.report (FutureTask.java:122)
    java.util.concurrent.FutureTask.get (FutureTask.java:192)
    sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke (Method.java:498)
    clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
    clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:313)
    leiningen.cljs_lambda.aws$do_functions_BANG_.invokeStatic (aws.clj:214)
    leiningen.cljs_lambda.aws$do_functions_BANG_.invoke (aws.clj:203)
    leiningen.cljs_lambda.aws$deploy_BANG_.invokeStatic (aws.clj:217)
    leiningen.cljs_lambda.aws$deploy_BANG_.invoke (aws.clj:216)
    leiningen.cljs_lambda$deploy.invokeStatic (cljs_lambda.clj:177)
    leiningen.cljs_lambda$deploy.invoke (cljs_lambda.clj:172)
    leiningen.cljs_lambda$cljs_lambda.invokeStatic (cljs_lambda.clj:231)
    leiningen.cljs_lambda$cljs_lambda.doInvoke (cljs_lambda.clj:215)
    clojure.lang.RestFn.invoke (RestFn.java:442)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$partial_task$fn__3889.doInvoke (main.clj:272)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$apply_task.invokeStatic (main.clj:322)
    leiningen.core.main$apply_task.invoke (main.clj:308)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:328)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:324)
    leiningen.core.main$_main$fn__3955.invoke (main.clj:401)
    leiningen.core.main$_main.invokeStatic (main.clj:394)
    leiningen.core.main$_main.doInvoke (main.clj:391)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.main$main_opt.invokeStatic (main.clj:314)
    clojure.main$main_opt.invoke (main.clj:310)
    clojure.main$main.invokeStatic (main.clj:421)
    clojure.main$main.doInvoke (main.clj:384)
    clojure.lang.RestFn.invoke (RestFn.java:482)
    clojure.lang.Var.invoke (Var.java:401)
    clojure.lang.AFn.applyToHelper (AFn.java:171)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
 at com.fasterxml.jackson.databind.ObjectMapper.<init> (ObjectMapper.java:537)
    com.fasterxml.jackson.databind.ObjectMapper.<init> (ObjectMapper.java:448)
    com.amazonaws.internal.config.InternalConfig.<clinit> (InternalConfig.java:43)
    com.amazonaws.internal.config.InternalConfig$Factory.<clinit> (InternalConfig.java:304)
    com.amazonaws.util.VersionInfoUtils.userAgent (VersionInfoUtils.java:142)
    com.amazonaws.util.VersionInfoUtils.initializeUserAgent (VersionInfoUtils.java:137)
    com.amazonaws.util.VersionInfoUtils.getUserAgent (VersionInfoUtils.java:100)
    com.amazonaws.ClientConfiguration.<clinit> (ClientConfiguration.java:65)
    com.amazonaws.ClientConfigurationFactory.getDefaultConfig (ClientConfigurationFactory.java:46)
    com.amazonaws.ClientConfigurationFactory.getConfig (ClientConfigurationFactory.java:36)
    com.amazonaws.client.builder.AwsClientBuilder.resolveClientConfiguration (AwsClientBuilder.java:163)
    com.amazonaws.client.builder.AwsClientBuilder.access$000 (AwsClientBuilder.java:52)
    com.amazonaws.client.builder.AwsClientBuilder$SyncBuilderParams.<init> (AwsClientBuilder.java:411)
    com.amazonaws.client.builder.AwsClientBuilder.getSyncClientParams (AwsClientBuilder.java:354)
    com.amazonaws.client.builder.AwsSyncClientBuilder.build (AwsSyncClientBuilder.java:46)
    sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke (Method.java:498)
    clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
    clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:313)
    leiningen.cljs_lambda.aws$build_client.invokeStatic (aws.clj:42)
    leiningen.cljs_lambda.aws$build_client.invoke (aws.clj:41)
    leiningen.cljs_lambda.aws$fn__1411.invokeStatic (aws.clj:52)
    leiningen.cljs_lambda.aws/fn (aws.clj:50)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.core$memoize$fn__5708.doInvoke (core.clj:6107)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    leiningen.cljs_lambda.aws$get_function_configuration_BANG_.invokeStatic (aws.clj:174)
    leiningen.cljs_lambda.aws$get_function_configuration_BANG_.invoke (aws.clj:170)
    leiningen.cljs_lambda.aws$deploy_function_BANG_.invokeStatic (aws.clj:193)
    leiningen.cljs_lambda.aws$deploy_function_BANG_.invoke (aws.clj:191)
    leiningen.cljs_lambda.aws$deploy_BANG_$fn__1497.invoke (aws.clj:219)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.core$with_bindings_STAR_.invokeStatic (core.clj:1881)
    clojure.core$with_bindings_STAR_.doInvoke (core.clj:1881)
    clojure.lang.RestFn.invoke (RestFn.java:442)
    leiningen.cljs_lambda.aws$do_functions_BANG_$iter__1472__1476$fn__1477$fn__1478$fn__1479.invoke (aws.clj:211)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:266)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    java.lang.Thread.run (Thread.java:745)

@moea
Copy link
Member Author

moea commented May 29, 2017

@zrzka Does lein version show 2.7.2-SNAPSHOT, and/or do you have anything in your profile which might be causing this? That's the same error you'd get with an earlier version of leiningen.

@zrzka
Copy link
Contributor

zrzka commented May 29, 2017

@moea

○ → lein version
Leiningen 2.7.2-SNAPSHOT on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM
○ →

Nothing special in project.clj. Pretty standard stuff.

@moea
Copy link
Member Author

moea commented May 29, 2017

@zrzka There is an old version of Jackson on the lein classpath, from either another plugin in your project.clj or leiningen profile. I'm not sure that much can be done about this in the general case, aside from radical approaches, like spawning another jvm with an adjusted classpath.

@zrzka
Copy link
Contributor

zrzka commented May 29, 2017

@moea hmm, is this worth to tweak it to make it working instead of simple brew upgrade awscli? Will check from where this Jackson comes from.

@moea
Copy link
Member Author

moea commented May 29, 2017

@zrzka If it's a choice between spawning a jvm or sticking with awscli - then, definitely awscli - I was just hoping that it'd be plain sailing after leiningen releases 2.7.2 (which removes the old, unused jackson).

@zrzka
Copy link
Contributor

zrzka commented May 29, 2017

@moea here's a list of packages that they do require jackson ... removed .m2/repositories and installed all deps again just for one project with 0.7.0-SNAPSHOT plugin

  • cheshire/cheshire/5.2.0
  • com/amazonaws/aws-java-sdk-core/1.11.132
  • com/amazonaws/jmespath-java/1.11.132

... cheshire required in many packages ...

  • io/nervous/eulalie/0.6.10
  • io/nervous/fink-nottle/0.4.7
  • lein-npm/lein-npm/0.6.0
  • tigris/tigris/0.1.1

@moea
Copy link
Member Author

moea commented May 29, 2017

@zrzka Thanks. cheshire 5.2.0 is pretty old - overriding the dependency w/ cheshire 5.7.x would probably fix that issue.

That said, I think there's a difference between packages on the project classpath (direct and transitive :dependencies for the project) and stuff on the classpath when a plugin which sets :eval-in-leiningen is evaluating code (dependencies of leiningen itself, and of all plugins) - but I don't have much confidence about this, so will have to look in more detail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants