-
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.
Merge pull request #38 from danielfromearth/feature/issue-24-test-the…
…-docker-image-with-harmony Feature/issue 24 test the docker image with harmony
- Loading branch information
Showing
11 changed files
with
95 additions
and
52 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
"""A Harmony CLI wrapper around the concatenate-batcher""" | ||
import sys | ||
from argparse import ArgumentParser | ||
|
||
import harmony | ||
|
||
from batcher.harmony.service_adapter import ConcatBatching as HarmonyAdapter | ||
|
||
|
||
def main(argv, **kwargs): | ||
"""Main Harmony CLI entrypoint | ||
def main(config: harmony.util.Config = None) -> None: | ||
"""Parse command line arguments and invoke the service to respond to them. | ||
Parses command line arguments and invokes the appropriate method to respond to them | ||
Parameters | ||
---------- | ||
config : harmony.util.Config | ||
harmony.util.Config is injectable for tests | ||
Returns | ||
------- | ||
None | ||
""" | ||
|
||
config = None | ||
# Optional: harmony.util.Config is injectable for tests | ||
if "config" in kwargs: | ||
config = kwargs.get("config") | ||
|
||
parser = ArgumentParser( | ||
prog="Pre-concatenate-batching", description="Run the pre-concatenate-batching service" | ||
) | ||
harmony.setup_cli(parser) | ||
|
||
args = parser.parse_args(argv[1:]) | ||
args = parser.parse_args() | ||
if harmony.is_harmony_cli(args): | ||
harmony.run_cli(parser, args, HarmonyAdapter, cfg=config) | ||
else: | ||
parser.error("Only --harmony CLIs are supported") | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv) | ||
main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'batchee' ]; then | ||
exec batchee "$@" | ||
elif [ "$1" = 'batchee_harmony' ]; then | ||
exec batchee_harmony "$@" | ||
else | ||
exec batchee_harmony "$@" | ||
fi |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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