Giter Site home page Giter Site logo

jamshale / aries-acapy-plugins Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger/aries-acapy-plugins

0.0 0.0 0.0 6.3 MB

aries-acapy-plugins

Home Page: https://wiki.hyperledger.org/display/aries

License: Apache License 2.0

Shell 0.73% Python 91.14% Dockerfile 4.03% JavaScript 1.98% HTML 0.30% CSS 0.49% TypeScript 1.33%

aries-acapy-plugins's Introduction

aries-acapy-plugins

This repository contains approved and tested plugins for Aries Cloudagent Python. This is to encourage collaboration and sharing of useful features not directly included in aca-py.

Developer Notes

  • Open devcontainer in VS Code
  • Python and all dependencies will be loaded
  • Poetry will be loaded and configured, dependencies will be installed
  • Docker and Docker Compose will be available

Repo Management Script

A script was developed to help with maitenance of the repo called repo_manager.py. To run it you need a current version of poetry and python available. Run python repo_manager.py and you will be met with 2 options.

  • (1) Is used for starting or adding a new plugin. It will generate all the common scaffolding for a plugin which has the expected format.
  • (2) Is used for updating and changing common poetry dependencies and configurations. It takes the poetry sections in the pyproject.toml files from the plugin_globals directory and combines them with the local plugin poetry sections. For the dependencies the common will be overridden by the globals. The other config sections will be replaced by the global configs. Then the lock files will be removed and re-installed.

Plugin Documentation

The development team should describe what the plugin does, any limitations (ex only in multitenant mode), any known issues interacting with other plugins, etc. Full documentation including a plugin_config sample should be provided.

This documentation should be provided in your plugin root as a README.md file. With at least a Description and Configuration section.

Build and Run

A Dockerfile is provided to run integration tests. This image is not intended for production as it copies the plugin source and loads its dependencies (including ACA-Py) along with a simplistic ACA-Py configuration file: default.yml.

Run and Debug

In the devcontainer, we can run an ACA-Py instance with our plugin source loaded and set breakpoints for debug (see launch.json).

To run your ACA-Py code in debug mode, go to the Run and Debug view, select "Run/Debug Plugin" and click Start Debugging (F5). Using default.yml, your agent swagger is available at http://localhost:3001/api/doc.

Testing

For the plugin to be accepted into this repo it must have adequate testing.

Unit Testing:

  • There should be adequate unit testing coverage. A coverage report is created when poetry run pytest . in ran from the devcontainer. A good mark to aim for is 90% but the quality of the tests on critical sections is more important than coverage percentage.
  • Mocking can be challenging. Study the existing plugins in this repo and aca-py in general for good examples of mocks and fixtures.
  • Put your unit tests in a tests folder in your plugin version path and name all files and test with the test_ prefix.

Integration Testing:

  • All plugins should have a suite of integration tests. The base suite will be created for your plugin after running the updater script
  • See integration tests. You should have everything you need to start integration testing and a sample test will be provided.

Deploy

For production use, plugins should be installed as libraries to an ACA-Py image.

This requires having a Dockerfile and a config file for your agent.

example Dockerfile:

FROM ghcr.io/hyperledger/aries-cloudagent-python:py3.9-0.11.0

USER root

# install plugins as binaries
RUN pip install git+https://github.com/hyperledger/aries-acapy-plugins@main#subdirectory=basicmessage_storage
RUN pip install git+https://github.com/hyperledger/aries-acapy-plugins@main#subdirectory=connection_update

USER $user
COPY ./configs configs

CMD ["aca-py"]

example config file (local single tenant):

label: plugins-agent

admin-insecure-mode: true
admin: [0.0.0.0, 9061]

inbound-transport:
   - [http, 0.0.0.0, 9060]
outbound-transport: http
endpoint: http://host.docker.internal:9060

genesis-url: http://test.bcovrin.vonx.io/genesis

emit-new-didcomm-prefix: true
wallet-type: askar
wallet-storage-type: default

auto-provision: true
debug-connections: true
auto-accept-invites: true
auto-accept-requests: true
auto-ping-connection: true
auto-respond-messages: true

log-level: info

plugin:
  - basicmessage_storage.v1_0
  - connection_update.v1_0

Now you can deploy a agent with as many plugins as you want as long as they are decalred in your build config file and installed.

docker build -f <Dockerfile> --tag acapy_plugins .
docker run -it -p 9060:9060 -p 9061:9061 --rm acapy_plugins start --arg-file=<config-file> -->

aries-acapy-plugins's People

Contributors

amanji avatar burdettadam avatar cjhowland avatar dbluhm avatar dependabot[bot] avatar ff137 avatar github-actions[bot] avatar jamshale avatar jsyro avatar loneil avatar mepeltier avatar rajpalc7 avatar ryjones avatar swcurran avatar timbl-ont avatar usingtechnology avatar wadebarnes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.