eabglobal / juniper

Juniper is a cli based tool used to package lambda functions
Apache License 2.0
67 stars 9 forks source link

Feature Request: docker: true make sure docker is installed #10

Open pdiazvargas opened 5 years ago

pdiazvargas commented 5 years ago

What

When packaging lambda functions using docker and docker-compose (the default mode of juniper). Make sure that if the developer trying to build the artifacts has docker installed. This feature is meant to provide clear feedback to a user when the build fails due to a missing dependency.

If docker is missing when executing juni build notify the user and gracefully exit If docker-compose is missing when executing juni build notify the user and gracefully exit

Keep in mind the issue in which docker might not be a hard requirement of juniper. In that case, make sure that the validation step, is only invoked when the manifest has docker=true.

How

Implement a validation step in juniper that will validate when running juniper in docker mode, that docker and docker-compose are available. If these are not present, clearly notify the user.

Think about using the subprocess module in python as a way to invoke a docker/docker-compose command. Run the version commands on each dependency to validate the services are running and installed.

Why

Providing clear feedback to a user is fundamental in the adoption of the tool. Nothing more frustrating that getting random exceptions due to dependency misconfigurations.