forked from cerc-io/stack-orchestrator
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2937a07cd8 | ||
|
|
6ae3c252ea | ||
|
|
178de8f496 | ||
|
|
05cdd2ed01 | ||
|
|
e801c28f60 | ||
|
|
eb70f2526e | ||
|
|
199a4036a8 | ||
|
|
f0b711912a | ||
|
|
d3d3f92953 | ||
|
|
c3101bc25a |
@@ -5,8 +5,9 @@ services:
|
|||||||
image: cerc/laconicd:local
|
image: cerc/laconicd:local
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
# TODO: look at folding this script into the container
|
# TODO: look at folding these scripts into the container
|
||||||
- ../config/fixturenet-laconicd/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ../config/fixturenet-laconicd/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
|
- ../config/fixturenet-laconicd/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh
|
||||||
# TODO: determine which of the ports below is really needed
|
# TODO: determine which of the ports below is really needed
|
||||||
ports:
|
ports:
|
||||||
- "6060"
|
- "6060"
|
||||||
@@ -18,4 +19,7 @@ services:
|
|||||||
- "9090"
|
- "9090"
|
||||||
- "9091"
|
- "9091"
|
||||||
- "1317"
|
- "1317"
|
||||||
|
cli:
|
||||||
|
image: cerc/laconic-registry-cli:local
|
||||||
|
volumes:
|
||||||
|
- ../config/fixturenet-laconicd/registry-cli-config-template.yml:/registry-cli-config-template.yml
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Add-on pod to include foundry tooling within a fixturenet
|
||||||
|
services:
|
||||||
|
foundry:
|
||||||
|
image: ghcr.io/foundry-rs/foundry:latest
|
||||||
|
command: ["while :; do sleep 600; done"]
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
echo y | laconicd keys export mykey --unarmored-hex --unsafe
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
services:
|
||||||
|
cns:
|
||||||
|
restEndpoint: 'http://laconicd:1317'
|
||||||
|
gqlEndpoint: 'http://laconicd:9473/api'
|
||||||
|
userKey: REPLACE_WITH_MYKEY
|
||||||
|
bondId:
|
||||||
|
chainId: laconic_9000-1
|
||||||
@@ -48,10 +48,13 @@ RUN npm config set @lirewine:registry ${CERC_NPM_URL} \
|
|||||||
# TODO: the image at this point could be made a base image for several different CLI images
|
# TODO: the image at this point could be made a base image for several different CLI images
|
||||||
# that install different Node-based CLI commands
|
# that install different Node-based CLI commands
|
||||||
|
|
||||||
# DEBUG, remove
|
|
||||||
RUN yarn info @cerc-io/laconic-registry-cli
|
|
||||||
|
|
||||||
# Globally install the cli package
|
# Globally install the cli package
|
||||||
RUN yarn global add @cerc-io/laconic-registry-cli
|
RUN yarn global add @cerc-io/laconic-registry-cli
|
||||||
|
|
||||||
ENTRYPOINT ["laconic"]
|
# Add scripts
|
||||||
|
RUN mkdir /scripts
|
||||||
|
ENV PATH="${PATH}:/scripts"
|
||||||
|
COPY ./import-key.sh /scripts
|
||||||
|
|
||||||
|
# Default command sleeps forever so docker doesn't kill it
|
||||||
|
CMD ["sh", "-c", "while :; do sleep 600; done"]
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
sed 's/REPLACE_WITH_MYKEY/'${1}'/' registry-cli-config-template.yml > config.yml
|
||||||
@@ -19,3 +19,4 @@ eth-probe
|
|||||||
keycloak
|
keycloak
|
||||||
tx-spammer
|
tx-spammer
|
||||||
kubo
|
kubo
|
||||||
|
foundry
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ containers:
|
|||||||
- cerc/fixturenet-eth-lighthouse
|
- cerc/fixturenet-eth-lighthouse
|
||||||
pods:
|
pods:
|
||||||
- fixturenet-eth
|
- fixturenet-eth
|
||||||
|
- foundry
|
||||||
|
|||||||
+15
-9
@@ -56,10 +56,11 @@ def command(ctx, include, exclude, cluster, command, extra_args):
|
|||||||
|
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
if command == "up":
|
if command == "up":
|
||||||
if debug:
|
container_exec_env = _make_runtime_env(ctx.obj)
|
||||||
os.environ["CERC_SCRIPT_DEBUG"] = "true"
|
for attr, value in container_exec_env.items():
|
||||||
|
os.environ[attr] = value
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Running compose up for extra_args: {extra_args_list}")
|
print(f"Running compose up with container_exec_env: {container_exec_env}, extra_args: {extra_args_list}")
|
||||||
for pre_start_command in cluster_context.pre_start_commands:
|
for pre_start_command in cluster_context.pre_start_commands:
|
||||||
_run_command(ctx.obj, cluster_context.cluster, pre_start_command)
|
_run_command(ctx.obj, cluster_context.cluster, pre_start_command)
|
||||||
docker.compose.up(detach=True, services=extra_args_list)
|
docker.compose.up(detach=True, services=extra_args_list)
|
||||||
@@ -74,12 +75,8 @@ def command(ctx, include, exclude, cluster, command, extra_args):
|
|||||||
print("Usage: exec <service> <cmd>")
|
print("Usage: exec <service> <cmd>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
service_name = extra_args_list[0]
|
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 = {
|
container_exec_env = _make_runtime_env(ctx.obj)
|
||||||
"CERC_HOST_UID": f"{os.getuid()}",
|
|
||||||
"CERC_HOST_GID": f"{os.getgid()}"
|
|
||||||
}
|
|
||||||
container_exec_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Running compose exec {service_name} {command_to_exec}")
|
print(f"Running compose exec {service_name} {command_to_exec}")
|
||||||
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
|
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
|
||||||
@@ -141,6 +138,15 @@ def get_stack_status(ctx, stack):
|
|||||||
False
|
False
|
||||||
|
|
||||||
|
|
||||||
|
def _make_runtime_env(ctx):
|
||||||
|
container_exec_env = {
|
||||||
|
"CERC_HOST_UID": f"{os.getuid()}",
|
||||||
|
"CERC_HOST_GID": f"{os.getgid()}"
|
||||||
|
}
|
||||||
|
container_exec_env.update({"CERC_SCRIPT_DEBUG": "true"} if ctx.debug else {})
|
||||||
|
return container_exec_env
|
||||||
|
|
||||||
|
|
||||||
def _make_cluster_context(ctx, include, exclude, cluster):
|
def _make_cluster_context(ctx, include, exclude, cluster):
|
||||||
|
|
||||||
if ctx.local_stack:
|
if ctx.local_stack:
|
||||||
|
|||||||
Reference in New Issue
Block a user