Skip to content

Commit 3f814bc

Browse files
doks5murphp15
authored andcommitted
vdk-core: Add python_version configuration to config-help (#2271)
As part of the initiative to support multiple python versions for data job deployments, a new configuration property, `python_version` was introduced. This configuration, however, was not initially added to the output of the `vdk config-help` command. This change adds the `python_version` configuration to the JobConfigIniPlugin, as it is related to the config.ini file setup. Testing Done: Tested locally by running `vdk config-help` and verifying that the configuration is present in the output. Signed-off-by: Andon Andonov <andonova@vmware.com>
1 parent 0c60bb6 commit 3f814bc

File tree

1 file changed

+22
-0
lines changed
  • projects/vdk-core/src/vdk/internal/builtin_plugins/config

1 file changed

+22
-0
lines changed

projects/vdk-core/src/vdk/internal/builtin_plugins/config/vdk_config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
EXECUTION_ID = "EXECUTION_ID"
2626
OP_ID = "OP_ID"
2727
TEMPORARY_WRITE_DIRECTORY = "TEMPORARY_WRITE_DIRECTORY"
28+
PYTHON_VERSION = "PYTHON_VERSION"
2829

2930
log = logging.getLogger(__name__)
3031

@@ -202,6 +203,23 @@ def vdk_configure(self, config_builder: ConfigurationBuilder) -> None:
202203
default_value="always_enabled",
203204
description=description,
204205
)
206+
config_builder.add(
207+
key=PYTHON_VERSION,
208+
default_value=None,
209+
show_default_value=False,
210+
description="The python version, which is to be used for the data job deployment."
211+
" This configuration is to only be set in the [job] section of the config"
212+
".ini file, and will be ignored if set in any other way (e.g., as an environment"
213+
" variable). As the configuration is optional, if not set, the default python version"
214+
" set by the Control Service would be used. To see what python versions"
215+
" are supported by a Versatile Data Kit deployment, use the `vdk info` command.\n"
216+
" EXAMPLE USAGE:\n"
217+
" --------------\n"
218+
"[job]\n"
219+
"schedule_cron = */50 * * * *\n"
220+
"python_version = 3.9",
221+
)
222+
205223
if (
206224
self.__job_path
207225
and self.__job_path.exists()
@@ -231,6 +249,10 @@ def vdk_configure(self, config_builder: ConfigurationBuilder) -> None:
231249
JobConfigKeys.ENABLE_ATTEMPT_NOTIFICATIONS.value,
232250
job_config.get_enable_attempt_notifications(),
233251
)
252+
config_builder.set_value(
253+
JobConfigKeys.PYTHON_VERSION.value,
254+
job_config.get_python_version(),
255+
)
234256

235257
for key, value in job_config.get_vdk_options().items():
236258
config_builder.set_value(key, value)

0 commit comments

Comments
 (0)