Observed since 20 Oct, 19:14 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
ad-components
Accelerated Discovery Reusable Components.
The central implementation of Accelerated Discover Reusable Components. It serves as a wrapper around client libraries we use locally like Dapr and MLflow.
All components will be availble using
pip install ad-components
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.
--version show program's version number and exit.
To use a component in your pipeline, you need to run it in a Step context
from ad.step import DaprStep
from ad.storage import download, upload
with DaprStep():
resp = download(download_src, download_dest, binding_name=binding)
print(f"download resp: {resp}")
resp = upload(upload_src, upload_dest, binding_name=binding)
print(f"upload resp: {resp}")
Running the components inside a step will make sure the client dependencies are handled correctly.
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
)
upload_resp = upload(
src, dest,
# binding_name="s3-state", # Or any other binding
)
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
adcwithpython ad/main.py ...if you don't have the package installed in your python environment.
adc storage download \
--src test.txt \
--dest tmp/downloaded.txt
adc storage upload \
--src tmp/downloaded.txt \
--dest local/uploaded.txt
Below is a list of the operations you might intend to perform in your component.
Uploads data from a file to an object in a bucket.
src: Name of file to download.dest: Object name in the bucket.binding: The name of the binding to perform the operation.Downloads data of an object to file.
src: Object name in the bucket.dest: Name of file to download.binding: The name of the binding to perform the operation.address: Dapr Runtime gRPC endpoint address.timeout: Value in seconds we should wait for sidecar to come upEvery change to the python script requires a new version to be pushed 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
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.
To be able to push to the package to our private registry, you need to tell PyPi about it. This one-liner command will take care of it for you
cat << EOF > $HOME/.pypirc
[distutils]
index-servers =
pypi
[pypi]
repository: https://upload.pypi.org/legacy/
username: __token__
password: $PYPI_TOKEN
EOF
Note: The pip package will fetch the version from
ad/version.pyfile, so make sure to increment before pushing.
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
bdist_egg · 16.95 KB · Python 3.7
sdist · 7.6 KB · Python source
Observed since 20 Oct, 19:14 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:ce2c6953c0b5e0106dfeaa658a284f02b2ba898d689cc6fc02d73a14132ca2d0