How do you implement bower in AWS Lambda? - bower

Total noob here.
How do you implement bower in AWS Lambda? I'm trying to have AWS Lambda run bower install but I'm not sure how to upload bower into AWS lambda. I have tried googling for tutorials and pre built lambda functions and I have not found anything related to bower.

You have to deploy the package to either S3 or Lambda with all the dependencies packaged together. You cannot install dependencies from Lambda itself. Here is a link that might help if you want to deploy from your machine to Lambda using npm: https://medium.com/#SlyFireFox/micro-services-with-aws-lambda-and-api-gateway-part-1-f11aaaa5bdef#.6bk44snwm.

Related

Is it possible to create a custom cdk init template to leverage pipenv for my python project?

I would like to utilize pipenv as my virtual environment manager and for my dependency management for my Python cdk projects, upon running 'cdk init'. I read that you can specify a 'custom' application template but could not find documentation on creating one. Is it possible and can the virtual environment/dependency manager be controlled using this feature?
I would like to be able to run 'cdk init hello-world --language python' and have the scaffolding for the project be generated BUT using pipenv.
It's not possible to do that without modifying the source code for the CDK package itself. You likely won't want to manage your own divergent version of the standard package.
I've shoe-horned CDK to work with PipEnv a couple of times, and it's more work than it's worth at this point. The problem is that PipEnv forces the . delimiter in the package name to a -; pipenv install aws-cdk.aws-rds is listed as aws-cdk-aws-rds in the Pipfile, and the package installations don't actually work.
There's an open issue on the repo for this though (https://github.com/aws/aws-cdk/issues/3671), so you could +1 there in hopes that they can address it. It really is an issue with Pipenv though.
Following the link from Scott for the open issue, it looks like this works now, provided the package name is in quotes.

How to acquire apache-beam .tar.gz file?

Apache-beam has been frustrating to manage with the correct google-cloud libraries for me to use with Dataflow.
I discovered for what I'm doing I need apache-beam=2.3.0 rather than 2.4.0 (2.4.0 gives a pickling error that I cannot resolve refer to Dataflow Error: 'Clients have non-trivial state that is local and unpickleable')
I need DataflowRunner to use apache-beam=2.3.0 as well so following this persons instructions Custom Apache Beam Python version in Dataflow I just need the actual tar.gz file I thought I had installed it via pip with a pip install apache-beam=2.3.0 so if I look in my system I can't find any tar.gz. When I go to the apache website to download the source code the link is broken.
Where can I find a tar.gz for apache-beam-2.3.0?
The latest and all history releases of apache-beam packages can be found on github - github.com/apache/beam/releases.

Installing react-redux in a Rails project

I am building a React app in Rails and would like to try react-redux. I noticed that it doesn't offer a CDN nor a bower package.
The installation instructions recommend using NPM, but this is not a node project. I handle all my current assets through the Rails asset pipeline, a CDN or a bower package (via rails-assets)
Is there a way to install it without using NPM?
Is there a way to get NPM packages to play nice with existing asset pipeline packages?
You can also check out https://github.com/shakacode/react_on_rails. It's integrated with webpack which gives it a nice and familiar javascript flow.
They've also got a live example at http://www.reactrails.com/ and the code for that at https://github.com/shakacode/react-webpack-rails-tutorial.
I found that it is possible using react-rails in conjunction with browserify-rails. This blog article explains it pretty well.
Just run the command yarn add redux react-redux
This will add redux and react-redux to dependency as well as connect react to redux.
I am using rails 6 and it works fine with this.
add ruby related lib via bundle add and js related lib via yarn

Installing non-bower-ready library with Bower

I am using Bower (http://bower.io/) to manage my app's third-party libraries and now I want to use a library which doesn't have a registered bower package, namely jquery.cloudinary.js from Cloudinary (http://cloudinary.com).
I would really love to include cloudinary amongst my bower-managed libraries because it really helps cloning my development environment when I need to.
Is it possible to install any library available in the internet with Bower by just editing my bower.json file? If so, how?
I guess I could either ask Cloudinary to create and register a Bower package or do it myself but I am still in doubt whether I should do any of these.
Register it or install with the git url directly: bower install http://website.com/repo.git
From the Bower readme:
Bower offers several ways to install packages:
Using a local or remote package
bower install <package>
Where <package> can be any one of the following:
A name that maps to a package registered with Bower, e.g, jquery. ‡
A remote Git endpoint, e.g., git://github.com/someone/some-package.git. Can be public or private. ‡
A local endpoint, i.e., a folder that's a Git repository. ‡
A shorthand endpoint, e.g., someone/some-package (defaults to GitHub). ‡
A URL to a file, including zip and tar files. Its contents will be extracted.

How do I run my own bower server

I'd like to run my own bower server to start sharing a couple of internal modules across teams. I'm having a very hard time finding the information for running your own server. On the bower.io site there is this line
N.B. To run your own Bower Endpoint for custom packages that are
behind a firewall, you can use a simple implementation of the Bower
Server.
With a link to Bower Server
Do I simply clone that repo and 'run it'? I'm not a ruby guy at all so I'm not even sure what run it means.
That repo is a Sinatra app, so you need to git clone it, run bundle install in its directory, and run 'ruby application.rb`. Comment on this answer if you need more details.
There is also a node server, which I have never used and cannot comment on its quality - https://npmjs.org/package/bower-server
I guess there is a PHP one also - https://github.com/indieisaconcept/slim-bower-server
EDITS:
Some links for Ruby n00bs
http://bundler.io/
http://www.sinatrarb.com/intro.html

Resources