Skip to content

Commit 889be0f

Browse files
committed
Fix unit tests
1 parent f1e9798 commit 889be0f

20 files changed

+86
-68
lines changed

ads/jobs/builders/infrastructure/dataflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,5 +1148,5 @@ def init(self) -> "DataFlow":
11481148
.with_spark_version(self.spark_version or DEFAULT_SPARK_VERSION)
11491149
.with_num_executors(self.num_executors or DEFAULT_NUM_EXECUTORS)
11501150
.with_driver_shape(self.driver_shape or DEFAULT_SHAPE)
1151-
.with_executor_shape(self.with_executor_shape or DEFAULT_SHAPE)
1151+
.with_executor_shape(self.executor_shape or DEFAULT_SHAPE)
11521152
)

ads/jobs/builders/runtimes/container_runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ def init(self) -> "ContainerRuntime":
136136
return self.with_image(
137137
image="iad.ocir.io/namespace/image:tag",
138138
entrypoint=["bash", "--login", "-c"],
139-
cmd="{Container CMD. For the MLflow will be replaced with the Project CMD}",
139+
cmd="{Container CMD. For MLFlow, it will be replaced with the Project CMD}",
140140
)

ads/jobs/builders/runtimes/python_runtime.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ def init(self) -> "ScriptRuntime":
257257
super().init()
258258
return (
259259
self.with_entrypoint(
260-
"{Entrypoint script. For MLFlow, it will be replaced with the CMD}"
260+
"{Entrypoint script. For MLflow, it will be replaced with the CMD}"
261261
)
262262
.with_script(
263-
"{Path to the script. For MLFlow, it will be replaced with the path to the project}"
263+
"{Path to the script. For MLflow, it will be replaced with the path to the project}"
264264
)
265265
.with_argument(key1="val1")
266266
)
@@ -447,10 +447,10 @@ def init(self) -> "PythonRuntime":
447447
return (
448448
self.with_working_dir("{For MLflow the project folder will be used.}")
449449
.with_entrypoint(
450-
"{Entrypoint script. For MLFlow, it will be replaced with the CMD}"
450+
"{Entrypoint script. For MLflow, it will be replaced with the CMD}"
451451
)
452452
.with_script(
453-
"{Path to the script. For MLFlow, it will be replaced with the path to the project}"
453+
"{Path to the script. For MLflow, it will be replaced with the path to the project}"
454454
)
455455
)
456456

@@ -754,9 +754,9 @@ def init(self) -> "GitPythonRuntime":
754754
"""
755755
super().init()
756756
return self.with_source(
757-
"{Git URI. For MLFlow, it will be replaced with the Project URI}"
757+
"{Git URI. For MLflow, it will be replaced with the Project URI}"
758758
).with_entrypoint(
759-
"{Entry point script. For MLFlow, it will be replaced with the CMD}"
759+
"{Entrypoint script. For MLflow, it will be replaced with the CMD}"
760760
)
761761

762762

@@ -979,7 +979,7 @@ def init(self) -> "DataFlowRuntime":
979979
self._spec.pop(self.CONST_ENV_VAR, None)
980980
return (
981981
self.with_script_uri(
982-
"{Path to the executable script. For MLFlow, it will be replaced with the CMD}"
982+
"{Path to the executable script. For MLflow, it will be replaced with the CMD}"
983983
)
984984
.with_script_bucket(
985985
"{The object storage bucket to save a script. "

ads/opctl/backend/ads_dataflow.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,16 @@ def init(
8888
job = (
8989
Job()
9090
.with_name(
91-
"{Job name. For the MLFlow will be auto replaced with the Project name}"
91+
"{Job name. For MLflow, it will be replaced with the Project name}"
9292
)
9393
.with_infrastructure(
94-
DataFlow(**(self.config.get("infrastructure", {}) or {}))
94+
DataFlow(**(self.config.get("infrastructure", {}) or {})).init()
9595
)
9696
.with_runtime(
9797
DataFlowRuntimeFactory.get_runtime(
9898
key=runtime_type or DataFlowRuntime().type
9999
).init()
100100
)
101-
.build()
102101
)
103102

104103
note = (

ads/opctl/backend/ads_ml_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def init(
9898
job = (
9999
Job()
100100
.with_name(
101-
"{Job name. For the MLFlow will be auto replaced with the Project name}"
101+
"{Job name. For MLflow, it will be replaced with the Project name}"
102102
)
103103
.with_infrastructure(
104104
DataScienceJob(

tests/unitary/with_extras/opctl/test_files/dataflow_dataFlow.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This YAML specification was auto generated by the `ads opctl init` command.
22
# The more details about the jobs YAML specification can be found in the ADS documentation:
3-
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/apachespark/dataflow.html
3+
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/apachespark/dataflow.html
4+
45

56
kind: job
67
spec:
@@ -16,7 +17,7 @@ spec:
1617
scriptBucket: oci://bucket@namespace/prefix
1718
sparkVersion: 3.2.1
1819
type: dataFlow
19-
name: '{Job name. For the MLFlow will be auto replaced with the Project name}'
20+
name: '{Job name. For MLflow, it will be replaced with the Project name}'
2021
runtime:
2122
kind: runtime
2223
spec:
@@ -26,7 +27,7 @@ spec:
2627
freeformTags:
2728
tag_name: tag_value
2829
overwrite: true
29-
scriptBucket: oci://<bucket_name>@<tenancy>/<prefix>
30-
scriptPathURI: '{Path to the executable script. For the MLFlow will be replaced
30+
scriptBucket: '{The object storage bucket to save a script. Example: oci://<bucket_name>@<tenancy>/<prefix>}'
31+
scriptPathURI: '{Path to the executable script. For MLflow, it will be replaced
3132
with the CMD}'
3233
type: dataFlow

tests/unitary/with_extras/opctl/test_files/dataflow_dataFlowNotebook.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This YAML specification was auto generated by the `ads opctl init` command.
22
# The more details about the jobs YAML specification can be found in the ADS documentation:
3-
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/apachespark/dataflow.html
3+
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/apachespark/dataflow.html
4+
45

56
kind: job
67
spec:
@@ -16,7 +17,7 @@ spec:
1617
scriptBucket: oci://bucket@namespace/prefix
1718
sparkVersion: 3.2.1
1819
type: dataFlow
19-
name: '{Job name. For the MLFlow will be auto replaced with the Project name}'
20+
name: '{Job name. For MLflow, it will be replaced with the Project name}'
2021
runtime:
2122
kind: runtime
2223
spec:
@@ -26,7 +27,7 @@ spec:
2627
freeformTags:
2728
tag_name: tag_value
2829
overwrite: true
29-
scriptBucket: oci://<bucket_name>@<tenancy>/<prefix>
30-
scriptPathURI: '{Path to the executable script. For the MLFlow will be replaced
30+
scriptBucket: '{The object storage bucket to save a script. Example: oci://<bucket_name>@<tenancy>/<prefix>}'
31+
scriptPathURI: '{Path to the executable script. For MLflow, it will be replaced
3132
with the CMD}'
3233
type: dataFlowNotebook

tests/unitary/with_extras/opctl/test_files/job_container.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This YAML specification was auto generated by the `ads opctl init` command.
22
# The more details about the jobs YAML specification can be found in the ADS documentation:
3-
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/jobs/index.html
3+
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/jobs/index.html
4+
45

56
kind: job
67
spec:
@@ -17,11 +18,11 @@ spec:
1718
shapeName: VM.Standard2.1
1819
subnetId: ocid1.subnet.oc1.iad.<unique_id>
1920
type: dataScienceJob
20-
name: '{Job name. For the MLFlow will be auto replaced with the Project name}'
21+
name: '{Job name. For MLflow, it will be replaced with the Project name}'
2122
runtime:
2223
kind: runtime
2324
spec:
24-
cmd: '{Container CMD. For the MLflow will be replaced with the Project CMD}'
25+
cmd: '{Container CMD. For MLFlow, it will be replaced with the Project CMD}'
2526
entrypoint:
2627
- bash
2728
- --login

tests/unitary/with_extras/opctl/test_files/job_gitPython.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# The more details about the jobs YAML specification can be found in the ADS documentation:
33
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/jobs/index.html
44

5+
56
kind: job
67
spec:
78
infrastructure:
@@ -17,18 +18,18 @@ spec:
1718
shapeName: VM.Standard2.1
1819
subnetId: ocid1.subnet.oc1.iad.<unique_id>
1920
type: dataScienceJob
20-
name: '{Job name. For the MLFlow will be auto replaced with the Project name}'
21+
name: '{Job name. For MLflow, it will be replaced with the Project name}'
2122
runtime:
2223
kind: runtime
2324
spec:
2425
conda:
2526
type: published
26-
uri: oci://your_bucket@namespace/object_name
27-
entrypoint: '{Entry point script. For the MLflow will be replaced with the CMD}'
27+
uri: '{Path to the custom conda environment. Example: oci://your_bucket@namespace/object_name'
28+
entrypoint: '{Entrypoint script. For MLflow, it will be replaced with the CMD}'
2829
env:
2930
- name: env_name
3031
value: env_value
3132
freeformTags:
3233
tag_name: tag_value
33-
url: '{Git URI. For the MLFlow will be replaced with the Project URI}'
34+
url: '{Git URI. For MLflow, it will be replaced with the Project URI}'
3435
type: gitPython

tests/unitary/with_extras/opctl/test_files/job_notebook.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# The more details about the jobs YAML specification can be found in the ADS documentation:
33
# https://accelerated-data-science.readthedocs.io/en/latest/user_guide/jobs/index.html
44

5+
56
kind: job
67
spec:
78
infrastructure:
@@ -17,14 +18,14 @@ spec:
1718
shapeName: VM.Standard2.1
1819
subnetId: ocid1.subnet.oc1.iad.<unique_id>
1920
type: dataScienceJob
20-
name: '{Job name. For the MLFlow will be auto replaced with the Project name}'
21+
name: '{Job name. For MLflow, it will be replaced with the Project name}'
2122
runtime:
2223
kind: runtime
2324
spec:
2425
conda:
2526
type: published
26-
uri: oci://your_bucket@namespace/object_name
27-
entrypoint: '{Entry point notebook. For the MLFlow will be replaced with the
27+
uri: '{Path to the custom conda environment. Example: oci://your_bucket@namespace/object_name'
28+
entrypoint: '{Entrypoint notebook. For MLflow, it will be replaced with the
2829
CMD}'
2930
env:
3031
- name: env_name
@@ -34,6 +35,6 @@ spec:
3435
freeformTags:
3536
tag_name: tag_value
3637
notebookEncoding: utf-8
37-
source: '{Path to the source code directory. For the MLFlow will be replaced
38-
with path to the project}'
38+
source: '{Path to the source code directory. For MLflow, it will be replaced
39+
with the path to the project}'
3940
type: notebook

0 commit comments

Comments
 (0)