-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sample job manifest file, API for read-only view of it
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
from typing import Any, Sequence | ||
|
||
import simplejson | ||
|
||
|
||
class _ManifestReader: | ||
def read(filename) -> Sequence[Any]: | ||
local_root = os.path.dirname(__file__) | ||
with open(os.path.join(local_root, filename)) as stream: | ||
contents = simplejson.loads(stream.read()) | ||
assert isinstance(contents, Sequence) | ||
return contents | ||
|
||
|
||
def read_jobs_manifest() -> Sequence[Any]: | ||
return _ManifestReader.read("run_manifest.json") |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[{ "id": "abc1234", "job_type": "ToyJob", "params": { "p1": "value1" } }] |