Setting up Deep Lake in Your Cloud
Connecting Data From Your Cloud Using Deep Lake Managed Credentials
You can use Deep Lake while storing data in your own cloud (AWS, Azure, GCS) without data passing through Activeloop Servers. Most Deep Lake services run on the client, and our browser App or Python API directly read/write data from object storage.
Deep Lake Managed credentials should be set up for granting the client access to cloud storage. Managed Credentials use IAM Policies or Federated Credentials on Activeloop's backend to generate temporary credentials that are used by the client do access the data.
Default Storage
Default storage enables you to map the Deep Lake path al://org_id/dataset_name
to a cloud path of your choice. Subsequently, all datasets created using the Deep Lake path will be stored at the user-specified specified, and they can be accessed using API tokens and managed credentials from Deep Lake. By default, the default storage is set as Activeloop Storage, and you may change it using the UI below.
Note
In order to visualize data in the Deep Lake browser application, it is necessary to enable CORS in the bucket containing any source data.
Connecting Deep Lake Dataset in your Cloud to the Deep Lake to App
If you do not set the Default Storage as your own cloud, Datasets in user's clouds can be connected to the Deep Lake App using the Python API below. Once a dataset is connected to Deep Lake, it is assigned a Deep Lake path al://org_id/dataset_name
, and it can be accessed using API tokens and managed credentials from Deep Lake, without continuously having to specify cloud credentials.
Connecting Datasets in the Python API
# Step 1: Create/load the dataset directly in the cloud using your org_id and
# Managed Credentials (creds_key) for accessing the data
# (See Managed Credentials above)
ds = deeplake.empty/load('s3://my_bucket/dataset_name',
creds={'creds_key': 'managed_creds_key'}, org_id='my_org_id')
# Step 2a: Connect the dataset to Deep Lake, inheriting the dataset_name above
ds.connect()
## ->>> This produces a Deep Lake path for accessing the dataset such as:
## ---- 'hub://my_org_id/dataset_name'
## OR
# Step 2b: Specify your own path and dataset name for
# future access to the dataset.
# You can also specify different managed credentials, if desired
ds.connect(dest_path = 'hub://org_id/dataset_name', creds_key = 'my_creds_key')
Using Manage Credentials with Linked Tensors
Managed credentials can be used for accessing data stored in linked tensors. Simply add the managed credentials to the dataset's creds_keys and assign them to each sample.
ds.create_tensors('images', htype = 'link[image]', sample_compression = 'jpeg')
ds.add_creds_key('my_creds_key', managed=True)
ds.images.append(deeplake.link(link_to_sample, creds_key = 'my_creds_key')