0 / 0
Adding data assets to a deployment space
Adding data assets to a deployment space

Adding data assets to a deployment space

Learn about various ways of adding and promoting data assets to a space and data types that are used in deployments.

Data can be:

  • A data file such as a .csv file
  • A connection to data that is located in a repository such as a database
  • Connected data that is located in a storage bucket. For details on how to use such data, refer to Using data from the Cloud Object Storage service

Notes:

  • For definitions of data-related terms, refer to Asset types and properties.
  • If your organization uses Watson Knowledge Catalog, a catalog can serve as a feature store so you can access data assets that contain features that can be shared across an organization. Data assets include metadata about where they are used in models. Catalogs have controlled access at the catalog and the data asset level.

You can add data to a space in one of these ways:

Data added to a space is managed in a similar way to data added to a Watson Studio project. For example:

  • Adding data to a space creates a new copy of the asset and its attachments within the space, maintaining a reference back to the project asset. If an asset such as a data connection requires access credentials, they persist and are the same whether you are accessing the data from a project or from a space.
  • Just like with data connection in a project, you can edit data connection details from the space.
  • Data assets are stored in a space in the same way that they are stored in a project. They use the same file structure for the space as the structure used for the project.

Adding data to space by using UI

To add data to space by using UI:

  1. From the Assets page of the deployment space, click Add to space.
  2. Choose the type of data asset to add:
    • Data to specify a file to upload
    • Connection to specify a connection to a data repository such as DB2
    • Connected data to connect to data in a storage object such as a Cloud Object Storage bucket
  3. Complete the steps to add the data.

The data asset displays in the space and is available for use as an input data source in a deployment job.

Adding data to space programmatically

For an example of how to add assets programmatically, refer to this sample notebook: Use SPSS and batch deployment with DB2 to predict customer churn

Data source reference types

Data source reference types are referenced in WML requests to represent input data and results locations. Use data_asset and connection_asset for these types of data sources:

  • Cloud Object Storage
  • Db2
  • Database data

Notes:

  • For Decision Optimization, the reference type is url.

Example data_asset payload

{"input_data_references": [{
    "type": "data_asset",
    "connection": {
    },
    "location": {
        "href": "/v2/assets/<asset_id>?space_id=<space_id>"
    }
}]

Example connection_asset payload

"input_data_references": [{
    "type": "connection_asset",
    "connection": {
        "id": "<connection_guid>"
    },
    "location": {
        "bucket": "<bucket_name>", 
        "file_name": "<directory_name>/<file_name>"
    }
    <other wdp-properties supported by runtimes>
}]

For more details and examples, refer to the documentation for:

Using data from the Cloud Object Storage service

Cloud Object Storage service can be used with deployment jobs through a connected data asset or a connection asset. To use data from the Cloud Object Storage service:

  1. Create a connection to IBM Cloud Object Storage by adding a Connection to your project or space and selecting Cloud Object Storage (infrastructure) or Cloud Object Storage as the connection type. Provide the secret key, access key, and login URL.

    Note When you are creating a connection to Cloud Object Storage or Cloud Object Storage (Infrastructure), you must specify both access_key and secret_key. If access_key and secret_key are not specified, downloading the data from that connection will not work in a batch deployment job. For reference, see IBM Cloud Object Storage connection and IBM Cloud Object Storage (infrastructure) connection

  2. Add input and output files to the deployment space as connected data by using the COS connection that you created.

Learn more:

Parent topic: Deployment spaces