Package: madam-mam
MADAMMADAM is the Multi Agent Digital Asset Manager.It provides a three-tier architecture platform to handle workflow processing in a distributed environment.It uses Docker swarm to dispatch processes in a cluster of machines.It is a free (as freedom) software written in Python.DocumentationLink to the documentationSupportIf you find this project useful and want to contribute, please submit issues, merge requests. If you use it regularly,
you can help by the author by a financial support.<script src="https://liberapay.com/vit/widgets/button.js"></script><a href="https://liberapay.com/vit/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>RequirementsYou will needCamunda Modeler 4.11+to easily create
Zeebe BPMN XML workflows for MADAM.LicensingMADAM is licensed under theGnu Public License Version 3.Camunda Modeler is licensed underthe MIT License (MIT).At its core, MADAM useadhesive-zebe, a BPMN workflow python engine able to
execute Zeebe BPMN XML workflows. It is a fork ofadhesiveunder
the original adhesive license that isGNU Affero General Public License v3.0System environment setupInstall Docker.Configure userns-remapto map container userrootto a
host non-root user.Configure the dev station as aDocker Swarm Manager.Install aPostgresqldatabase server.You can use the Ansible playbook provided to install PostgreSQL locally with Docker,
after configuringhosts.yaml:make environmentPython environment setupIt requires Python 3.8+.Pyenvshould be used to choose the right version of Python, without breaking the
default Python of the Operating System.A Python virtual environment should be created in a.venvfolder.pyenvinstall3.8.0pyenvshell3.8.0python-mvenv.venvsource.venv/bin/activate`Installation/UpdateFrom PyPI:In a Python virtualenv:pip install -U madam-mamIn your user install directory:pip install --user -U madam-mamYou should have a themadamcli command available:madamormadam --helpwill display command usage.To have bash completion, you can type:_MADAM_COMPLETE=source_bash madam > madam-complete.sh
sudo cp madam-complete.sh /etc/bash_completion.d/.For another shell, replacesource_bashbysource_zshorsource_fishDevelopment environmentInstallPoetrywith the custom installer:curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | pythonInstall Python dependencies:poetry install --no-rootCopybin/pre-commit.shfor pre-commmit git hooks:cp bin/pre-commit.sh .git/hooks/pre-commitYou can use the madam-cli dev command:./bin/madam-cliGetbin/madam-clibash shell completion:_MADAM_CLI_COMPLETE=source_bash bin/madam-cli > madam-cli-complete.sh
sudo cp madam-cli-complete.sh /etc/bash_completion.d/.For another shell, replacesource_bashbysource_zshorsource_fishConfigurationMake a copy of the environment config example file:cp .env.example .envEdit.envto suit your needs, then:export $(grep -v '^#' .env | xargs -d '\n')Make a copy of the Ansible inventory example file:cp hosts.yaml.example hosts.yamlEdithosts.yamlto suit your needs.Make a copy of the MADAM config example file:cp madam.yaml.example madam.yamlEditmadam.yamlto suit your needs.Make a copy of the MADAM config example file for the test environment:cp madam_tests.yaml.example madam_tests.yamlEditmadam_tests.yamlto suit your needs.Make a copy of the MADAM config example file for the local deploy:cp madam_deploy.yaml.example madam_deploy.yamlEditmadam_deploy.yamlto suit your needs.Check static type and code qualitymake checkRun testsRun allpytesttests with:make testsRun only some tests by usingbin/tests.sh:bin/tests.sh tests/domains/test_workflows.py::test_createDatabase setupSetDATABASE_URLandDATABASE_URL_TESTSenvironment variable in.envfile:DATABASE_URL=postgresql://postgres:xxxxx@hostname:5432/madam?sslmode=allow
DATABASE_URL_TESTS=postgresql://postgres:xxxxx@hostname:5432/madam_tests?sslmode=allowMigrations scriptsAdd/Edit scripts inresources/migrationsdirectory:# version.name.[rollback].sql
00001.init_tables.sql
00001.init_tables.rollback.sqlMigrate commandsmake databases
make databases_rollback
make databases_listDeploymentSet and tag project version in Git./bin/release.sh 1.0.0Build MADAM python package and Docker imageBuild python wheel and docker image:make buildThe wheel package will be build in thedistdirectory.Push docker image on private registry:docker image tag madam:[version] registry_hostname:registry_port/madam:[version]
docker push registry_hostname:registry_port/madam:[version]Deploy MADAM as local docker containerFirst you need to have docker installed locally, and the node declared as a swarm manager.By default, docker swarm services will run as root, so files will be created as root user.You can change the user and group for the agents by setting the UID and GID in the docker.user parameter in madam.yml conbfig file:docker:
  base_url: "unix://var/run/docker.sock"
  user: "1000:1000" # Here the agents will run as the 1000 user and 1000 group
  networks: []To deploy MADAM container on localhost:make deployPublish to PyPI and Docker HubConfigure poetry with PyPI Access Token:poetry config pypi-token.pypi your-api-tokenPublish the Python package on PyPI:make publish