Skip to main content

file-assets

A set of Teraslice processors for working with data stored in files on disk. The readers utilize the chunked-file-reader module (migrated into this bundle from the Teraslice monorepo) to break data into records.

Since all the readers in this asset bundle use DataEntities, the slice's file path can be retrieved from each record by using something like record.getMetadata('path'). More information about DataEntities can be found here.

This bundle includes the following processors:

Releases

You can find a list of releases, changes, and pre-built asset bundles here.

Getting Started

This asset bundle requires a running Teraslice cluster Documentation.

# Step 1: make sure you have teraslice-cli installed
yarn global add teraslice-cli

# Step 2:
teraslice-cli assets deploy clusterAlias terascope/file-assets

Connectors

S3 Connector

Configuration:

The S3 connector configuration, in your Teraslice configuration file, includes the following parameters:

ConfigurationDescriptionTypeNotes
endpointTarget S3 HTTP endpoint, must be URLStringoptional, defaults to http://127.0.0.1:80
accessKeyIdS3 access key IDStringrequired
secretAccessKeyS3 secret access keyStringrequired
regionAWS Region where bucket is locatedStringoptional, defaults to us-east-1
maxRetriesMaximum retry attemptsNumberoptional, defaults to 3
sslEnabledFlag to enable/disable SSL communicationBooleanoptional, defaults to true
caCertificateA string containing a single or multiple ca certificatesStringoptional, defaults to ' '
certLocationDEPRECATED - use caCertificate. Location of ssl certStringoptional, defaults to ' '
forcePathStyleWhether to force path style URLs for S3 objectsBooleanoptional, defaults to false
bucketEndpointWhether to use the bucket name as the endpoint for this requestBooleanoptional, defaults to false

Terafoundation S3 configuration example:

terafoundation:
    connectors:
        s3:
            default:
                endpoint: "http://localhost:9000"
                accessKeyId: "yourId"
                secretAccessKey: "yourPassword"
                forcePathStyle: true
                sslEnabled: true
                caCertificate: |
                    -----BEGIN CERTIFICATE-----
                    MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQs
                    ...
                    DXZDjC5Ty3zfDBeWUA==
                    -----END CERTIFICATE-----

Development

Tests

Run the file-assets tests

Requirements:

yarn test

Build

Build a compiled asset bundle to deploy to a teraslice cluster.

Install Teraslice CLI

yarn global add teraslice-cli
teraslice-cli assets build

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT licensed.