From 2f94da47d89cb431bad68afe0446f65fb559820f Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 27 Sep 2022 15:40:00 -0600 Subject: [PATCH] Fix package definition, add shiv doc --- README.md | 32 ++++++++++++++++++++++++++++++++ setup.py | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 426b04c7..94fd9fc6 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,36 @@ Ensure that the following are already installed: deploy-system deploy a stack setup-repositories git clone the set of repositories required to build... ``` +#### Build a zipapp (single file distributable script) +Use shiv to build a single file Python executable zip archive of laconic-so: +1. Install [shiv](https://github.com/linkedin/shiv): + ``` + $ (venv) pip install shiv + ``` +1. Run shiv to create a zipapp file: + ``` + $ (venv) shiv -c laconic-so -o laconic-so . + ``` + This creates a file `./laconic-so` that is executable outside of any venv, and on other machines and OSes and architectures, and requiring only the system Python3: +1. Verify it works: + ``` + $ cp stack-orchetrator/laconic-so ~/bin + $ laconic-so + Usage: python -m laconic-so [OPTIONS] COMMAND [ARGS]... + + Laconic Stack Orchestrator + + Options: + --quiet + --verbose + --dry-run + -h, --help Show this message and exit. + + Commands: + build-containers build the set of containers required for a complete... + deploy-system deploy a stack + setup-repositories git clone the set of repositories required to build... + ``` ### CI Mode _write-me_ @@ -84,6 +114,8 @@ $ laconic-so --verbose deploy-system --include db-sharding,contract,ipld-eth-ser ``` $ laconic-so --verbose deploy-system --include db-sharding,contract,ipld-eth-server,go-ethereum-foundry down ``` +## Platform Support +Native aarm64 is _not_ currently supported. x64 emulation on ARM64 macos should work (not yet tested). ## Implementation The orchestrator's operation is driven by files shown below. `repository-list.txt` container the list of git repositories; `container-image-list.txt` contains the list of container image names, while `clister-list.txt` specifies the set of compose components (corresponding to individual docker-compose-xxx.yml files which may in turn specify more than one container). diff --git a/setup.py b/setup.py index 1a08ad0f..d302ee4f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh: requirements = fh.read() setup( name = 'laconic-stack-orchestrator', - version = '0.0.3', + version = '0.0.5', author = 'Cerc', author_email = 'info@cerc.io', license = 'GNU Affero General Public License', @@ -14,7 +14,7 @@ setup( long_description = long_description, long_description_content_type = "text/markdown", url = 'https://github.com/cerc-io/stack-orchestrator', - py_modules = ['orchestrator', 'app'], + py_modules = ['cli', 'app'], packages = find_packages(), install_requires = [requirements], python_requires='>=3.7',