-
Notifications
You must be signed in to change notification settings - Fork 29
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 #84 from ScottyB/quality/for-demo
Quality/for demo
- Loading branch information
Showing
10 changed files
with
36 additions
and
17 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
company: a2i2 | ||
image: dock | ||
version: latest | ||
image: surround | ||
|
||
surround: | ||
stages: false | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
output: | ||
text: Hello World | ||
|
||
image: {project_name} | ||
company: yourcompany | ||
version: latest |
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,11 +1,16 @@ | ||
import logging | ||
from .wrapper import PipelineWrapper | ||
|
||
import os | ||
import json | ||
logging.basicConfig(level=logging.INFO) | ||
|
||
def main(): | ||
wrapper = PipelineWrapper() | ||
wrapper.run(None) | ||
config = wrapper.get_config() | ||
output = wrapper.run(json.dumps({{"data": "hello"}})) | ||
with open(os.path.join(config["output_path"], "output.txt"), 'w') as f: | ||
f.write(output["output"]) | ||
logging.info(output) | ||
|
||
if __name__ == "__main__": | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import os | ||
import json | ||
from surround import Surround, Wrapper, AllowedTypes | ||
from stages import ValidateData, {project_name}Data | ||
|
||
class PipelineWrapper(Wrapper): | ||
def __init__(self): | ||
surround = Surround([ValidateData()], __name__) | ||
type_of_uploaded_object = AllowedTypes.IMAGE | ||
self.config = surround.config | ||
super().__init__(surround, type_of_uploaded_object) | ||
super().__init__(surround) | ||
|
||
def run(self, input_data): | ||
data = {project_name}Data(input_data) | ||
text = json.loads(input_data)["data"] | ||
data = {project_name}Data(text) | ||
self.surround.process(data) | ||
|
||
with open(os.path.abspath(os.path.join(self.config["output_path"], "output.txt")), 'w') as f: | ||
f.write(data.output_data) | ||
return {{"output": data.output_data}} |
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,4 @@ | ||
output: | ||
text: Hello World | ||
|
||
image: {project_name} |