Session Ready
Exercise

Running a health check

The data science team at your company has been working closely with the DevOps team to ensure the production machine learning systems are reliable, elastic and fault-tolerant. Recently, there was an outage of a critical system that cost the company hundreds of thousands of dollars in lost revenue when a machine learning model began throwing exceptions instead of offering recommendations to shoppers. One solution that can be implemented is to run periodic health checks on production systems to ensure they have the correct environment. The DevOps team has written several bash scripts that your team will need to invoke from Python and run periodically.

Send the output of an echo 'python3' command to a healthcheck.sh script.

Instructions
100 XP
  • Echo 'python3' using subprocess.Popen.
  • Send the output of the echo subprocess to the ./healthcheck.sh script.
  • - Capture the output of subprocess that invokes ./healthcheck.sh and use assert to verify python3 is in the output.