GithubHelp home page GithubHelp logo

mixmaxhq / eb-disable-npm Goto Github PK

View Code? Open in Web Editor NEW
27.0 22.0 12.0 17 KB

[unsupported] Disables npm in Elastic Beanstalk environments.

Home Page: https://www.mixmax.com/careers

License: MIT License

elasticbeanstalk npm ebextensions hooks eb-script unsupported

eb-disable-npm's Introduction

eb-disable-npm

This package is the successor to https://github.com/mixmaxhq/eb-fix-npm/. Even with that package's optimizations, we at Mixmax still found npm to be too slow and memory intensive on Elastic Beanstalk, actually forcing us to use more expensive EC2 instance types than our application would otherwise require.

So, we use this package's .ebextensions to prevent Elastic Beanstalk from installing/rebuilding modules altogether. Instead, we deploy our Node modules along with our application source from our CI server. What makes this possible is that the CI server already installs the modules for the purposes of running our tests, and uses the same CPU architecture as Elastic Beanstalk's EC2 instances.

This package has been tested against Elastic Beanstalk platform versions 3.1.0 and 2.1.3.

Installation

  1. npm install eb-disable-npm --save-dev (see here for why --save-dev)
  2. Commit the .ebextensions file it creates.

Usage

npm install and deploy on a machine with the same architecture as your EC2 instances. If you use the EB CLI to deploy, either commit your Node modules or do

git add node_modules/ --force
eb deploy --staged

Warning

You will not be able to change an Elastic Beanstalk's Node version in place, since the EC2 instances won't rebuild their modules after the configuration changes. Instead, you will have to clone the environment, change the version (at which point the environment will become unhealthy), deploy modules built for that version to that environment (healing the environment) and then swap the environment URLs.

Modifying the .ebextensions file

This package will overwrite the file if/when it is updated.

Pull requests are welcome if you have some generally-useful modifications to suggest.

If you'd like to make modifications specific to your use case, you should uninstall this package after installing the .ebextensions file. Uninstallation won't take the file with it.

Release History

  • 1.0.0 Initial commit

eb-disable-npm's People

Contributors

deld avatar gaastonsr avatar megantinleywilson avatar wearhere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eb-disable-npm's Issues

Failed to start app

Disabling NPM shell scripts fails to start my nodejs app. I get a package.json not found error. I really wish there was an easier way to bypass NPM install errors only experienced when deploying to eb (without disabling NPM altogether).

npm rebuild still running

Hi,

First of all thanks for this simple and so useful script.
I was using your first version (eb-fix-npm) and now using this because I deploy the app directly with the node_modules.

Unfortunately, it is still running npm rebuild when I deploy my app, is this behavior normal ?

Thanks

error

/node_modules/eb-disable-npm
> install-files source

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.