Re: compojure ring uberwar weblogic 12.1.3

2017-01-08 Thread Jose Trigueros
Hi Samuel,

I just had to create a web application that was to be run on Weblogic 
12.2.1. I was able to get it working doing the following:


   1. Create a new project using *compojure-api* 
   : lein new compojure-api webapp
   2. Use the *lein-ring* plugin (included with the compojure-api template) 
   to create WAR file, you may need to configure the plugin in the *project.clj 
   *to set the uberwar-name: lein ring uberwar
   3. Deploy WAR file

Doing this approach, I didn't have to touch the web.xml or weblogic.xml. 
You can configure the rest of the settings via the Weblogic Console. There 
were a few things that I couldn't get sorted out, any route that serves 
HTML craps out like this:

https://github.com/luminus-framework/luminus/issues/165


I ended up splitting my application in two, one WAR for the service and 
another for the static HTML/JS.


I hope this helps, it took me a lot of trial and error before figuring this 
out (I too tried the web.xml and weblogic.xml route).


-jvt

On Tuesday, December 13, 2016 at 9:24:41 AM UTC-7, Samuel Morello wrote:
>
> Dear all, 
>
> Is there someone who has experience with the deployment of web application 
> using compojure on a weblogic server ? 
> I  cannot make it run and could not find a similar issue. 
>
> I use: 
> lein ring uberwar to create the war file and have set some properties in 
> the project.clj file {:servlet-name, ... }. 
> I've also add a weblogic.xml inside the war to "exclude" joda.time, ... 
> but this doesn't work and i always have a 
> 403 forbidden error from weblogic. 
> I d'ont know if it is the good place to post this but any information 
> would help me a lot
> I can post the web.xml or weblogic.xml and project.clj if needed
> Many thanks, 
>
> Samuel 
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reducing Jar file size for AWS Lambda

2017-07-19 Thread Jose Trigueros
Hi all,

I've been using AWS Lambda for a small project. I've been leveraging the 
lein-clj-lambda  plugin to 
build and upload the compiled Jar to S3 which is then used to update my 
Lambda function. Aside from the Jar generation, a lot of the time is spent 
uploading the Jar up to S3. The resulting Jar file is only about 12mb but 
does considerably slow down the feedback loop.

I have the following questions:

   - Does anyone have any tips for reducing the size of a jar even more?
  - I've tried excluding dependencies until the Jar broke, saved a few 
  KBs
  - I briefly looked into ProGuard, but the obfuscating process seemed 
  to take some time which would negate any time saved on upload.
   - Am I doing this wrong? Is there a way to mimic AWS Lambda locally?
  - To mitigate this loop, I use the REPL to play with the individual 
  functions until they feel right, but at some point you gotta test on the 
  server, being far from perfect, I make a lot of mistakes so that's when 
the 
  iteration happens.
   
Here's a link to the project.clj 

 
in question for reference.


I will say that using the lein-clj-lambda is already a huge win (before 
plugin it was `lein uberjar`, manually upload jar to S3, manually update 
AWS Lambda), but I'm wondering if there's an even better way.


-jvt

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing Jar file size for AWS Lambda

2017-07-22 Thread Jose Trigueros
Hi Moe,

Thanks for your suggestions, yes, I've been mostly practicing the first 
option suggested. docker-lambda is a good option as well. It does help that 
Lambda provides test messages, which is what I've been using to test 
locally. Seems like the best way to go about it is to test as much as 
possible locally before uploading.

-jvt

On Thursday, July 20, 2017 at 1:41:10 AM UTC-6, Moe Aboulkheir wrote:
>
> Jose,
>
> Leaving aside shrinking the jar, you could try:
>  - Structuring your application so it's easier to construct plausible 
> inputs in the tests / REPL
>  - Using https://github.com/lambci/docker-lambda locally, to get an 
> environment closer to the deployment target
>  - Deploying to a geographically closer region, or triggering deployments 
> on a build slave with better network connectivity
>  - Deploying manually with awscli, as your package is small enough to be 
> uploaded directly to lambda, rather than using S3
>
> (With a strong bias for the first one - even if the your package was a 
> third of the size, it's still going to be frustrating to deploy it and then 
> get unexpected errors)
>
> Take care,
> Moe 
>
> On Thu, Jul 20, 2017 at 5:16 AM, Jose Trigueros  > wrote:
>
>> Hi all,
>>
>> I've been using AWS Lambda for a small project. I've been leveraging the 
>> lein-clj-lambda <https://github.com/mhjort/clj-lambda-utils> plugin to 
>> build and upload the compiled Jar to S3 which is then used to update my 
>> Lambda function. Aside from the Jar generation, a lot of the time is spent 
>> uploading the Jar up to S3. The resulting Jar file is only about 12mb but 
>> does considerably slow down the feedback loop.
>>
>> I have the following questions:
>>
>>- Does anyone have any tips for reducing the size of a jar even more?
>>   - I've tried excluding dependencies until the Jar broke, saved a 
>>   few KBs
>>   - I briefly looked into ProGuard, but the obfuscating process 
>>   seemed to take some time which would negate any time saved on upload.
>>- Am I doing this wrong? Is there a way to mimic AWS Lambda locally?
>>   - To mitigate this loop, I use the REPL to play with the 
>>   individual functions until they feel right, but at some point you 
>> gotta 
>>   test on the server, being far from perfect, I make a lot of mistakes 
>> so 
>>   that's when the iteration happens.
>>
>> Here's a link to the project.clj 
>> <https://github.com/guacamoledragon/petfinder/blob/master/twilio-webhook/project.clj>
>>  
>> in question for reference.
>>
>>
>> I will say that using the lein-clj-lambda is already a huge win (before 
>> plugin it was `lein uberjar`, manually upload jar to S3, manually update 
>> AWS Lambda), but I'm wondering if there's an even better way.
>>
>>
>> -jvt
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing Jar file size for AWS Lambda

2017-07-23 Thread Jose Trigueros
This looks like a viable solution! Is Portkey on Clojars or will I have to 
build myself? Not a problem either way, just making sure I'm doing it 
right. Thanks Kimmo.

On Sunday, July 23, 2017 at 2:35:37 AM UTC-6, Kimmo Koskinen wrote:
>
> Hi!
>
> Although still at early stages, check out portkey 
> https://github.com/cgrand/portkey. 
>
> Portkey does tree-shaking by starting from a closure to minimize resulting 
> jar size. Uses kryo and implementation of var tracing started in powderkeg 
> project (https://github.com/HCADatalab/powderkeg)
> . 
>
> pk/deploy can lift (an anonymous) function with [in out ctx] args as a 
> Lambda function. pk/mount can expose a defn through API gateway with query 
> params mapped to function arguments. 
>
> Christophe Grand and I have been working on portkey for now, but we'd 
> welcome additional help on making it more awesome :) 
>
> - Kimmo
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.