Skip to main content

Accelerated Discovery Reusable Components.

Project description

Storage Access Reusable Component

The central implementation of Accelerated Discover Reusable Components. It serves as a wrapper around Dapr and intended to replace the long implementations of dapr-related functionality in your kubeflow pipelines.

Installation

All components will be availble using

pip install ad-components

CLI

Here's an example usage of the CLI

usage: adc [-h] [--verbose] [--version] {<component>} ...

Accelerated Discovery reusable components.

positional arguments:
  <component>    the component that you want to trigger.

optional arguments:
  -h, --help     show this help message and exit.
  --verbose, -v  run the script in debug mode.
  --version      show program's version number and exit.

1. Supported components

1.1. Storage

1.1.1. Supported operations

Below is a list of the operations you might intend to perform in your component.

Upload

Uploads data from a file to an object in a bucket.

Arguments
  • src: Name of file to download.
  • dest: Object name in the bucket.
  • binding: The name of the binding to perform the operation.
Download

Downloads data of an object to file.

Arguments
  • src: Object name in the bucket.
  • dest: Name of file to download.
  • binding: The name of the binding to perform the operation.
Dapr configurations
  • address: Dapr Runtime gRPC endpoint address.
  • timeout: Value in seconds we should wait for sidecar to come up

2. Usage

2.1 Storage

4.2 Python module

You can invoke the manager using native python. Please note that the package must be present in you python environment.

from ad.storage import download, upload

download_resp = download(
    src, dest,
    # binding_name="s3-state",  # Or any other binding
    # address=None, # endpoint:port
    # timeout=300,  # in seconds
)

upload_resp = upload(
    src, dest,
    # binding_name="s3-state",  # Or any other binding
    # address=None, # endpoint:port
    # timeout=300,  # in seconds
)

4.3 CLI

usage: adc storage [-h] --src PATH --dest PATH [--binding NAME] [--timeout SEC] {download,upload}

positional arguments:
  {download,upload}     action to be performed on data.

optional arguments:
  -h, --help            show this help message and exit

action arguments:
  --src PATH, -r PATH   path of file to perform action on.
  --dest PATH, -d PATH  object's desired full path in the destination.
  --binding NAME, -b NAME
                        the name of the binding as defined in the components.

dapr arguments:
  --timeout SEC, -t SEC
                        value in seconds we should wait for sidecar to come up.

Note: You can replace adc with python ad/main.py ... if you don't have the package installed in your python environment.

Examples
  1. To download an object from S3 run
adc storage download \
    --src test.txt \
    --dest tmp/downloaded.txt \
    --verbose
  1. To upload an object to S3 run
adc storage upload \
    --src tmp/downloaded.txt \
    --dest local/uploaded.txt \
    --verbose

3. Verbose mode

If you want to run the script in verbose mode you can append --verbose or -v to the command.

4. Publishing

Every change to the python script requires to be pushed to a PyPi registry.

If you have the right (write) permissions, and a correctly-configured $HOME/.pypirc file, run the following command to publish the package

make

Note: We will run the install target to confirm the package is installable before publishing it to our PyPi registry.

Increment the version

To increment the version, go to adstorage/version.py and increment the version there. Both the setup.py and the CLI will read the new version correctly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ad_components-0.1.16-py3.9.egg (19.2 kB view details)

Uploaded Source

ad_components-0.1.16-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file ad_components-0.1.16-py3.9.egg.

File metadata

  • Download URL: ad_components-0.1.16-py3.9.egg
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for ad_components-0.1.16-py3.9.egg
Algorithm Hash digest
SHA256 6adae35567ecc71b4fb6861f9d8ebc7b5263ca553727f0e057848fcc90de1dbd
MD5 9929d8e798a525eea638449fe9d2a895
BLAKE2b-256 e8eb7c620136cf5a3c48e55026db0a800e4041c810aed1b5cf4ff0a3fd8dcb86

See more details on using hashes here.

File details

Details for the file ad_components-0.1.16-py3-none-any.whl.

File metadata

File hashes

Hashes for ad_components-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 aae5a7a7fecad57913205a14246d7109b7d4b3b6ac9dbbdd5a2c09e3347121f1
MD5 5e247208e4174c72ced0e4b3f1cc587e
BLAKE2b-256 8927e04cff2ae476933e85f0896ca8c80269d19356017e35895b0c427348df88

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page