Skip to content

Commit

Permalink
Allow for separate code gen app config (#7)
Browse files Browse the repository at this point in the history
* Allow for seperate code gen app.config while retaining the helm chart generated config
  • Loading branch information
BenGalewsky authored Dec 7, 2022
1 parent 5db543e commit 6205cd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions servicex_codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def create_app(test_config=None, provided_translator=None):

if test_config:
app.config.from_mapping(test_config)
elif 'APP_CONFIG_FILE' in os.environ:
app.config.from_envvar('APP_CONFIG_FILE')
else:
if 'APP_CONFIG_FILE' in os.environ:
app.config.from_envvar('APP_CONFIG_FILE')
if 'CODEGEN_CONFIG_FILE' in os.environ:
app.config.from_envvar('CODEGEN_CONFIG_FILE')

with app.app_context():
translator = provided_translator
Expand Down
7 changes: 4 additions & 3 deletions servicex_codegen/post_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ def post(self):
body["code"], cache_path=tempdir)

zip_data = self.stream_generated_code(generated_code_result)
# code gen transformer returns the default transformer image mentioned in the config file
# code gen transformer returns the default transformer image mentioned in
# the config file
transformer_image = current_app.config.get("TRANSFORMER_SCIENCE_IMAGE")
# Send the response back to you-know-what.

# MultipartEncoder library takes multiple types of data fields and merge them into a multipart mime data type
# MultipartEncoder library takes multiple types of data fields and merge
# them into a multipart mime data type
m = MultipartEncoder(
fields={'transformer_image': transformer_image,
'zip_data': zip_data}
Expand Down

0 comments on commit 6205cd1

Please sign in to comment.