From c99687cc80f76fa610477b23a540632ec5e9ddc3 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 7 Jan 2023 20:44:08 -0700 Subject: [PATCH 1/4] Switch to Python3 importlib --- app/build_containers.py | 8 +++++--- app/build_npms.py | 8 +++++--- app/data/__init__.py | 0 app/deploy_system.py | 8 +++++--- app/setup_repositories.py | 8 +++++--- 5 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 app/data/__init__.py diff --git a/app/build_containers.py b/app/build_containers.py index c74df1e..fde6c30 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -24,7 +24,7 @@ import os from decouple import config import subprocess import click -import pkg_resources +import importlib from .util import include_exclude_check # TODO: find a place for this @@ -58,8 +58,10 @@ def command(ctx, include, exclude): if not os.path.isdir(dev_root_path): print('Dev root directory doesn\'t exist, creating') - with pkg_resources.resource_stream(__name__, "data/container-image-list.txt") as container_list_file: - containers = container_list_file.read().decode().splitlines() + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file: + containers = container_list_file.read().splitlines() if verbose: print(f'Containers: {containers}') diff --git a/app/build_npms.py b/app/build_npms.py index e00c073..905a54c 100644 --- a/app/build_npms.py +++ b/app/build_npms.py @@ -21,7 +21,7 @@ import os from decouple import config import click -import pkg_resources +import importlib from python_on_whales import docker from .util import include_exclude_check @@ -50,8 +50,10 @@ def command(ctx, include, exclude): if not os.path.isdir(dev_root_path): print('Dev root directory doesn\'t exist, creating') - with pkg_resources.resource_stream(__name__, "data/npm-package-list.txt") as package_list_file: - packages = package_list_file.read().decode().splitlines() + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file: + packages = package_list_file.read().splitlines() if verbose: print(f'Packages: {packages}') diff --git a/app/data/__init__.py b/app/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/deploy_system.py b/app/deploy_system.py index 45f6b61..169e0d6 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -20,7 +20,7 @@ import os import sys from python_on_whales import DockerClient import click -import pkg_resources +import importlib from .util import include_exclude_check @@ -49,8 +49,10 @@ def command(ctx, include, exclude, cluster, command, services): if verbose: print(f"Using cluster name: {cluster}") - with pkg_resources.resource_stream(__name__, "data/pod-list.txt") as pod_list_file: - pods = pod_list_file.read().decode().splitlines() + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + with importlib.resources.open_text(data, "pod-list.txt") as pod_list_file: + pods = pod_list_file.read().splitlines() if verbose: print(f"Pods: {pods}") diff --git a/app/setup_repositories.py b/app/setup_repositories.py index 3086cbb..bb1c3c6 100644 --- a/app/setup_repositories.py +++ b/app/setup_repositories.py @@ -22,7 +22,7 @@ from decouple import config import git from tqdm import tqdm import click -import pkg_resources +import importlib from .util import include_exclude_check @@ -91,8 +91,10 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file): print('Dev root directory doesn\'t exist, creating') os.makedirs(dev_root_path) - with pkg_resources.resource_stream(__name__, "data/repository-list.txt") as repository_list_file: - all_repos = repository_list_file.read().decode().splitlines() + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + with importlib.resources.open_text(data, "repository-list.txt") as repository_list_file: + all_repos = repository_list_file.read().splitlines() if verbose: print(f"Repos: {all_repos}") From 0435a71b5e6d76edcc7281c30d1d8ac9a31683e4 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 7 Jan 2023 21:02:14 -0700 Subject: [PATCH 2/4] Refactor for shiv package --- app/build_containers.py | 9 ++++----- .../data/compose}/docker-compose-contract.yml | 0 .../data/compose}/docker-compose-eth-probe.yml | 0 .../docker-compose-eth-statediff-fill-service.yml | 0 .../data/compose}/docker-compose-fixturenet-eth.yml | 0 .../data/compose}/docker-compose-fixturenet-laconicd.yml | 0 .../data/compose}/docker-compose-go-ethereum-foundry.yml | 0 .../data/compose}/docker-compose-ipld-eth-beacon-db.yml | 0 .../compose}/docker-compose-ipld-eth-beacon-indexer.yml | 0 .../data/compose}/docker-compose-ipld-eth-db.yml | 0 .../data/compose}/docker-compose-ipld-eth-server.yml | 0 .../data/compose}/docker-compose-keycloak.yml | 0 .../data/compose}/docker-compose-laconicd.yml | 0 .../data/compose}/docker-compose-prometheus-grafana.yml | 0 {compose => app/data/compose}/docker-compose-test.yml | 0 .../data/compose}/docker-compose-tx-spammer.yml | 0 .../data/compose}/docker-compose-watcher-erc20.yml | 0 .../data/compose}/docker-compose-watcher-erc721.yml | 0 .../data/compose}/docker-compose-watcher-mobymask.yml | 0 .../data/compose}/docker-compose-watcher-uniswap-v3.yml | 0 .../data/config}/fixturenet-eth/fixturenet-eth.env | 0 .../config}/fixturenet-laconicd/create-fixturenet.sh | 0 .../data/config}/ipld-eth-beacon-indexer/indexer.env | 0 {config => app/data/config}/ipld-eth-server/chain.json | 0 .../data/config}/keycloak/import/cerc-realm.json | 0 {config => app/data/config}/keycloak/keycloak.env | 0 .../data/config}/keycloak/nginx/keycloak_proxy.conf | 0 .../config}/postgresql/create-pg-stat-statements.sql | 0 .../config}/postgresql/multiple-postgressql-databases.sh | 0 {config => app/data/config}/tx-spammer/tx-spammer.env | 0 .../data/config}/watcher-erc20/erc20-watcher.toml | 0 .../data/config}/watcher-erc721/erc721-watcher.toml | 0 .../config}/watcher-mobymask/mobymask-watcher-db.sql | 0 .../data/config}/watcher-mobymask/mobymask-watcher.toml | 0 .../data/config}/watcher-uniswap-v3/erc20-watcher.toml | 0 {config => app/data/config}/watcher-uniswap-v3/run.sh | 0 .../config}/watcher-uniswap-v3/uni-info-watcher.toml | 0 .../data/config}/watcher-uniswap-v3/uni-watcher.toml | 0 .../data/config}/watcher-uniswap-v3/watch-contract.sh | 0 .../data/container-build}/cerc-builder-js/Dockerfile | 0 .../data/container-build}/cerc-builder-js/README.md | 0 .../build-npm-package-local-dependencies.sh | 0 .../cerc-builder-js/build-npm-package.sh | 0 .../data/container-build}/cerc-builder-js/entrypoint.sh | 0 .../cerc-builder-js/yarn-local-registry-fixup.sh | 0 .../data/container-build}/cerc-eth-probe/build.sh | 0 .../cerc-eth-statediff-fill-service/build.sh | 0 .../container-build}/cerc-eth-statediff-service/build.sh | 0 .../container-build}/cerc-fixturenet-eth-geth/Dockerfile | 0 .../container-build}/cerc-fixturenet-eth-geth/build.sh | 0 .../cerc-fixturenet-eth-geth/genesis/Makefile | 0 .../genesis/accounts/import_keys.sh | 0 .../genesis/accounts/mnemonic_to_csv.py | 0 .../cerc-fixturenet-eth-geth/genesis/el/build_el.sh | 0 .../cerc-fixturenet-eth-geth/genesis/el/el-config.yaml | 0 .../container-build}/cerc-fixturenet-eth-geth/run-el.sh | 0 .../cerc-fixturenet-eth-lighthouse/Dockerfile | 0 .../cerc-fixturenet-eth-lighthouse/build.sh | 0 .../cerc-fixturenet-eth-lighthouse/genesis/Makefile | 0 .../genesis/cl/beacon_node.sh | 0 .../genesis/cl/bootnode.sh | 0 .../genesis/cl/build_cl.sh | 0 .../cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh | 0 .../genesis/cl/reset_genesis_time.sh | 0 .../genesis/cl/validator_client.sh | 0 .../cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env | 0 .../cerc-fixturenet-eth-lighthouse/run-cl.sh | 0 .../cerc-fixturenet-eth-lighthouse/scripts/status.sh | 0 .../container-build}/cerc-go-ethereum-foundry/Dockerfile | 0 .../container-build}/cerc-go-ethereum-foundry/build.sh | 0 .../cerc-go-ethereum-foundry/deploy-local-network.sh | 0 .../cerc-go-ethereum-foundry/genesis-automine.json | 0 .../cerc-go-ethereum-foundry/genesis.json | 0 .../cerc-go-ethereum-foundry/start-private-network.sh | 0 .../cerc-go-ethereum-foundry/stateful/foundry.toml | 0 .../stateful/lib/ds-test/LICENSE | 0 .../stateful/lib/ds-test/Makefile | 0 .../stateful/lib/ds-test/default.nix | 0 .../stateful/lib/ds-test/demo/demo.sol | 0 .../stateful/lib/ds-test/src/test.sol | 0 .../cerc-go-ethereum-foundry/stateful/src/Stateful.sol | 0 .../stateful/src/test/Stateful.t.sol | 0 .../data/container-build}/cerc-go-ethereum/build.sh | 0 .../container-build}/cerc-ipld-eth-beacon-db/build.sh | 0 .../cerc-ipld-eth-beacon-indexer/build.sh | 0 .../data/container-build}/cerc-ipld-eth-db/build.sh | 0 .../data/container-build}/cerc-ipld-eth-server/build.sh | 0 .../data/container-build}/cerc-keycloak/Dockerfile | 0 .../data/container-build}/cerc-keycloak/build.sh | 0 .../cerc-laconic-registry-cli/Dockerfile | 0 .../container-build}/cerc-laconic-registry-cli/build.sh | 0 .../data/container-build}/cerc-laconicd/build.sh | 0 .../data/container-build}/cerc-lighthouse/Dockerfile | 0 .../data/container-build}/cerc-lighthouse/build.sh | 0 .../container-build}/cerc-lighthouse/start-lighthouse.sh | 0 .../data/container-build}/cerc-test-container/Dockerfile | 0 .../data/container-build}/cerc-test-container/build.sh | 0 .../data/container-build}/cerc-test-container/run.sh | 0 .../data/container-build}/cerc-test-contract/build.sh | 0 .../data/container-build}/cerc-tx-spammer/build.sh | 0 .../container-build}/cerc-uniswap-v3-info/Dockerfile | 0 .../data/container-build}/cerc-uniswap-v3-info/build.sh | 0 .../data/container-build}/cerc-watcher-erc20/Dockerfile | 0 .../data/container-build}/cerc-watcher-erc20/build.sh | 0 .../data/container-build}/cerc-watcher-erc721/Dockerfile | 0 .../data/container-build}/cerc-watcher-erc721/build.sh | 0 .../container-build}/cerc-watcher-mobymask/Dockerfile | 0 .../data/container-build}/cerc-watcher-mobymask/build.sh | 0 .../container-build}/cerc-watcher-uniswap-v3/Dockerfile | 0 .../container-build}/cerc-watcher-uniswap-v3/build.sh | 0 .../data/container-build}/default-build.sh | 0 {stacks => app/data/stacks}/erc20/README.md | 0 {stacks => app/data/stacks}/erc20/stack.yml | 0 {stacks => app/data/stacks}/erc721/README.md | 0 {stacks => app/data/stacks}/erc721/stack.yml | 0 {stacks => app/data/stacks}/fixturenet-eth/README.md | 0 {stacks => app/data/stacks}/fixturenet-eth/stack.yml | 0 {stacks => app/data/stacks}/laconicd/README.md | 0 {stacks => app/data/stacks}/laconicd/stack.yml | 0 {stacks => app/data/stacks}/mobymask/README.md | 0 {stacks => app/data/stacks}/mobymask/stack.yml | 0 {stacks => app/data/stacks}/uniswap-v3/README.md | 0 {stacks => app/data/stacks}/uniswap-v3/stack.yml | 0 app/deploy_system.py | 7 +++++-- 124 files changed, 9 insertions(+), 7 deletions(-) rename {compose => app/data/compose}/docker-compose-contract.yml (100%) rename {compose => app/data/compose}/docker-compose-eth-probe.yml (100%) rename {compose => app/data/compose}/docker-compose-eth-statediff-fill-service.yml (100%) rename {compose => app/data/compose}/docker-compose-fixturenet-eth.yml (100%) rename {compose => app/data/compose}/docker-compose-fixturenet-laconicd.yml (100%) rename {compose => app/data/compose}/docker-compose-go-ethereum-foundry.yml (100%) rename {compose => app/data/compose}/docker-compose-ipld-eth-beacon-db.yml (100%) rename {compose => app/data/compose}/docker-compose-ipld-eth-beacon-indexer.yml (100%) rename {compose => app/data/compose}/docker-compose-ipld-eth-db.yml (100%) rename {compose => app/data/compose}/docker-compose-ipld-eth-server.yml (100%) rename {compose => app/data/compose}/docker-compose-keycloak.yml (100%) rename {compose => app/data/compose}/docker-compose-laconicd.yml (100%) rename {compose => app/data/compose}/docker-compose-prometheus-grafana.yml (100%) rename {compose => app/data/compose}/docker-compose-test.yml (100%) rename {compose => app/data/compose}/docker-compose-tx-spammer.yml (100%) rename {compose => app/data/compose}/docker-compose-watcher-erc20.yml (100%) rename {compose => app/data/compose}/docker-compose-watcher-erc721.yml (100%) rename {compose => app/data/compose}/docker-compose-watcher-mobymask.yml (100%) rename {compose => app/data/compose}/docker-compose-watcher-uniswap-v3.yml (100%) rename {config => app/data/config}/fixturenet-eth/fixturenet-eth.env (100%) rename {config => app/data/config}/fixturenet-laconicd/create-fixturenet.sh (100%) rename {config => app/data/config}/ipld-eth-beacon-indexer/indexer.env (100%) rename {config => app/data/config}/ipld-eth-server/chain.json (100%) rename {config => app/data/config}/keycloak/import/cerc-realm.json (100%) rename {config => app/data/config}/keycloak/keycloak.env (100%) rename {config => app/data/config}/keycloak/nginx/keycloak_proxy.conf (100%) rename {config => app/data/config}/postgresql/create-pg-stat-statements.sql (100%) rename {config => app/data/config}/postgresql/multiple-postgressql-databases.sh (100%) rename {config => app/data/config}/tx-spammer/tx-spammer.env (100%) rename {config => app/data/config}/watcher-erc20/erc20-watcher.toml (100%) rename {config => app/data/config}/watcher-erc721/erc721-watcher.toml (100%) rename {config => app/data/config}/watcher-mobymask/mobymask-watcher-db.sql (100%) rename {config => app/data/config}/watcher-mobymask/mobymask-watcher.toml (100%) rename {config => app/data/config}/watcher-uniswap-v3/erc20-watcher.toml (100%) rename {config => app/data/config}/watcher-uniswap-v3/run.sh (100%) rename {config => app/data/config}/watcher-uniswap-v3/uni-info-watcher.toml (100%) rename {config => app/data/config}/watcher-uniswap-v3/uni-watcher.toml (100%) rename {config => app/data/config}/watcher-uniswap-v3/watch-contract.sh (100%) rename {container-build => app/data/container-build}/cerc-builder-js/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-builder-js/README.md (100%) rename {container-build => app/data/container-build}/cerc-builder-js/build-npm-package-local-dependencies.sh (100%) rename {container-build => app/data/container-build}/cerc-builder-js/build-npm-package.sh (100%) rename {container-build => app/data/container-build}/cerc-builder-js/entrypoint.sh (100%) rename {container-build => app/data/container-build}/cerc-builder-js/yarn-local-registry-fixup.sh (100%) rename {container-build => app/data/container-build}/cerc-eth-probe/build.sh (100%) rename {container-build => app/data/container-build}/cerc-eth-statediff-fill-service/build.sh (100%) rename {container-build => app/data/container-build}/cerc-eth-statediff-service/build.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/build.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/genesis/Makefile (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/genesis/accounts/import_keys.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/genesis/el/build_el.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-geth/run-el.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/build.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/Makefile (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/beacon_node.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/bootnode.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/reset_genesis_time.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/validator_client.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/run-cl.sh (100%) rename {container-build => app/data/container-build}/cerc-fixturenet-eth-lighthouse/scripts/status.sh (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/build.sh (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/deploy-local-network.sh (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/genesis-automine.json (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/genesis.json (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/start-private-network.sh (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/foundry.toml (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/lib/ds-test/LICENSE (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/lib/ds-test/Makefile (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/lib/ds-test/default.nix (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/lib/ds-test/demo/demo.sol (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/lib/ds-test/src/test.sol (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/src/Stateful.sol (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum-foundry/stateful/src/test/Stateful.t.sol (100%) rename {container-build => app/data/container-build}/cerc-go-ethereum/build.sh (100%) rename {container-build => app/data/container-build}/cerc-ipld-eth-beacon-db/build.sh (100%) rename {container-build => app/data/container-build}/cerc-ipld-eth-beacon-indexer/build.sh (100%) rename {container-build => app/data/container-build}/cerc-ipld-eth-db/build.sh (100%) rename {container-build => app/data/container-build}/cerc-ipld-eth-server/build.sh (100%) rename {container-build => app/data/container-build}/cerc-keycloak/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-keycloak/build.sh (100%) rename {container-build => app/data/container-build}/cerc-laconic-registry-cli/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-laconic-registry-cli/build.sh (100%) rename {container-build => app/data/container-build}/cerc-laconicd/build.sh (100%) rename {container-build => app/data/container-build}/cerc-lighthouse/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-lighthouse/build.sh (100%) rename {container-build => app/data/container-build}/cerc-lighthouse/start-lighthouse.sh (100%) rename {container-build => app/data/container-build}/cerc-test-container/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-test-container/build.sh (100%) rename {container-build => app/data/container-build}/cerc-test-container/run.sh (100%) rename {container-build => app/data/container-build}/cerc-test-contract/build.sh (100%) rename {container-build => app/data/container-build}/cerc-tx-spammer/build.sh (100%) rename {container-build => app/data/container-build}/cerc-uniswap-v3-info/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-uniswap-v3-info/build.sh (100%) rename {container-build => app/data/container-build}/cerc-watcher-erc20/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-watcher-erc20/build.sh (100%) rename {container-build => app/data/container-build}/cerc-watcher-erc721/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-watcher-erc721/build.sh (100%) rename {container-build => app/data/container-build}/cerc-watcher-mobymask/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-watcher-mobymask/build.sh (100%) rename {container-build => app/data/container-build}/cerc-watcher-uniswap-v3/Dockerfile (100%) rename {container-build => app/data/container-build}/cerc-watcher-uniswap-v3/build.sh (100%) rename {container-build => app/data/container-build}/default-build.sh (100%) rename {stacks => app/data/stacks}/erc20/README.md (100%) rename {stacks => app/data/stacks}/erc20/stack.yml (100%) rename {stacks => app/data/stacks}/erc721/README.md (100%) rename {stacks => app/data/stacks}/erc721/stack.yml (100%) rename {stacks => app/data/stacks}/fixturenet-eth/README.md (100%) rename {stacks => app/data/stacks}/fixturenet-eth/stack.yml (100%) rename {stacks => app/data/stacks}/laconicd/README.md (100%) rename {stacks => app/data/stacks}/laconicd/stack.yml (100%) rename {stacks => app/data/stacks}/mobymask/README.md (100%) rename {stacks => app/data/stacks}/mobymask/stack.yml (100%) rename {stacks => app/data/stacks}/uniswap-v3/README.md (100%) rename {stacks => app/data/stacks}/uniswap-v3/stack.yml (100%) diff --git a/app/build_containers.py b/app/build_containers.py index fde6c30..87c9286 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -43,8 +43,9 @@ def command(ctx, include, exclude): dry_run = ctx.obj.dry_run local_stack = ctx.obj.local_stack - # TODO: check this still works in the shiv package scenario - container_build_dir = os.path.join(os.getcwd(), "container-build") + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + container_build_dir = importlib.resources.path(data, "container-build") if local_stack: dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")] @@ -58,8 +59,6 @@ def command(ctx, include, exclude): if not os.path.isdir(dev_root_path): print('Dev root directory doesn\'t exist, creating') - # See: https://stackoverflow.com/a/20885799/1701505 - from . import data with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file: containers = container_list_file.read().splitlines() @@ -90,7 +89,7 @@ def command(ctx, include, exclude): # Check if we have a repo for this container. If not, set the context dir to the container-build subdir repo_full_path = os.path.join(dev_root_path, repo_dir) repo_dir_or_build_dir = repo_dir if os.path.exists(repo_full_path) else build_dir - build_command = os.path.join("container-build", "default-build.sh") + f" {container} {repo_dir_or_build_dir}" + build_command = os.path.join(container_build_dir, "default-build.sh") + f" {container} {repo_dir_or_build_dir}" if not dry_run: if verbose: print(f"Executing: {build_command}") diff --git a/compose/docker-compose-contract.yml b/app/data/compose/docker-compose-contract.yml similarity index 100% rename from compose/docker-compose-contract.yml rename to app/data/compose/docker-compose-contract.yml diff --git a/compose/docker-compose-eth-probe.yml b/app/data/compose/docker-compose-eth-probe.yml similarity index 100% rename from compose/docker-compose-eth-probe.yml rename to app/data/compose/docker-compose-eth-probe.yml diff --git a/compose/docker-compose-eth-statediff-fill-service.yml b/app/data/compose/docker-compose-eth-statediff-fill-service.yml similarity index 100% rename from compose/docker-compose-eth-statediff-fill-service.yml rename to app/data/compose/docker-compose-eth-statediff-fill-service.yml diff --git a/compose/docker-compose-fixturenet-eth.yml b/app/data/compose/docker-compose-fixturenet-eth.yml similarity index 100% rename from compose/docker-compose-fixturenet-eth.yml rename to app/data/compose/docker-compose-fixturenet-eth.yml diff --git a/compose/docker-compose-fixturenet-laconicd.yml b/app/data/compose/docker-compose-fixturenet-laconicd.yml similarity index 100% rename from compose/docker-compose-fixturenet-laconicd.yml rename to app/data/compose/docker-compose-fixturenet-laconicd.yml diff --git a/compose/docker-compose-go-ethereum-foundry.yml b/app/data/compose/docker-compose-go-ethereum-foundry.yml similarity index 100% rename from compose/docker-compose-go-ethereum-foundry.yml rename to app/data/compose/docker-compose-go-ethereum-foundry.yml diff --git a/compose/docker-compose-ipld-eth-beacon-db.yml b/app/data/compose/docker-compose-ipld-eth-beacon-db.yml similarity index 100% rename from compose/docker-compose-ipld-eth-beacon-db.yml rename to app/data/compose/docker-compose-ipld-eth-beacon-db.yml diff --git a/compose/docker-compose-ipld-eth-beacon-indexer.yml b/app/data/compose/docker-compose-ipld-eth-beacon-indexer.yml similarity index 100% rename from compose/docker-compose-ipld-eth-beacon-indexer.yml rename to app/data/compose/docker-compose-ipld-eth-beacon-indexer.yml diff --git a/compose/docker-compose-ipld-eth-db.yml b/app/data/compose/docker-compose-ipld-eth-db.yml similarity index 100% rename from compose/docker-compose-ipld-eth-db.yml rename to app/data/compose/docker-compose-ipld-eth-db.yml diff --git a/compose/docker-compose-ipld-eth-server.yml b/app/data/compose/docker-compose-ipld-eth-server.yml similarity index 100% rename from compose/docker-compose-ipld-eth-server.yml rename to app/data/compose/docker-compose-ipld-eth-server.yml diff --git a/compose/docker-compose-keycloak.yml b/app/data/compose/docker-compose-keycloak.yml similarity index 100% rename from compose/docker-compose-keycloak.yml rename to app/data/compose/docker-compose-keycloak.yml diff --git a/compose/docker-compose-laconicd.yml b/app/data/compose/docker-compose-laconicd.yml similarity index 100% rename from compose/docker-compose-laconicd.yml rename to app/data/compose/docker-compose-laconicd.yml diff --git a/compose/docker-compose-prometheus-grafana.yml b/app/data/compose/docker-compose-prometheus-grafana.yml similarity index 100% rename from compose/docker-compose-prometheus-grafana.yml rename to app/data/compose/docker-compose-prometheus-grafana.yml diff --git a/compose/docker-compose-test.yml b/app/data/compose/docker-compose-test.yml similarity index 100% rename from compose/docker-compose-test.yml rename to app/data/compose/docker-compose-test.yml diff --git a/compose/docker-compose-tx-spammer.yml b/app/data/compose/docker-compose-tx-spammer.yml similarity index 100% rename from compose/docker-compose-tx-spammer.yml rename to app/data/compose/docker-compose-tx-spammer.yml diff --git a/compose/docker-compose-watcher-erc20.yml b/app/data/compose/docker-compose-watcher-erc20.yml similarity index 100% rename from compose/docker-compose-watcher-erc20.yml rename to app/data/compose/docker-compose-watcher-erc20.yml diff --git a/compose/docker-compose-watcher-erc721.yml b/app/data/compose/docker-compose-watcher-erc721.yml similarity index 100% rename from compose/docker-compose-watcher-erc721.yml rename to app/data/compose/docker-compose-watcher-erc721.yml diff --git a/compose/docker-compose-watcher-mobymask.yml b/app/data/compose/docker-compose-watcher-mobymask.yml similarity index 100% rename from compose/docker-compose-watcher-mobymask.yml rename to app/data/compose/docker-compose-watcher-mobymask.yml diff --git a/compose/docker-compose-watcher-uniswap-v3.yml b/app/data/compose/docker-compose-watcher-uniswap-v3.yml similarity index 100% rename from compose/docker-compose-watcher-uniswap-v3.yml rename to app/data/compose/docker-compose-watcher-uniswap-v3.yml diff --git a/config/fixturenet-eth/fixturenet-eth.env b/app/data/config/fixturenet-eth/fixturenet-eth.env similarity index 100% rename from config/fixturenet-eth/fixturenet-eth.env rename to app/data/config/fixturenet-eth/fixturenet-eth.env diff --git a/config/fixturenet-laconicd/create-fixturenet.sh b/app/data/config/fixturenet-laconicd/create-fixturenet.sh similarity index 100% rename from config/fixturenet-laconicd/create-fixturenet.sh rename to app/data/config/fixturenet-laconicd/create-fixturenet.sh diff --git a/config/ipld-eth-beacon-indexer/indexer.env b/app/data/config/ipld-eth-beacon-indexer/indexer.env similarity index 100% rename from config/ipld-eth-beacon-indexer/indexer.env rename to app/data/config/ipld-eth-beacon-indexer/indexer.env diff --git a/config/ipld-eth-server/chain.json b/app/data/config/ipld-eth-server/chain.json similarity index 100% rename from config/ipld-eth-server/chain.json rename to app/data/config/ipld-eth-server/chain.json diff --git a/config/keycloak/import/cerc-realm.json b/app/data/config/keycloak/import/cerc-realm.json similarity index 100% rename from config/keycloak/import/cerc-realm.json rename to app/data/config/keycloak/import/cerc-realm.json diff --git a/config/keycloak/keycloak.env b/app/data/config/keycloak/keycloak.env similarity index 100% rename from config/keycloak/keycloak.env rename to app/data/config/keycloak/keycloak.env diff --git a/config/keycloak/nginx/keycloak_proxy.conf b/app/data/config/keycloak/nginx/keycloak_proxy.conf similarity index 100% rename from config/keycloak/nginx/keycloak_proxy.conf rename to app/data/config/keycloak/nginx/keycloak_proxy.conf diff --git a/config/postgresql/create-pg-stat-statements.sql b/app/data/config/postgresql/create-pg-stat-statements.sql similarity index 100% rename from config/postgresql/create-pg-stat-statements.sql rename to app/data/config/postgresql/create-pg-stat-statements.sql diff --git a/config/postgresql/multiple-postgressql-databases.sh b/app/data/config/postgresql/multiple-postgressql-databases.sh similarity index 100% rename from config/postgresql/multiple-postgressql-databases.sh rename to app/data/config/postgresql/multiple-postgressql-databases.sh diff --git a/config/tx-spammer/tx-spammer.env b/app/data/config/tx-spammer/tx-spammer.env similarity index 100% rename from config/tx-spammer/tx-spammer.env rename to app/data/config/tx-spammer/tx-spammer.env diff --git a/config/watcher-erc20/erc20-watcher.toml b/app/data/config/watcher-erc20/erc20-watcher.toml similarity index 100% rename from config/watcher-erc20/erc20-watcher.toml rename to app/data/config/watcher-erc20/erc20-watcher.toml diff --git a/config/watcher-erc721/erc721-watcher.toml b/app/data/config/watcher-erc721/erc721-watcher.toml similarity index 100% rename from config/watcher-erc721/erc721-watcher.toml rename to app/data/config/watcher-erc721/erc721-watcher.toml diff --git a/config/watcher-mobymask/mobymask-watcher-db.sql b/app/data/config/watcher-mobymask/mobymask-watcher-db.sql similarity index 100% rename from config/watcher-mobymask/mobymask-watcher-db.sql rename to app/data/config/watcher-mobymask/mobymask-watcher-db.sql diff --git a/config/watcher-mobymask/mobymask-watcher.toml b/app/data/config/watcher-mobymask/mobymask-watcher.toml similarity index 100% rename from config/watcher-mobymask/mobymask-watcher.toml rename to app/data/config/watcher-mobymask/mobymask-watcher.toml diff --git a/config/watcher-uniswap-v3/erc20-watcher.toml b/app/data/config/watcher-uniswap-v3/erc20-watcher.toml similarity index 100% rename from config/watcher-uniswap-v3/erc20-watcher.toml rename to app/data/config/watcher-uniswap-v3/erc20-watcher.toml diff --git a/config/watcher-uniswap-v3/run.sh b/app/data/config/watcher-uniswap-v3/run.sh similarity index 100% rename from config/watcher-uniswap-v3/run.sh rename to app/data/config/watcher-uniswap-v3/run.sh diff --git a/config/watcher-uniswap-v3/uni-info-watcher.toml b/app/data/config/watcher-uniswap-v3/uni-info-watcher.toml similarity index 100% rename from config/watcher-uniswap-v3/uni-info-watcher.toml rename to app/data/config/watcher-uniswap-v3/uni-info-watcher.toml diff --git a/config/watcher-uniswap-v3/uni-watcher.toml b/app/data/config/watcher-uniswap-v3/uni-watcher.toml similarity index 100% rename from config/watcher-uniswap-v3/uni-watcher.toml rename to app/data/config/watcher-uniswap-v3/uni-watcher.toml diff --git a/config/watcher-uniswap-v3/watch-contract.sh b/app/data/config/watcher-uniswap-v3/watch-contract.sh similarity index 100% rename from config/watcher-uniswap-v3/watch-contract.sh rename to app/data/config/watcher-uniswap-v3/watch-contract.sh diff --git a/container-build/cerc-builder-js/Dockerfile b/app/data/container-build/cerc-builder-js/Dockerfile similarity index 100% rename from container-build/cerc-builder-js/Dockerfile rename to app/data/container-build/cerc-builder-js/Dockerfile diff --git a/container-build/cerc-builder-js/README.md b/app/data/container-build/cerc-builder-js/README.md similarity index 100% rename from container-build/cerc-builder-js/README.md rename to app/data/container-build/cerc-builder-js/README.md diff --git a/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh similarity index 100% rename from container-build/cerc-builder-js/build-npm-package-local-dependencies.sh rename to app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh diff --git a/container-build/cerc-builder-js/build-npm-package.sh b/app/data/container-build/cerc-builder-js/build-npm-package.sh similarity index 100% rename from container-build/cerc-builder-js/build-npm-package.sh rename to app/data/container-build/cerc-builder-js/build-npm-package.sh diff --git a/container-build/cerc-builder-js/entrypoint.sh b/app/data/container-build/cerc-builder-js/entrypoint.sh similarity index 100% rename from container-build/cerc-builder-js/entrypoint.sh rename to app/data/container-build/cerc-builder-js/entrypoint.sh diff --git a/container-build/cerc-builder-js/yarn-local-registry-fixup.sh b/app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh similarity index 100% rename from container-build/cerc-builder-js/yarn-local-registry-fixup.sh rename to app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh diff --git a/container-build/cerc-eth-probe/build.sh b/app/data/container-build/cerc-eth-probe/build.sh similarity index 100% rename from container-build/cerc-eth-probe/build.sh rename to app/data/container-build/cerc-eth-probe/build.sh diff --git a/container-build/cerc-eth-statediff-fill-service/build.sh b/app/data/container-build/cerc-eth-statediff-fill-service/build.sh similarity index 100% rename from container-build/cerc-eth-statediff-fill-service/build.sh rename to app/data/container-build/cerc-eth-statediff-fill-service/build.sh diff --git a/container-build/cerc-eth-statediff-service/build.sh b/app/data/container-build/cerc-eth-statediff-service/build.sh similarity index 100% rename from container-build/cerc-eth-statediff-service/build.sh rename to app/data/container-build/cerc-eth-statediff-service/build.sh diff --git a/container-build/cerc-fixturenet-eth-geth/Dockerfile b/app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/Dockerfile rename to app/data/container-build/cerc-fixturenet-eth-geth/Dockerfile diff --git a/container-build/cerc-fixturenet-eth-geth/build.sh b/app/data/container-build/cerc-fixturenet-eth-geth/build.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/build.sh rename to app/data/container-build/cerc-fixturenet-eth-geth/build.sh diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/Makefile b/app/data/container-build/cerc-fixturenet-eth-geth/genesis/Makefile similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/genesis/Makefile rename to app/data/container-build/cerc-fixturenet-eth-geth/genesis/Makefile diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/accounts/import_keys.sh b/app/data/container-build/cerc-fixturenet-eth-geth/genesis/accounts/import_keys.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/genesis/accounts/import_keys.sh rename to app/data/container-build/cerc-fixturenet-eth-geth/genesis/accounts/import_keys.sh diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py b/app/data/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py rename to app/data/container-build/cerc-fixturenet-eth-geth/genesis/accounts/mnemonic_to_csv.py diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh b/app/data/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh rename to app/data/container-build/cerc-fixturenet-eth-geth/genesis/el/build_el.sh diff --git a/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml b/app/data/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml rename to app/data/container-build/cerc-fixturenet-eth-geth/genesis/el/el-config.yaml diff --git a/container-build/cerc-fixturenet-eth-geth/run-el.sh b/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-geth/run-el.sh rename to app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile b/app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/Dockerfile rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile diff --git a/container-build/cerc-fixturenet-eth-lighthouse/build.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/build.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/build.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/build.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/Makefile b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/Makefile similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/Makefile rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/Makefile diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/beacon_node.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/beacon_node.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/beacon_node.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/beacon_node.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/bootnode.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/bootnode.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/bootnode.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/bootnode.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/build_cl.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/ready.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/reset_genesis_time.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/reset_genesis_time.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/reset_genesis_time.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/reset_genesis_time.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/validator_client.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/validator_client.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/validator_client.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/validator_client.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env b/app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/genesis/cl/vars.env diff --git a/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh diff --git a/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh similarity index 100% rename from container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh rename to app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh diff --git a/container-build/cerc-go-ethereum-foundry/Dockerfile b/app/data/container-build/cerc-go-ethereum-foundry/Dockerfile similarity index 100% rename from container-build/cerc-go-ethereum-foundry/Dockerfile rename to app/data/container-build/cerc-go-ethereum-foundry/Dockerfile diff --git a/container-build/cerc-go-ethereum-foundry/build.sh b/app/data/container-build/cerc-go-ethereum-foundry/build.sh similarity index 100% rename from container-build/cerc-go-ethereum-foundry/build.sh rename to app/data/container-build/cerc-go-ethereum-foundry/build.sh diff --git a/container-build/cerc-go-ethereum-foundry/deploy-local-network.sh b/app/data/container-build/cerc-go-ethereum-foundry/deploy-local-network.sh similarity index 100% rename from container-build/cerc-go-ethereum-foundry/deploy-local-network.sh rename to app/data/container-build/cerc-go-ethereum-foundry/deploy-local-network.sh diff --git a/container-build/cerc-go-ethereum-foundry/genesis-automine.json b/app/data/container-build/cerc-go-ethereum-foundry/genesis-automine.json similarity index 100% rename from container-build/cerc-go-ethereum-foundry/genesis-automine.json rename to app/data/container-build/cerc-go-ethereum-foundry/genesis-automine.json diff --git a/container-build/cerc-go-ethereum-foundry/genesis.json b/app/data/container-build/cerc-go-ethereum-foundry/genesis.json similarity index 100% rename from container-build/cerc-go-ethereum-foundry/genesis.json rename to app/data/container-build/cerc-go-ethereum-foundry/genesis.json diff --git a/container-build/cerc-go-ethereum-foundry/start-private-network.sh b/app/data/container-build/cerc-go-ethereum-foundry/start-private-network.sh similarity index 100% rename from container-build/cerc-go-ethereum-foundry/start-private-network.sh rename to app/data/container-build/cerc-go-ethereum-foundry/start-private-network.sh diff --git a/container-build/cerc-go-ethereum-foundry/stateful/foundry.toml b/app/data/container-build/cerc-go-ethereum-foundry/stateful/foundry.toml similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/foundry.toml rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/foundry.toml diff --git a/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/LICENSE b/app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/LICENSE similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/LICENSE rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/LICENSE diff --git a/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/Makefile b/app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/Makefile similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/Makefile rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/Makefile diff --git a/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/default.nix b/app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/default.nix similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/default.nix rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/default.nix diff --git a/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/demo/demo.sol b/app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/demo/demo.sol similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/demo/demo.sol rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/demo/demo.sol diff --git a/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/src/test.sol b/app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/src/test.sol similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/src/test.sol rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/lib/ds-test/src/test.sol diff --git a/container-build/cerc-go-ethereum-foundry/stateful/src/Stateful.sol b/app/data/container-build/cerc-go-ethereum-foundry/stateful/src/Stateful.sol similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/src/Stateful.sol rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/src/Stateful.sol diff --git a/container-build/cerc-go-ethereum-foundry/stateful/src/test/Stateful.t.sol b/app/data/container-build/cerc-go-ethereum-foundry/stateful/src/test/Stateful.t.sol similarity index 100% rename from container-build/cerc-go-ethereum-foundry/stateful/src/test/Stateful.t.sol rename to app/data/container-build/cerc-go-ethereum-foundry/stateful/src/test/Stateful.t.sol diff --git a/container-build/cerc-go-ethereum/build.sh b/app/data/container-build/cerc-go-ethereum/build.sh similarity index 100% rename from container-build/cerc-go-ethereum/build.sh rename to app/data/container-build/cerc-go-ethereum/build.sh diff --git a/container-build/cerc-ipld-eth-beacon-db/build.sh b/app/data/container-build/cerc-ipld-eth-beacon-db/build.sh similarity index 100% rename from container-build/cerc-ipld-eth-beacon-db/build.sh rename to app/data/container-build/cerc-ipld-eth-beacon-db/build.sh diff --git a/container-build/cerc-ipld-eth-beacon-indexer/build.sh b/app/data/container-build/cerc-ipld-eth-beacon-indexer/build.sh similarity index 100% rename from container-build/cerc-ipld-eth-beacon-indexer/build.sh rename to app/data/container-build/cerc-ipld-eth-beacon-indexer/build.sh diff --git a/container-build/cerc-ipld-eth-db/build.sh b/app/data/container-build/cerc-ipld-eth-db/build.sh similarity index 100% rename from container-build/cerc-ipld-eth-db/build.sh rename to app/data/container-build/cerc-ipld-eth-db/build.sh diff --git a/container-build/cerc-ipld-eth-server/build.sh b/app/data/container-build/cerc-ipld-eth-server/build.sh similarity index 100% rename from container-build/cerc-ipld-eth-server/build.sh rename to app/data/container-build/cerc-ipld-eth-server/build.sh diff --git a/container-build/cerc-keycloak/Dockerfile b/app/data/container-build/cerc-keycloak/Dockerfile similarity index 100% rename from container-build/cerc-keycloak/Dockerfile rename to app/data/container-build/cerc-keycloak/Dockerfile diff --git a/container-build/cerc-keycloak/build.sh b/app/data/container-build/cerc-keycloak/build.sh similarity index 100% rename from container-build/cerc-keycloak/build.sh rename to app/data/container-build/cerc-keycloak/build.sh diff --git a/container-build/cerc-laconic-registry-cli/Dockerfile b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile similarity index 100% rename from container-build/cerc-laconic-registry-cli/Dockerfile rename to app/data/container-build/cerc-laconic-registry-cli/Dockerfile diff --git a/container-build/cerc-laconic-registry-cli/build.sh b/app/data/container-build/cerc-laconic-registry-cli/build.sh similarity index 100% rename from container-build/cerc-laconic-registry-cli/build.sh rename to app/data/container-build/cerc-laconic-registry-cli/build.sh diff --git a/container-build/cerc-laconicd/build.sh b/app/data/container-build/cerc-laconicd/build.sh similarity index 100% rename from container-build/cerc-laconicd/build.sh rename to app/data/container-build/cerc-laconicd/build.sh diff --git a/container-build/cerc-lighthouse/Dockerfile b/app/data/container-build/cerc-lighthouse/Dockerfile similarity index 100% rename from container-build/cerc-lighthouse/Dockerfile rename to app/data/container-build/cerc-lighthouse/Dockerfile diff --git a/container-build/cerc-lighthouse/build.sh b/app/data/container-build/cerc-lighthouse/build.sh similarity index 100% rename from container-build/cerc-lighthouse/build.sh rename to app/data/container-build/cerc-lighthouse/build.sh diff --git a/container-build/cerc-lighthouse/start-lighthouse.sh b/app/data/container-build/cerc-lighthouse/start-lighthouse.sh similarity index 100% rename from container-build/cerc-lighthouse/start-lighthouse.sh rename to app/data/container-build/cerc-lighthouse/start-lighthouse.sh diff --git a/container-build/cerc-test-container/Dockerfile b/app/data/container-build/cerc-test-container/Dockerfile similarity index 100% rename from container-build/cerc-test-container/Dockerfile rename to app/data/container-build/cerc-test-container/Dockerfile diff --git a/container-build/cerc-test-container/build.sh b/app/data/container-build/cerc-test-container/build.sh similarity index 100% rename from container-build/cerc-test-container/build.sh rename to app/data/container-build/cerc-test-container/build.sh diff --git a/container-build/cerc-test-container/run.sh b/app/data/container-build/cerc-test-container/run.sh similarity index 100% rename from container-build/cerc-test-container/run.sh rename to app/data/container-build/cerc-test-container/run.sh diff --git a/container-build/cerc-test-contract/build.sh b/app/data/container-build/cerc-test-contract/build.sh similarity index 100% rename from container-build/cerc-test-contract/build.sh rename to app/data/container-build/cerc-test-contract/build.sh diff --git a/container-build/cerc-tx-spammer/build.sh b/app/data/container-build/cerc-tx-spammer/build.sh similarity index 100% rename from container-build/cerc-tx-spammer/build.sh rename to app/data/container-build/cerc-tx-spammer/build.sh diff --git a/container-build/cerc-uniswap-v3-info/Dockerfile b/app/data/container-build/cerc-uniswap-v3-info/Dockerfile similarity index 100% rename from container-build/cerc-uniswap-v3-info/Dockerfile rename to app/data/container-build/cerc-uniswap-v3-info/Dockerfile diff --git a/container-build/cerc-uniswap-v3-info/build.sh b/app/data/container-build/cerc-uniswap-v3-info/build.sh similarity index 100% rename from container-build/cerc-uniswap-v3-info/build.sh rename to app/data/container-build/cerc-uniswap-v3-info/build.sh diff --git a/container-build/cerc-watcher-erc20/Dockerfile b/app/data/container-build/cerc-watcher-erc20/Dockerfile similarity index 100% rename from container-build/cerc-watcher-erc20/Dockerfile rename to app/data/container-build/cerc-watcher-erc20/Dockerfile diff --git a/container-build/cerc-watcher-erc20/build.sh b/app/data/container-build/cerc-watcher-erc20/build.sh similarity index 100% rename from container-build/cerc-watcher-erc20/build.sh rename to app/data/container-build/cerc-watcher-erc20/build.sh diff --git a/container-build/cerc-watcher-erc721/Dockerfile b/app/data/container-build/cerc-watcher-erc721/Dockerfile similarity index 100% rename from container-build/cerc-watcher-erc721/Dockerfile rename to app/data/container-build/cerc-watcher-erc721/Dockerfile diff --git a/container-build/cerc-watcher-erc721/build.sh b/app/data/container-build/cerc-watcher-erc721/build.sh similarity index 100% rename from container-build/cerc-watcher-erc721/build.sh rename to app/data/container-build/cerc-watcher-erc721/build.sh diff --git a/container-build/cerc-watcher-mobymask/Dockerfile b/app/data/container-build/cerc-watcher-mobymask/Dockerfile similarity index 100% rename from container-build/cerc-watcher-mobymask/Dockerfile rename to app/data/container-build/cerc-watcher-mobymask/Dockerfile diff --git a/container-build/cerc-watcher-mobymask/build.sh b/app/data/container-build/cerc-watcher-mobymask/build.sh similarity index 100% rename from container-build/cerc-watcher-mobymask/build.sh rename to app/data/container-build/cerc-watcher-mobymask/build.sh diff --git a/container-build/cerc-watcher-uniswap-v3/Dockerfile b/app/data/container-build/cerc-watcher-uniswap-v3/Dockerfile similarity index 100% rename from container-build/cerc-watcher-uniswap-v3/Dockerfile rename to app/data/container-build/cerc-watcher-uniswap-v3/Dockerfile diff --git a/container-build/cerc-watcher-uniswap-v3/build.sh b/app/data/container-build/cerc-watcher-uniswap-v3/build.sh similarity index 100% rename from container-build/cerc-watcher-uniswap-v3/build.sh rename to app/data/container-build/cerc-watcher-uniswap-v3/build.sh diff --git a/container-build/default-build.sh b/app/data/container-build/default-build.sh similarity index 100% rename from container-build/default-build.sh rename to app/data/container-build/default-build.sh diff --git a/stacks/erc20/README.md b/app/data/stacks/erc20/README.md similarity index 100% rename from stacks/erc20/README.md rename to app/data/stacks/erc20/README.md diff --git a/stacks/erc20/stack.yml b/app/data/stacks/erc20/stack.yml similarity index 100% rename from stacks/erc20/stack.yml rename to app/data/stacks/erc20/stack.yml diff --git a/stacks/erc721/README.md b/app/data/stacks/erc721/README.md similarity index 100% rename from stacks/erc721/README.md rename to app/data/stacks/erc721/README.md diff --git a/stacks/erc721/stack.yml b/app/data/stacks/erc721/stack.yml similarity index 100% rename from stacks/erc721/stack.yml rename to app/data/stacks/erc721/stack.yml diff --git a/stacks/fixturenet-eth/README.md b/app/data/stacks/fixturenet-eth/README.md similarity index 100% rename from stacks/fixturenet-eth/README.md rename to app/data/stacks/fixturenet-eth/README.md diff --git a/stacks/fixturenet-eth/stack.yml b/app/data/stacks/fixturenet-eth/stack.yml similarity index 100% rename from stacks/fixturenet-eth/stack.yml rename to app/data/stacks/fixturenet-eth/stack.yml diff --git a/stacks/laconicd/README.md b/app/data/stacks/laconicd/README.md similarity index 100% rename from stacks/laconicd/README.md rename to app/data/stacks/laconicd/README.md diff --git a/stacks/laconicd/stack.yml b/app/data/stacks/laconicd/stack.yml similarity index 100% rename from stacks/laconicd/stack.yml rename to app/data/stacks/laconicd/stack.yml diff --git a/stacks/mobymask/README.md b/app/data/stacks/mobymask/README.md similarity index 100% rename from stacks/mobymask/README.md rename to app/data/stacks/mobymask/README.md diff --git a/stacks/mobymask/stack.yml b/app/data/stacks/mobymask/stack.yml similarity index 100% rename from stacks/mobymask/stack.yml rename to app/data/stacks/mobymask/stack.yml diff --git a/stacks/uniswap-v3/README.md b/app/data/stacks/uniswap-v3/README.md similarity index 100% rename from stacks/uniswap-v3/README.md rename to app/data/stacks/uniswap-v3/README.md diff --git a/stacks/uniswap-v3/stack.yml b/app/data/stacks/uniswap-v3/stack.yml similarity index 100% rename from stacks/uniswap-v3/stack.yml rename to app/data/stacks/uniswap-v3/stack.yml diff --git a/app/deploy_system.py b/app/deploy_system.py index 169e0d6..cb9c2ef 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -40,6 +40,10 @@ def command(ctx, include, exclude, cluster, command, services): verbose = ctx.obj.verbose dry_run = ctx.obj.dry_run + # See: https://stackoverflow.com/a/20885799/1701505 + from . import data + compose_dir = importlib.resources.path(data, "compose") + if cluster is None: # Create default unique, stable cluster name from confile file path # TODO: change this to the config file path @@ -49,7 +53,6 @@ def command(ctx, include, exclude, cluster, command, services): if verbose: print(f"Using cluster name: {cluster}") - # See: https://stackoverflow.com/a/20885799/1701505 from . import data with importlib.resources.open_text(data, "pod-list.txt") as pod_list_file: pods = pod_list_file.read().splitlines() @@ -62,7 +65,7 @@ def command(ctx, include, exclude, cluster, command, services): compose_files = [] for pod in pods: if include_exclude_check(pod, include, exclude): - compose_file_name = os.path.join("compose", f"docker-compose-{pod}.yml") + compose_file_name = os.path.join(compose_dir, f"docker-compose-{pod}.yml") compose_files.append(compose_file_name) else: if verbose: From b4b1ec3df8a1cbac998b142cfaddda6a2a1b0a3e Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 8 Jan 2023 20:08:35 -0700 Subject: [PATCH 3/4] Try another way to access packaged files --- app/build_containers.py | 7 +++++-- setup.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/build_containers.py b/app/build_containers.py index 87c9286..489af5d 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -25,6 +25,7 @@ from decouple import config import subprocess import click import importlib +from pathlib import Path from .util import include_exclude_check # TODO: find a place for this @@ -43,9 +44,10 @@ def command(ctx, include, exclude): dry_run = ctx.obj.dry_run local_stack = ctx.obj.local_stack - # See: https://stackoverflow.com/a/20885799/1701505 + # See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure from . import data - container_build_dir = importlib.resources.path(data, "container-build") + container_build_dir = Path(__file__).absolute().parent.joinpath("data", "container-build") + print(f"dir is: {container_build_dir}") if local_stack: dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")] @@ -59,6 +61,7 @@ def command(ctx, include, exclude): if not os.path.isdir(dev_root_path): print('Dev root directory doesn\'t exist, creating') + # See: https://stackoverflow.com/a/20885799/1701505 with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file: containers = container_list_file.read().splitlines() diff --git a/setup.py b/setup.py index 17d2ae3..94a2af5 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,8 @@ setup( install_requires=[requirements], python_requires='>=3.7', include_package_data=True, - package_data={'': ['data/*.txt']}, + # See: https://github.com/pypa/setuptools/issues/1806 + package_data={'': ['data/*', 'data/*/*', 'data/*/*/*']}, classifiers=[ "Programming Language :: Python :: 3.8", "Operating System :: OS Independent", From f04726f08d0246c83a07bb047a0bd01f6a69e728 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 8 Jan 2023 20:11:30 -0700 Subject: [PATCH 4/4] Fix remaining commands --- app/build_containers.py | 3 +-- app/deploy_system.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/build_containers.py b/app/build_containers.py index 489af5d..3e8bb14 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -45,9 +45,7 @@ def command(ctx, include, exclude): local_stack = ctx.obj.local_stack # See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure - from . import data container_build_dir = Path(__file__).absolute().parent.joinpath("data", "container-build") - print(f"dir is: {container_build_dir}") if local_stack: dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")] @@ -62,6 +60,7 @@ def command(ctx, include, exclude): print('Dev root directory doesn\'t exist, creating') # See: https://stackoverflow.com/a/20885799/1701505 + from . import data with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file: containers = container_list_file.read().splitlines() diff --git a/app/deploy_system.py b/app/deploy_system.py index cb9c2ef..7195d59 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -40,9 +40,8 @@ def command(ctx, include, exclude, cluster, command, services): verbose = ctx.obj.verbose dry_run = ctx.obj.dry_run - # See: https://stackoverflow.com/a/20885799/1701505 - from . import data - compose_dir = importlib.resources.path(data, "compose") + # See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure + compose_dir = Path(__file__).absolute().parent.joinpath("data", "compose") if cluster is None: # Create default unique, stable cluster name from confile file path @@ -53,6 +52,7 @@ def command(ctx, include, exclude, cluster, command, services): if verbose: print(f"Using cluster name: {cluster}") + # See: https://stackoverflow.com/a/20885799/1701505 from . import data with importlib.resources.open_text(data, "pod-list.txt") as pod_list_file: pods = pod_list_file.read().splitlines()