7171 .with_shape_config_details (memory_in_gbs = 16 , ocpus = 1 )
7272 .with_block_storage_size (50 )
7373 .with_storage_mount (
74- OCIFileStorage (
75- destination_directory_name = "test_mount_one" ,
76- mount_target = "test_mount_target_one" ,
77- export_path = "test_export_path_one" ,
78- ),
7974 {
80- "destination_directory_name" : "test_mount_two" ,
81- "mount_target" : "test_mount_target_two" ,
82- "export_path" : "test_export_path_two" ,
83- "storage_type" : "FILE_STORAGE" ,
75+ "src" : "1.1.1.1:test_export_path_one" ,
76+ "dsc" : "test_mount_one" ,
8477 },
78+ {
79+ "src" : "2.2.2.2:test_export_path_two" ,
80+ "dsc" : "test_mount_two" ,
81+ },
8582 )
8683 )
8784 .with_runtime (
105102 ocpus: 1
106103 shapeName: VM.Standard.E3.Flex
107104 storageMount:
108- - destinationDirectoryName: test_mount_one
109- mountTarget: test_mount_target_one
110- exportPath: test_export_path_one
111- storageType: FILE_STORAGE
112- - destinationDirectoryName: test_mount_two
113- mountTarget: test_mount_target_two
114- exportPath: test_export_path_two
115- storageType: FILE_STORAGE
105+ - src: 1.1.1.1:test_export_path_one
106+ dsc: test_mount_one
107+ - src: 2.2.2.2:test_export_path_two
108+ dsc: test_mount_two
116109 subnetId: ocid1.subnet.oc1.iad.xxxx
117110 type: dataScienceJob
118111 name: My Job
@@ -136,16 +129,14 @@ def test_data_science_job_initialize(self):
136129 dsc_file_storage_one = job .infrastructure .storage_mount [0 ]
137130 assert isinstance (dsc_file_storage_one , OCIFileStorage )
138131 assert dsc_file_storage_one .storage_type == "FILE_STORAGE"
139- assert dsc_file_storage_one .destination_directory_name == "test_mount_one"
140- assert dsc_file_storage_one .mount_target == "test_mount_target_one"
141- assert dsc_file_storage_one .export_path == "test_export_path_one"
132+ assert dsc_file_storage_one .src == "1.1.1.1:test_export_path_one"
133+ assert dsc_file_storage_one .dsc == "test_mount_one"
142134
143135 dsc_file_storage_two = job .infrastructure .storage_mount [1 ]
144136 assert isinstance (dsc_file_storage_two , OCIFileStorage )
145137 assert dsc_file_storage_two .storage_type == "FILE_STORAGE"
146- assert dsc_file_storage_two .destination_directory_name == "test_mount_two"
147- assert dsc_file_storage_two .mount_target == "test_mount_target_two"
148- assert dsc_file_storage_two .export_path == "test_export_path_two"
138+ assert dsc_file_storage_two .src == "2.2.2.2:test_export_path_two"
139+ assert dsc_file_storage_two .dsc == "test_mount_two"
149140
150141 def test_data_science_job_from_yaml (self ):
151142 job_from_yaml = Job .from_yaml (job_yaml_string )
@@ -154,16 +145,14 @@ def test_data_science_job_from_yaml(self):
154145 dsc_file_storage_one = job_from_yaml .infrastructure .storage_mount [0 ]
155146 assert isinstance (dsc_file_storage_one , OCIFileStorage )
156147 assert dsc_file_storage_one .storage_type == "FILE_STORAGE"
157- assert dsc_file_storage_one .destination_directory_name == "test_mount_one"
158- assert dsc_file_storage_one .mount_target == "test_mount_target_one"
159- assert dsc_file_storage_one .export_path == "test_export_path_one"
148+ assert dsc_file_storage_one .src == "1.1.1.1:test_export_path_one"
149+ assert dsc_file_storage_one .dsc == "test_mount_one"
160150
161151 dsc_file_storage_two = job .infrastructure .storage_mount [1 ]
162152 assert isinstance (dsc_file_storage_two , OCIFileStorage )
163153 assert dsc_file_storage_two .storage_type == "FILE_STORAGE"
164- assert dsc_file_storage_two .destination_directory_name == "test_mount_two"
165- assert dsc_file_storage_two .mount_target == "test_mount_target_two"
166- assert dsc_file_storage_two .export_path == "test_export_path_two"
154+ assert dsc_file_storage_two .src == "2.2.2.2:test_export_path_two"
155+ assert dsc_file_storage_two .dsc == "test_mount_two"
167156
168157 def test_data_science_job_to_dict (self ):
169158 assert job .to_dict () == {
@@ -192,15 +181,13 @@ def test_data_science_job_to_dict(self):
192181 "blockStorageSize" : 50 ,
193182 "storageMount" : [
194183 {
195- "destinationDirectoryName" : "test_mount_one" ,
196- "mountTarget" : "test_mount_target_one" ,
197- "exportPath" : "test_export_path_one" ,
184+ "src" : "1.1.1.1:test_export_path_one" ,
185+ "dsc" : "test_mount_one" ,
198186 "storageType" : "FILE_STORAGE" ,
199187 },
200188 {
201- "destinationDirectoryName" : "test_mount_two" ,
202- "mountTarget" : "test_mount_target_two" ,
203- "exportPath" : "test_export_path_two" ,
189+ "src" : "2.2.2.2:test_export_path_two" ,
190+ "dsc" : "test_mount_two" ,
204191 "storageType" : "FILE_STORAGE" ,
205192 },
206193 ],
@@ -212,37 +199,31 @@ def test_data_science_job_to_dict(self):
212199 def test_mount_file_system_failed (self ):
213200 with pytest .raises (
214201 ValueError ,
215- match = "Either parameter `export_path ` or `export_id` must be provided to mount file system." ,
202+ match = "Missing required parameter. Either `src ` or `mount_target_id` is required for mounting file storage system." ,
216203 ):
217- OCIFileStorage (
218- destination_directory_name = "test_mount" ,
219- mount_target_id = "ocid1.mounttarget.oc1.iad.xxxx" ,
220- )
204+ OCIFileStorage ()
221205
222206 with pytest .raises (
223207 ValueError ,
224- match = "Either parameter `mount_target ` or `mount_target_id` must be provided to mount file system." ,
208+ match = "Missing required parameter. Either `src ` or `export_id` is required for mounting file storage system." ,
225209 ):
226210 OCIFileStorage (
227- destination_directory_name = "test_mount" ,
228- export_id = "ocid1.export.oc1.iad.xxxx" ,
211+ mount_target_id = "test_mount_target_id"
229212 )
230213
231214 with pytest .raises (
232215 ValueError ,
233- match = "Parameter `destination_directory_name` must be provided to mount file system." ,
216+ match = "Parameter `dsc` is required for mounting file storage system." ,
234217 ):
235218 OCIFileStorage (
236- mount_target_id = "ocid1.mounttarget.oc1.iad.xxxx" ,
237- export_id = "ocid1.export.oc1.iad.xxxx" ,
219+ src = "1.1.1.1:test_export_path"
238220 )
239221
240222 job_copy = copy .deepcopy (job )
241- dsc_file_storage = OCIFileStorage (
242- destination_directory_name = "test_mount" ,
243- mount_target = "test_mount_target" ,
244- export_id = "ocid1.export.oc1.iad.xxxx" ,
245- )
223+ dsc_file_storage = {
224+ "src" : "1.1.1.1:test_export_path" ,
225+ "dsc" : "test_mount" ,
226+ }
246227 storage_mount_list = [dsc_file_storage ] * 6
247228 with pytest .raises (
248229 ValueError ,
@@ -253,39 +234,10 @@ def test_mount_file_system_failed(self):
253234 job_copy = copy .deepcopy (job )
254235 with pytest .raises (
255236 ValueError ,
256- match = "Parameter `storage_mount` should be a list of either DSCFileSystem instances or dictionaries." ,
237+ match = "Parameter `storage_mount` should be a list of dictionaries." ,
257238 ):
258239 job_copy .infrastructure .with_storage_mount (dsc_file_storage , [1 , 2 , 3 ])
259240
260- job_copy = copy .deepcopy (job )
261- with pytest .raises (
262- ValueError ,
263- match = "Parameter `storage_type` must be provided for each file system to be mounted." ,
264- ):
265- job_copy .infrastructure .with_storage_mount (
266- dsc_file_storage ,
267- {
268- "destination_directory_name" : "test_mount" ,
269- "mount_target_id" : "ocid1.mounttarget.oc1.iad.xxxx" ,
270- "export_id" : "ocid1.export.oc1.iad.xxxx" ,
271- },
272- )
273-
274- job_copy = copy .deepcopy (job )
275- wrong_type = "WRONG_TYPE"
276- wrong_file_system_dict = {
277- "destination_directory_name" : "test_mount" ,
278- "mount_target_id" : "ocid1.mounttarget.oc1.iad.xxxx" ,
279- "export_id" : "ocid1.export.oc1.iad.xxxx" ,
280- "storage_type" : wrong_type ,
281- }
282- with pytest .raises (
283- ValueError , match = f"Storage type { wrong_type } is not supprted."
284- ):
285- job_copy .infrastructure .with_storage_mount (
286- dsc_file_storage , wrong_file_system_dict
287- )
288-
289241 @patch .object (oci .file_storage .FileStorageClient , "get_export" )
290242 @patch .object (oci .file_storage .FileStorageClient , "get_mount_target" )
291243 def test_update_storage_mount_from_dsc_model (
@@ -378,7 +330,7 @@ def test_update_job_infra(
378330 infrastructure = job_copy .infrastructure
379331 with pytest .raises (
380332 ValueError ,
381- match = "No `mount_target` with value test_mount_target_two found under compartment test_compartment_id ." ,
333+ match = "Can't find the compartment id or identifier from ip 1.1.1.1. Specify a valid `src` ." ,
382334 ):
383335 infrastructure ._update_job_infra (dsc_job_payload_copy )
384336
0 commit comments