-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APP-2955] Add custom ENV_VAR
as Runtime Params
#54
Conversation
ENV_VAR
as Runtime Params
This reverts commit 3fe05b5.
The Needs Review labels were added based on the following file changes. Team @datarobot/applications (#applications) was assigned because of changes in files:drapps/create.py drapps/helpers/custom_app_sources_functions.py drapps/helpers/runtime_params_functions.py setup.py tests/cli/test_create.py tests/conftest.py If you think that there are some issues with ownership, please discuss with C&A domain at #core-backend-domain slack channel and create PR to update DRCODEOWNERS\CODEOWNERS file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question but otherwise I think its good 👍
Would like to request another review from @ben-cutler-datarobot or @demchukilya to make sure 👀
# request for uploading project data to source_version | ||
source_version_update_data_matcher = matchers.multipart_matcher( | ||
{'file': ('start-app.sh', entrypoint_script_content)}, | ||
data={'baseEnvironmentVersionId': ee_last_version_id, 'filePath': ['start-app.sh']}, | ||
) | ||
|
||
responses.patch( | ||
f'{api_endpoint_env}/customApplicationSources/{custom_app_source_id}/versions/{custom_app_source_version_id}/', | ||
match=[auth_matcher, source_version_update_data_matcher], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes this matcher no longer necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because the matcher
for the source version update was not working for multiple calls to the API w/ many different args.
if runtime_params: | ||
for param in runtime_params: | ||
response = session.patch(url, json={'runtimeParameterValues': param}) | ||
handle_dr_response(response) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to do as part of main payload instead of separate argument in second request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks functional, but It's better to fix places noted by me.
Additionally we can have a warning for cases when user try to use runtime parameters with uploading docker image.
drapps/create.py
Outdated
Extract the metadata.yaml file from the list of project files.. | ||
""" | ||
for file_path, relative_path in project_files: | ||
if relative_path.lower() == 'metadata.yaml': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need here lower
because on backend in DR we do not use it.
drapps/create.py
Outdated
custom_app_source_id, | ||
custom_app_source_version_id, | ||
payload, | ||
valid_runtime_params, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In such form, if we have more than 50 files, with each group of files we will have additional request with the same runtime params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JIRA Ticket:
Rationale:
ENV_VARS
as runtime params todr-apps
.ENV_VARS
as:--stringEnvVar FOO=BAR
,--stringEnvVar API_KEY="RANDOM API KEY"
--numericEnvVar INT_VAL=3
,--numericEnvVar FLOAT_VAL=3.14
Changes in this PR:
ENV_VARS
against themetadata.yaml
file.Demo:
APP-2955.mov