Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.15 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.15 KB

Whale_Watcher

A rudimentary Python tool used to manage the execution of software within Docker containers on a single machine. This is done in an encapsulated manner, allowing multiple containers to be run simultaneously and independently. See ARCHITECTURE.md for my thoughts on tradeoffs when implementing this tool under a 3 hour time constraint.

Requirements:

  1. Accept a bash command.
  2. Launch a Docker container to run the command.
  3. Collect logs real-time (STDOUT/STDERR) while the command runs.
  4. The logs should be saved and identifiable in a logs directory.
  5. Clean up when the command finishes and handle expected failures.
  6. Have the ability to stop a specified container (without losing any logs).

Usage

  • Make the file executable
chmod +x <script_name>
  • Run some command inside a container
./script_name -r 'my command'
  • To have more control over bash and run longer commands
./script_name -b 'my super long command with -options'
  • To stop a specified container
./script_name stop 'container_name_or_id'
  • To kill a container
./script_name kill 'container_name_or_id'