arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Data Transfer Options

hashtag
ICA Connector

The platform provides Connectors to facilitate automation for operations on data (ie, upload, download, linking). The connectors are helpful when you want to sync data between ICA and your local computer or link data between projects in ICA.

  1. Service Connectorarrow-up-right

hashtag
ICA CLI

The ICA CLI upload/download proves beneficial when handling large files/folders, especially in situations where you're operating on a remote server by connecting from your local computer. You can use icav2 projects enter <project-name/id> to set the project context for the CLI to use for the commands when relevant. If the project context is not set, you can supply the additional parameter --project-id <project-id> to specify the project for the command.

hashtag
Upload Data

hashtag
Download Data

Note: Because of how S3 manages storage, it doesn't have a concept of folders in the traditional sense. So, if you provide the "folder" ID of an empty "folder", you will not see anything downloaded.

hashtag
ICA API

Another option to upload data to ICA is via . This option is helpful where data needs to be transferred via automated scripts. You can use the following two endpoints to upload a file to ICA.

  1. Post - with the following body which will create a partial file at the desired location and return a dataId for the file to be uploaded. {projectId} is the the project id for the destination project. You can find the projectId in yout projects details page (Project > Details > URN > urn:ilmn:ica:project:projectId#MyProject).

  2. Post - where dataId is the dataId from the response of the previous call. This call will generate the URL that you can use to upload the file.

hashtag
Example

  1. Create data in the project by making the API call below. If you don't already have the API-Key, refer to the instructions on the for guidance on generating one.

In the example above, we're generating a partial file named 'tempFile.txt' within a project identified by the project ID '41d3643a-5fd2-4ae3-b7cf-b89b892228be', situated inside a folder with the folder ID 'fol.579eda846f1b4f6e2d1e08db91408069'. You can access project, file, or folder IDs either by logging into the ICA web interface or through the use of the ICA CLI.

The response will look like this:

Retrieve the data/file ID from the response (for instance: fil.b13c782a67e24d364e0f08db9f537987) and employ the following format for the Post request - /api/projects/{projectId}/data/{dataId}:createUploadUrl:

The response will look like this:

Use the URL from the response to upload a file (tempFile.txt) as follows:

hashtag
AWS CLI

ICA allows you to directly upload/download data from ICA using . It is especially helpful when dealing with an unstable internet connection to upload or download a large amount of data. If the transfer gets interrupted midway, you can employ the sync command to resume the transfer from the point it was stopped.

To connect to ICA storage, you must first download and install AWS CLI on your local system. You will need temporary credentials to AWS CLI to access ICA storage. You can generate temporary credentials through the ICA CLI, which can be used to authenticate AWS CLI against ICA. The temporary credentials can be obtained using

hashtag
Generate temporary credentials

hashtag
Example cli to generate temporary credentials:

If you are trying to upload data to /cli-upload/ folder, you can get the temporary credentials to access the folder using icav2 projectdata temporarycredentials /cli-upload/. It will produce following output with accessKey, secretKey and sessionToken that you will need to configure AWS CLI to access this folder.

Copy the awsTempCredentials.accessKey, awsTempCredentials.secretKey and awsTempCredentials.sessionToken to build the credentials file: ~/.aws/credentials. It should look something like

hashtag
Example format for credentials file:

The temporary credentials expire in 36 hours. If the temporary credentials expire before the copy is complete, you can use AWS sync command to resume from where it left off.

Following are a few AWS commands to demonstrate the use. The remote path in the commands below are constructed off of the output of temporarycredentials command in this format: s3://<awsTempCredentials.bucket>/<awsTempCredentials.objectPrefix>

hashtag
Example AWS commands

You can also write scripts to monitor the progress of your copy operation and regenerate and refresh the temporary credentials before they expire.

hashtag
Rclone

You can also use for data transfer. Generate temporary credentials between your source and destination projects with the . You can run rclone config to set keys and tokens to configure rclone with the temporary credentials. You will need to select the advanced edit option when asked to enter the session key.

After completing the configuration, your config file (~/.config/rclone/rclone.conf) should look like this:

hashtag
Example rclone commands

The option --s3-no-check-bucket skips the verification of the Amazon S3 Bucket properties and permissions.

As rclone performs pre-checks on the files to be transferred, it can take some time before the actual transfer starts.

hashtag
Using rclone in Bench

In Bench, Read-only mounts offer improved performance over using the data/project/ folder when transferring data because of higher concurrency and more efficient file handling. You create read-only mounts with workspace-ctl data create mount

Project Connectorarrow-up-right
ICA APIarrow-up-right
/api/projects/{projectId}/dataarrow-up-right
​/api​/projects​/{projectId}​/data​/{dataId}:createUploadUrlarrow-up-right
support pagearrow-up-right
AWS CLIarrow-up-right
configurearrow-up-right
this ICA API endpointarrow-up-right
rclonearrow-up-right
steps described above
> icav2 projects list #note the project-name/id.
> icav2 projects enter <project-name/id> # set the project context
> icav2 projectdata upload <localFileFolder> <remote-path> # upload localFileFolder to remote-path

#Example:
> icav2 projects enter demo
> icav2 projectdata upload localFolder /uploads/
> icav2 projectdata list # note the data-id
> icav2 projectdata download <data-id> # download the data.
 {
 "name": "string",
 "folderId": "string",
 "folderPath": "string",
 "formatCode": "string",
 "dataType": "FILE"
 }
 {
 "url": "string"
 }
 curl -X 'POST' \
 'https://ica.illumina.com/ica/rest/api/projects/41d3643a-5fd2-4ae3-b7cf-b89b892228be/data' \
 -H 'accept: application/vnd.illumina.v3+json' \
 -H 'X-API-Key: XXXXXXXXXXXXXXXX' \
 -H 'Content-Type: application/vnd.illumina.v3+json' \
 -d '{
 "name": "tempFile.txt",
 "folderId": "fol.579eda846f1b4f6e2d1e08db91408069",
 "dataType": "FILE"
 }'
{
"data": {
    "id": "fil.b13c782a67e24d364e0f08db9f537987",
    "urn": "string",
    "details": {
    "timeCreated": "2023-08-22T19:27:31.286Z",
    "timeModified": "2023-08-22T19:27:31.286Z",
    "creatorId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "tenantName": "string",
    "owningProjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "owningProjectName": "string",
    "name": "string",
    "path": "string",
    "fileSizeInBytes": 0,
    "status": "PARTIAL",
    "tags": {
        "technicalTags": [
        "string"
        ],
        "userTags": [
        "string"
        ],
        "connectorTags": [
        "string"
        ],
        "runInTags": [
        "string"
        ],
        "runOutTags": [
        "string"
        ],
        "referenceTags": [
        "string"
        ]
    },
    "format": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "timeCreated": "2023-08-22T19:27:31.286Z",
        "timeModified": "2023-08-22T19:27:31.286Z",
        "ownerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantName": "string",
        "code": "string",
        "description": "string",
        "mimeType": "string"
    },
    "dataType": "FILE",
    "objectETag": "string",
    "storedForTheFirstTimeAt": "2023-08-22T19:27:31.286Z",
    "region": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "timeCreated": "2023-08-22T19:27:31.286Z",
        "timeModified": "2023-08-22T19:27:31.286Z",
        "ownerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantName": "string",
        "code": "string",
        "country": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "timeCreated": "2023-08-22T19:27:31.286Z",
        "timeModified": "2023-08-22T19:27:31.286Z",
        "ownerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenantName": "string",
        "code": "string",
        "name": "string",
        "region": "string"
        },
        "cityName": "string"
    },
    "willBeArchivedAt": "2023-08-22T19:27:31.286Z",
    "willBeDeletedAt": "2023-08-22T19:27:31.286Z",
    "sequencingRun": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "instrumentRunId": "string",
        "name": "string"
    }
    }
},
"projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
curl -X 'POST' \
'https://ica.illumina.com/ica/rest/api/projects/41d3643a-5fd2-4ae3-b7cf-b89b892228be/data/fil.b13c782a67e24d364e0f08db9f537987:createUploadUrl' \
-H 'accept: application/vnd.illumina.v3+json' \
-H 'X-API-Key: XXXXXXXXXX' \
-d ''
{
"url": "string"
}
curl --upload-file tempFile.txt "url"
> icav2 projectdata temporarycredentials --help
This command fetches  temporal AWS and Rclone credentials for a given project-data. If path is given, project id from the flag --project-id is used. If flag not present project is taken from the context

Usage:
    icav2 projectdata temporarycredentials [path or data Id] [flags]

Flags:
-h, --help                help for temporarycredentials
    --project-id string   project ID to set current project context

Global Flags:
-t, --access-token string    JWT used to call rest service
-o, --output-format string   output format (default "table")
-s, --server-url string      server url to direct commands
-k, --x-api-key string       api key used to call rest service
> icav2 projectdata temporarycredentials /cli-upload/
awsTempCredentials.accessKey                     XXXXXXXXXX
awsTempCredentials.bucket                        stratus-gds-use1
awsTempCredentials.objectPrefix                  XXXXXX/cli-upload/
awsTempCredentials.region                        us-east-1
awsTempCredentials.secretKey                     XXXXXXXX
awsTempCredentials.serverSideEncryptionAlgorithm AES256
awsTempCredentials.sessionToken                  XXXXXXXXXXXXXXXX
[profile]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
aws_session_token = IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZVERYLONGSTRINGEXAMPLE
#Copy single file to ICA
> aws s3 cp cp1 s3://stratus-gds-use1/53395234-6b20-4fb1-3587-08db9144d245/cli-upload/

#Sync local folder to ICA
> aws s3 sync cli-upload s3://stratus-gds-use1/53395234-6b20-4fb1-3587-08db9144d245/cli-upload
[s3-config]
type = s3
provider = AWS
env_auth = false
access_key_id = XXXXXXXXXX
secret_access_key = XXXXXXX
region = us-east-1
acl = private
session_token = XXXXXXXX
#Copy single file to ICA
> rclone copy file.txt s3-config:stratus-gds-use1/53395234-6b20-4fb1-3587-08db9144d245/cli-upload/ --s3-no-check-bucket
#Sync local folder to ICA
> rclone sync cli-upload s3-config:stratus-gds-use1/53395234-6b20-4fb1-3587-08db9144d245/cli-upload/ --s3-no-check-bucket