-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the CLI interface, use API for uploading files. (#45)
* only save `MODEL` in settings, split the model name and version in Manager. * remove repeated env var `UPLOAD_PREFIX` * change order of Manager init for clarity. * add `setup.py` * add all env vars from `settings.py` * test against 2.7 and 3.8 for more robust CLI support * `model_name` and `model_version` refactored to `model` * move `_strip` lambda into utils as `strip_bucket_prefix`, use on init for jobs and managers. * use `defer.returnValue(result)` in `job.restart` * use `pytest.tmpdir` instead of `tempfile.TemporaryDirectory` * `JSONDecodeError` is a `ValueError`, but does not exist in python 2.x * DEBUG env var is unused and undocumented. * add storage_bucket as an optional manager kwarg * only include GPUs in output filename if NUM_GPUS is set. * add upload_results attribute to optionally upload the final file to the bucket. * define all env vars as argparse options and include in entrypoint. * move uploading logic into Job. use API for file uploads instead of `gcloud`. * add calculate_cost to conditionally use the Grafana API. * log times in each Job HTTP request * allow `scale` to be an empty string, but otherwise, cast to float. * promote `job_type` to primary input, and `model` as override option.
- Loading branch information
Showing
14 changed files
with
623 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,54 @@ | ||
# API to add/monitor jobs in Redis | ||
API_HOST= | ||
FILE= | ||
COUNT= | ||
# Debug Mode | ||
DEBUG= | ||
NUM_GPUS= | ||
|
||
# Google credentials | ||
STORAGE_BUCKET= | ||
|
||
# Batch API Host (IP Address or FQDN) | ||
HOST= | ||
|
||
# Grafana resources for cost estimation | ||
GRAFANA_HOST= | ||
GRAFANA_USER= | ||
GRAFANA_PASSWORD= | ||
|
||
# TensorFlow Servable | ||
MODEL= | ||
BACKOFF= | ||
POSTPROCESS= | ||
|
||
# Job Type | ||
JOB_TYPE= | ||
SCALE= | ||
LABEL= | ||
|
||
# Pre- and Post-Processing functions | ||
PREPROCESS= | ||
POSTPROCESS= | ||
|
||
# How frequently Jobs update their statuses | ||
UPDATE_INTERVAL= | ||
|
||
# Time to wait between starting jobs (for staggering redis entries) | ||
START_DELAY= | ||
|
||
# Time interval between Manager status checks | ||
MANAGER_REFRESH_RATE= | ||
|
||
# Time in seconds to expire the completed jobs. | ||
EXPIRE_TIME= | ||
|
||
# Name of upload folder in storage bucket. | ||
UPLOAD_PREFIX= | ||
|
||
# HTTP Settings | ||
CONCURRENT_REQUESTS_PER_HOST= | ||
|
||
# Log settings | ||
LOG_ENABLED= | ||
LOG_LEVEL= | ||
LOG_FILE= | ||
|
||
# Overwrite directories with environment variables | ||
DOWNLOAD_DIR= | ||
OUTPUT_DIR= | ||
LOG_DIR= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,11 @@ git: | |
language: python | ||
|
||
python: | ||
- 2.7 | ||
- 3.5 | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
|
||
cache: pip | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.