def hibernate(app): """Pause an experiment and remove costly resources.""" verify_id(app) log("The database backup URL is...") backup_url = data.backup(app) log(backup_url) log("Scaling down the web servers...") for process in ["web", "worker"]: subprocess.check_call([ "heroku", "ps:scale", "{}=0".format(process), "--app", app_name(app) ]) subprocess.call(["heroku", "ps:scale", "clock=0", "--app", app_name(app)]) log("Removing addons...") addons = [ "heroku-postgresql", # "papertrail", "heroku-redis", ] for addon in addons: subprocess.check_call([ "heroku", "addons:destroy", addon, "--app", app_name(app), "--confirm", app_name(app) ])
def hibernate(app): """Pause an experiment and remove costly resources.""" log("The database backup URL is...") backup_url = data.backup(app) log(backup_url) log("Scaling down the web servers...") heroku_app = HerokuApp(app) heroku_app.scale_down_dynos() log("Removing addons...") addons = [ "heroku-postgresql", # "papertrail", "heroku-redis", ] for addon in addons: heroku_app.addon_destroy(addon)