Accenture / serverless-ephemeral

This is a Serverless Framework plugin that helps bundling any stateless zipped library to AWS Lambda.
67 stars 15 forks source link

Handling shelljs.exec js errors #9

Closed piercus closed 6 years ago

piercus commented 6 years ago

Hello

This package looks very promising, and i would like to suggest more plugins (opencv, canvas) to implement.

Anyway, i'd like to first make tensorflow work and i'm failing now on the deploy step

It was failing with error

$ sls deploy
...
Error: ENOENT: no such file or directory, open '.ephemeral/lib/tensorflow-1.4.0.zip'

I found that when running docker-composer on his own i am facing a configuration error

The Docker Engine version is less than the minimum required by Compose. Your current project requires a Docker Engine of version 1.13.0 or greater.

So, i have configuration issue on my side, but the library is not raising the right error, (i have spent 30 min in the code to find the root cause).

I think shelljs error are not caught. After digging a little bit inside the code, i think problem comes from the shelljs exec :

        const build = shell.exec('docker-compose build', { async: true });

        return new Promise((resolve, reject) => {
            build.on('error', err => reject(err));
            build.on('close', () => resolve());
        });

I don't think this will catch any error occuring on the 'docker-composer' command

I will work on a PR for this