From eb70f2526ea59e53d1b2cf5f9661e70c2a11e631 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 4 Mar 2023 18:45:57 -0700 Subject: [PATCH] Initial commit Former-commit-id: 49c524e8edc27db89f79a13bbe19a8ece221372e --- app/data/compose/docker-compose-fixturenet-laconicd.yml | 5 ++++- .../fixturenet-laconicd/registry-cli-config-template.yml | 7 +++++++ .../container-build/cerc-laconic-registry-cli/Dockerfile | 4 +++- .../cerc-laconic-registry-cli/configure-key.sh | 2 ++ app/deploy_system.py | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 app/data/config/fixturenet-laconicd/registry-cli-config-template.yml create mode 100644 app/data/container-build/cerc-laconic-registry-cli/configure-key.sh diff --git a/app/data/compose/docker-compose-fixturenet-laconicd.yml b/app/data/compose/docker-compose-fixturenet-laconicd.yml index 997063db..cfbc574f 100644 --- a/app/data/compose/docker-compose-fixturenet-laconicd.yml +++ b/app/data/compose/docker-compose-fixturenet-laconicd.yml @@ -18,4 +18,7 @@ services: - "9090" - "9091" - "1317" - + cli: + image: cerc/laconic-registry-cli:local + volumes: + - ../config/fixturenet-laconicd/registry-cli-config-template.yml:/registry-cli-config-template.yml diff --git a/app/data/config/fixturenet-laconicd/registry-cli-config-template.yml b/app/data/config/fixturenet-laconicd/registry-cli-config-template.yml new file mode 100644 index 00000000..6074cc6d --- /dev/null +++ b/app/data/config/fixturenet-laconicd/registry-cli-config-template.yml @@ -0,0 +1,7 @@ +services: + cns: + restEndpoint: 'http://laconicd:1317' + gqlEndpoint: 'http://laconicd:9473/api' + userKey: REPLACE_WITH_MYKEY + bondId: + chainId: laconic_9000-1 diff --git a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile index ba22a5c9..d7042207 100644 --- a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile +++ b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile @@ -51,4 +51,6 @@ RUN npm config set @lirewine:registry ${CERC_NPM_URL} \ # Globally install the cli package RUN yarn global add @cerc-io/laconic-registry-cli -ENTRYPOINT ["laconic"] +# Default command sleeps forever so docker doesn't kill it +CMD ["sh", "-c", "while :; do sleep 600; done"] + diff --git a/app/data/container-build/cerc-laconic-registry-cli/configure-key.sh b/app/data/container-build/cerc-laconic-registry-cli/configure-key.sh new file mode 100644 index 00000000..3bafec4b --- /dev/null +++ b/app/data/container-build/cerc-laconic-registry-cli/configure-key.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sed 's/REPLACE_WITH_MYKEY/'${1}'/' registry-cli-config-template.yml > config.yml diff --git a/app/deploy_system.py b/app/deploy_system.py index 2d58967e..7001236f 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -75,7 +75,7 @@ def command(ctx, include, exclude, cluster, command, extra_args): print("Usage: exec ") sys.exit(1) service_name = extra_args_list[0] - command_to_exec = extra_args_list[1:] + command_to_exec = ["sh", "-c"] + extra_args_list[1:] container_exec_env = _make_runtime_env(ctx.obj) if verbose: print(f"Running compose exec {service_name} {command_to_exec}")