Coder Social home page Coder Social logo

hikari's People

Contributors

ouwen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

helenawu

hikari's Issues

Enforce that DB(s) are up before spinning up API Service

As mentioned by @Ouwen in the README, there can still be a race condition where the API service starts up before the postgres db(s) are ready to accept a connection (in spite of docker's depends-on which only ensures ordered container start times). Couple ways to mitigate:

  • Quick/lazy Fix: So long as Node quits and Grunt quits on failure to connect to the db, a restart policy could be used as a band-aid: docker-compose ... --restart=on-failure:5
  • Proper Fix: Either using a grunt task or using a shell script entry point wrapper inside api, we health check postgres and only start up the node server after postgres is up
  • We could also add retry logic to the node-postgres pool, but that's less agnostic to API's implementation

Good reference: https://docs.docker.com/compose/startup-order/

Docker grunt test does not spawn selenium chrome browser.

When grunt test is run, protractor waits for the selenium chrome browser to spawn. This never happens and the tests timeout.

Running "protractor:chrome" (protractor) task
[launcher] Running 1 instances of WebDriver

------------------------------------
[chrome #1a] PID: 119
[chrome #1a] Specs: /src/e2e/login/login.spec.js
[chrome #1a] 
[chrome #1a] Using ChromeDriver directly...
[chrome #1a] ERROR - Unable to start a WebDriver session.
[chrome #1a] 
[chrome #1a] /src/node_modules/selenium-webdriver/http/util.js:87
[chrome #1a]           Error('Timed out waiting for the WebDriver server at ' + url));
[chrome #1a]           ^
[chrome #1a] Error: Timed out waiting for the WebDriver server at http://127.0.0.1:57413/
[chrome #1a]     at Error (native)
[chrome #1a]     at onResponse (/src/node_modules/selenium-webdriver/http/util.js:87:11)
[chrome #1a]     at /src/node_modules/selenium-webdriver/http/util.js:42:21
[chrome #1a]     at /src/node_modules/selenium-webdriver/lib/webdriver/http/http.js:96:5
[chrome #1a]     at ClientRequest.<anonymous> (/src/node_modules/selenium-webdriver/http/index.js:145:7)
[chrome #1a]     at emitOne (events.js:77:13)
[chrome #1a]     at ClientRequest.emit (events.js:169:7)
[chrome #1a]     at Socket.socketErrorListener (_http_client.js:267:9)
[chrome #1a]     at emitOne (events.js:77:13)
[chrome #1a]     at Socket.emit (events.js:169:7)
[chrome #1a] ==== async task ====
[chrome #1a] WebDriver.createSession()
[chrome #1a]     at Function.webdriver.WebDriver.acquireSession_ (/src/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
[chrome #1a]     at Function.webdriver.WebDriver.createSession (/src/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
[chrome #1a]     at new Driver (/src/node_modules/selenium-webdriver/chrome.js:477:36)
[chrome #1a]     at Object.createDriver (/src/node_modules/selenium-webdriver/chrome.js:453:10)
[chrome #1a]     at DirectDriverProvider.getNewDriver (/src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/direct.js:68:23)
[chrome #1a]     at Runner.createBrowser (/src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:180:37)
[chrome #1a]     at /src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:257:21
[chrome #1a]     at _fulfilled (/src/node_modules/grunt-protractor-runner/node_modules/q/q.js:797:54)
[chrome #1a]     at self.promiseDispatch.done (/src/node_modules/grunt-protractor-runner/node_modules/q/q.js:826:30)

Docker grunt build cannot run imagemin task.

When running grunt build the imagemin task fails. This is likely because the jpeg-tran package does not properly install during the npm install phase.

> [email protected] postinstall /src/node_modules/jpegtran-bin
> node lib/install.js

  ⚠ The `/src/node_modules/jpegtran-bin/vendor/jpegtran` binary doesn't seem to work correctly
  ⚠ jpegtran pre-build test failed
  ℹ compiling from source
  ✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/src/node_modules/jpegtran-bin/vendor" --bindir="/src/node_modules/jpegtran-bin/vendor" && make install
Command failed: /bin/sh -c ./configure --disable-shared --prefix="/src/node_modules/jpegtran-bin/vendor" --bindir="/src/node_modules/jpegtran-bin/vendor"
configure: error: no nasm (Netwide Assembler) found

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN prefer global [email protected] should be installed with -g
        Warning: Running "imagemin:dist" (imagemin) task
    Warning: Error: Error: write EPIPE/src/node_modules/jpegtran-bin/vendor/jpegtran: 1: /src/node_modules/jpegtran-bin/vendor/jpegtran: Syntax error: "(" unexpected
     in file client/assets/images/background.jpg Use --force to continue.

    Aborted due to warnings.


    Execution Time (2016-08-12 15:44:24 UTC-0)
    loading tasks                   206ms  ▇▇ 5%
    loading grunt-contrib-imagemin   4.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 93%
    imagemin:dist                    98ms  ▇ 2%
    Total 4.4s Use --force to continue.

        Aborted due to warnings.

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.