Updated on 2024-08-14 GMT+08:00

Common Usage

  • InputStorage (path concatenation)

    This object is used to centrally manage input directories. The following is an example:

    import modelarts.workflow as wf
    storage = wf.data.InputStorage(name="storage_name", title="title_info", description="description_info") # Only name is mandatory.
    input_data = wf.data.OBSPath(obs_path = storage.join("directory_path")) # Add a slash (/) after a directory, for example, storage.join("/input/data/").
    
    When a workflow is running, if the root path of the storage object is /root/, the obtained path will be /root/directory_path.
  • OutputStorage (directory creation)

    This object is used to centrally manage output directories and ensure that multiple executions of the same workflow are output to different directories. The following is an example:

    import modelarts.workflow as wf
    storage = wf.data.OutputStorage(name="storage_name", title="title_info", description="description_info") # Only name is mandatory.
    output_path = wf.data.OBSOutputConfig(obs_path = storage.join("directory_path")) # Only a directory can be created but not files.
    
    When a workflow is running, if the root path of the storage object is set to /root/, the system will automatically create a relative directory and the obtained path will be /root/Execution ID/directory_path.