forked from cerc-io/stack-orchestrator
Compare commits
51
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec54258285 | ||
|
|
1f2ee33b42 | ||
|
|
a2b700727c | ||
|
|
fa8ba7f9ef | ||
|
|
dd0b8ae81f | ||
|
|
b5c7ad114c | ||
|
|
d0d29717e1 | ||
|
|
368091e125 | ||
|
|
27195fc977 | ||
|
|
91ad0f39e6 | ||
|
|
b47b2200ce | ||
|
|
2e291b3e4c | ||
|
|
629e484c30 | ||
|
|
3d7d23b68b | ||
|
|
c6c9e229d2 | ||
|
|
c77cc4e111 | ||
|
|
26c654f3ef | ||
|
|
b6a84db6a2 | ||
|
|
e7d31e78ad | ||
|
|
86b7e6957c | ||
|
|
7812490434 | ||
|
|
161cd37b9c | ||
|
|
e183e2a880 | ||
|
|
7bd8045d6e | ||
|
|
b2268a6518 | ||
|
|
dfef77f35f | ||
|
|
78cd4e2e3e | ||
|
|
dca9a36633 | ||
|
|
e799c9eaef | ||
|
|
42dac0e712 | ||
|
|
a44c063e5a | ||
|
|
6ad2684de3 | ||
|
|
5e7b51ee6a | ||
|
|
50103fcc9c | ||
|
|
edb7346f31 | ||
|
|
377d18d540 | ||
|
|
6ed90536cf | ||
|
|
7d00228ca2 | ||
|
|
8f9f23b1c4 | ||
|
|
429e04f81d | ||
|
|
7a9926b695 | ||
|
|
0372504f44 | ||
|
|
b29537ad7c | ||
|
|
1cf58c900e | ||
|
|
c6df9ae0c1 | ||
|
|
f1cd13d988 | ||
|
|
edc24e4fc8 | ||
|
|
533ed4ee9b | ||
|
|
ba5eecaada | ||
|
|
5f73a93f5f | ||
|
|
135295f0f9 |
@@ -8,9 +8,9 @@ Stack Orchestrator allows building and deployment of a Laconic Stack on a single
|
||||
|
||||
Ensure that the following are already installed:
|
||||
|
||||
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download)
|
||||
- [Docker](https://docs.docker.com/get-docker/)
|
||||
- [Docker Compose](https://docs.docker.com/compose/install/)
|
||||
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.10.8`
|
||||
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
||||
- [Docker Compose](https://docs.docker.com/compose/install/): `docker-compose --version` >= `2.13.0`
|
||||
|
||||
Note: if installing docker-compose via package manager (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g., on Linux:
|
||||
|
||||
@@ -97,7 +97,7 @@ laconic-so --verbose deploy-system --include ipld-eth-db,go-ethereum-foundry,ipl
|
||||
|
||||
## Contributing
|
||||
|
||||
See the [CONTRIBUTING.md](.github/CONTRIBUTING.md) for developer mode install.
|
||||
See the [CONTRIBUTING.md](/docs/CONTRIBUTING.md) for developer mode install.
|
||||
|
||||
## Platform Support
|
||||
|
||||
|
||||
+26
-7
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2022 Cerc
|
||||
# Copyright © 2022, 2023 Cerc
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@@ -21,12 +21,13 @@
|
||||
# TODO: display the available list of containers; allow re-build of either all or specific containers
|
||||
|
||||
import os
|
||||
import sys
|
||||
from decouple import config
|
||||
import subprocess
|
||||
import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from .util import include_exclude_check
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
|
||||
# TODO: find a place for this
|
||||
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
|
||||
@@ -43,6 +44,8 @@ def command(ctx, include, exclude):
|
||||
verbose = ctx.obj.verbose
|
||||
dry_run = ctx.obj.dry_run
|
||||
local_stack = ctx.obj.local_stack
|
||||
stack = ctx.obj.stack
|
||||
continue_on_error = ctx.obj.continue_on_error
|
||||
|
||||
# See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure
|
||||
container_build_dir = Path(__file__).absolute().parent.joinpath("data", "container-build")
|
||||
@@ -62,10 +65,19 @@ def command(ctx, include, exclude):
|
||||
# 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()
|
||||
all_containers = container_list_file.read().splitlines()
|
||||
|
||||
containers_in_scope = []
|
||||
if stack:
|
||||
stack_config = get_parsed_stack_config(stack)
|
||||
containers_in_scope = stack_config['containers']
|
||||
else:
|
||||
containers_in_scope = all_containers
|
||||
|
||||
if verbose:
|
||||
print(f'Containers: {containers}')
|
||||
print(f'Containers: {containers_in_scope}')
|
||||
if stack:
|
||||
print(f"Stack: {stack}")
|
||||
|
||||
# TODO: make this configurable
|
||||
container_build_env = {
|
||||
@@ -96,12 +108,19 @@ def command(ctx, include, exclude):
|
||||
if verbose:
|
||||
print(f"Executing: {build_command}")
|
||||
build_result = subprocess.run(build_command, shell=True, env=container_build_env)
|
||||
# TODO: check result in build_result.returncode
|
||||
print(f"Result is: {build_result}")
|
||||
if verbose:
|
||||
print(f"Return code is: {build_result.returncode}")
|
||||
if build_result.returncode != 0:
|
||||
print(f"Error running build for {container}")
|
||||
if not continue_on_error:
|
||||
print("FATAL Error: container build failed and --continue-on-error not set, exiting")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("****** Container Build Error, continuing because --continue-on-error is set")
|
||||
else:
|
||||
print("Skipped")
|
||||
|
||||
for container in containers:
|
||||
for container in containers_in_scope:
|
||||
if include_exclude_check(container, include, exclude):
|
||||
process_container(container)
|
||||
else:
|
||||
|
||||
+39
-18
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2022 Cerc
|
||||
# Copyright © 2022, 2023 Cerc
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@@ -19,11 +19,12 @@
|
||||
# CERC_REPO_BASE_DIR defaults to ~/cerc
|
||||
|
||||
import os
|
||||
import sys
|
||||
from decouple import config
|
||||
import click
|
||||
import importlib.resources
|
||||
from python_on_whales import docker
|
||||
from .util import include_exclude_check
|
||||
from python_on_whales import docker, DockerException
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
|
||||
@click.command()
|
||||
@click.option('--include', help="only build these packages")
|
||||
@@ -37,6 +38,8 @@ def command(ctx, include, exclude):
|
||||
dry_run = ctx.obj.dry_run
|
||||
local_stack = ctx.obj.local_stack
|
||||
debug = ctx.obj.debug
|
||||
stack = ctx.obj.stack
|
||||
continue_on_error = ctx.obj.continue_on_error
|
||||
|
||||
if local_stack:
|
||||
dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")]
|
||||
@@ -53,10 +56,18 @@ def command(ctx, include, exclude):
|
||||
# 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()
|
||||
all_packages = package_list_file.read().splitlines()
|
||||
|
||||
packages_in_scope = []
|
||||
if stack:
|
||||
stack_config = get_parsed_stack_config(stack)
|
||||
# TODO: syntax check the input here
|
||||
packages_in_scope = stack_config['npms']
|
||||
else:
|
||||
packages_in_scope = all_packages
|
||||
|
||||
if verbose:
|
||||
print(f'Packages: {packages}')
|
||||
print(f'Packages: {packages_in_scope}')
|
||||
|
||||
def build_package(package):
|
||||
if not quiet:
|
||||
@@ -69,22 +80,32 @@ def command(ctx, include, exclude):
|
||||
if verbose:
|
||||
print(f"Executing: {build_command}")
|
||||
envs = {"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"]} | ({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
|
||||
build_result = docker.run("cerc/builder-js",
|
||||
remove=True,
|
||||
interactive=True,
|
||||
tty=True,
|
||||
user=f"{os.getuid()}:{os.getgid()}",
|
||||
envs=envs,
|
||||
add_hosts=[("gitea.local", "host-gateway")],
|
||||
volumes=[(repo_full_path, "/workspace")],
|
||||
command=build_command
|
||||
)
|
||||
# TODO: check result in build_result.returncode
|
||||
print(f"Result is: {build_result}")
|
||||
try:
|
||||
docker.run("cerc/builder-js",
|
||||
remove=True,
|
||||
interactive=True,
|
||||
tty=True,
|
||||
user=f"{os.getuid()}:{os.getgid()}",
|
||||
envs=envs,
|
||||
add_hosts=[("gitea.local", "host-gateway")],
|
||||
volumes=[(repo_full_path, "/workspace")],
|
||||
command=build_command
|
||||
)
|
||||
# Note that although the docs say that build_result should contain
|
||||
# the command output as a string, in reality it is always the empty string.
|
||||
# Since we detect errors via catching exceptions below, we can safely ignore it here.
|
||||
except DockerException as e:
|
||||
print(f"Error executing build for {package} in container:\n {e}")
|
||||
if not continue_on_error:
|
||||
print("FATAL Error: build failed and --continue-on-error not set, exiting")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("****** Build Error, continuing because --continue-on-error is set")
|
||||
|
||||
else:
|
||||
print("Skipped")
|
||||
|
||||
for package in packages:
|
||||
for package in packages_in_scope:
|
||||
if include_exclude_check(package, include, exclude):
|
||||
build_package(package)
|
||||
else:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
prometheus:
|
||||
restart: always
|
||||
image: prom/prometheus
|
||||
depends_on:
|
||||
fixturenet-eth-geth-1:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ../config/fixturenet-eth-metrics/prometheus/etc:/etc/prometheus
|
||||
ports:
|
||||
- "9090"
|
||||
grafana:
|
||||
restart: always
|
||||
image: grafana/grafana
|
||||
volumes:
|
||||
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/dashboards:/etc/grafana/provisioning/dashboards
|
||||
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/datasources:/etc/grafana/provisioning/datasources
|
||||
- ../config/fixturenet-eth-metrics/grafana/etc/dashboards:/etc/grafana/dashboards
|
||||
ports:
|
||||
- "3000"
|
||||
@@ -20,16 +20,24 @@ services:
|
||||
DATABASE_USER: "vdbm"
|
||||
DATABASE_PASSWORD: "password"
|
||||
ETH_CHAIN_ID: 99
|
||||
ETH_FORWARD_ETH_CALLS: $eth_forward_eth_calls
|
||||
ETH_PROXY_ON_ERROR: $eth_proxy_on_error
|
||||
ETH_HTTP_PATH: $eth_http_path
|
||||
ETH_FORWARD_ETH_CALLS: "false"
|
||||
ETH_FORWARD_GET_STORAGE_AT: "false"
|
||||
ETH_PROXY_ON_ERROR: "false"
|
||||
METRICS: "true"
|
||||
PROM_HTTP: "true"
|
||||
PROM_HTTP_ADDR: "0.0.0.0"
|
||||
PROM_HTTP_PORT: "8090"
|
||||
LOGRUS_LEVEL: "debug"
|
||||
CERC_REMOTE_DEBUG: "true"
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ../config/ipld-eth-server/chain.json
|
||||
target: /tmp/chain.json
|
||||
ports:
|
||||
- "127.0.0.1:8081:8081"
|
||||
- "127.0.0.1:8082:8082"
|
||||
- "8081"
|
||||
- "8082"
|
||||
- "8090"
|
||||
- "40000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "localhost", "8081"]
|
||||
interval: 20s
|
||||
|
||||
@@ -29,9 +29,17 @@ services:
|
||||
condition: service_healthy
|
||||
keycloak-nginx:
|
||||
image: nginx:1.23-alpine
|
||||
restart: always
|
||||
volumes:
|
||||
- ../config/keycloak/nginx:/etc/nginx/conf.d
|
||||
ports:
|
||||
- 80
|
||||
depends_on:
|
||||
- keycloak
|
||||
keycloak-nginx-prometheus-exporter:
|
||||
image: nginx/nginx-prometheus-exporter
|
||||
restart: always
|
||||
environment:
|
||||
- SCRAPE_URI=http://keycloak-nginx:80/stub_status
|
||||
depends_on:
|
||||
- keycloak-nginx
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
# If you want prometheus to work, you must update the following file in the ops repo locally.
|
||||
# localhost:6060 --> go-ethereum:6060
|
||||
prometheus:
|
||||
restart: always
|
||||
user: "987"
|
||||
image: prom/prometheus
|
||||
volumes:
|
||||
- ${cerc_ops}/metrics/etc:/etc/prometheus
|
||||
- ./prometheus-data:/prometheus
|
||||
ports:
|
||||
- "127.0.0.1:9090:9090"
|
||||
grafana:
|
||||
restart: always
|
||||
user: "472"
|
||||
image: grafana/grafana
|
||||
volumes:
|
||||
- ./grafana-data:/var/lib/grafana
|
||||
ports:
|
||||
- "127.0.0.1:3000:3000"
|
||||
@@ -3,3 +3,5 @@ services:
|
||||
test:
|
||||
image: cerc/test-container:local
|
||||
restart: always
|
||||
ports:
|
||||
- "80"
|
||||
|
||||
+1089
File diff suppressed because it is too large
Load Diff
+9
@@ -0,0 +1,9 @@
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: dashboards
|
||||
type: file
|
||||
updateIntervalSeconds: 10
|
||||
options:
|
||||
path: /etc/grafana/dashboards
|
||||
foldersFromFilesStructure: true
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- id: 1
|
||||
uid: jZUuGao4k
|
||||
orgId: 1
|
||||
name: Prometheus
|
||||
type: prometheus
|
||||
typeName: Prometheus
|
||||
typeLogoUrl: public/app/plugins/datasource/prometheus/img/prometheus_logo.svg
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
user: ""
|
||||
database: ""
|
||||
basicAuth: false
|
||||
isDefault: true
|
||||
jsonData:
|
||||
httpMethod: POST
|
||||
readOnly: false
|
||||
@@ -0,0 +1,34 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
# ipld-eth-server
|
||||
- job_name: 'ipld-eth-server'
|
||||
metrics_path: /metrics
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['ipld-eth-server:8090']
|
||||
|
||||
# geth
|
||||
- job_name: 'geth'
|
||||
metrics_path: /debug/metrics/prometheus
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets: ['fixturenet-eth-geth-1:6060']
|
||||
|
||||
# nginx
|
||||
- job_name: 'nginx'
|
||||
scrape_interval: 5s
|
||||
metrics_path: /metrics
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets: ['keycloak-nginx-prometheus-exporter:9113']
|
||||
|
||||
# keycloak
|
||||
- job_name: 'keycloak'
|
||||
scrape_interval: 5s
|
||||
metrics_path: /auth/realms/cerc/metrics
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets: ['keycloak:8080']
|
||||
@@ -20,16 +20,19 @@ server {
|
||||
proxy_pass http://fixturenet-eth-geth-1:8545;
|
||||
}
|
||||
|
||||
### ipld-eth-server
|
||||
## ipld-eth-server
|
||||
# location ~ ^/ipld/eth/([^/]*)$ {
|
||||
# set $apiKey $1;
|
||||
# if ($apiKey = '') {
|
||||
# set $apiKey $http_X_API_KEY;
|
||||
# }
|
||||
# auth_request /auth;
|
||||
# auth_request_set $user_id $sent_http_x_user_id;
|
||||
# proxy_buffering off;
|
||||
# rewrite /.*$ / break;
|
||||
# proxy_pass http://ipld-eth-server:8081;
|
||||
# proxy_set_header X-Original-Remote-Addr $remote_addr;
|
||||
# proxy_set_header X-User-Id $user_id;
|
||||
# }
|
||||
#
|
||||
# location ~ ^/ipld/gql/([^/]*)$ {
|
||||
@@ -42,14 +45,14 @@ server {
|
||||
# rewrite /.*$ / break;
|
||||
# proxy_pass http://ipld-eth-server:8082;
|
||||
# }
|
||||
#
|
||||
### lighthouse
|
||||
# location /beacon/ {
|
||||
# set $apiKey $http_X_API_KEY;
|
||||
# auth_request /auth;
|
||||
# proxy_buffering off;
|
||||
# proxy_pass http://fixturenet-eth-lighthouse-1:8001/;
|
||||
# }
|
||||
|
||||
## lighthouse
|
||||
location /beacon/ {
|
||||
set $apiKey $http_X_API_KEY;
|
||||
auth_request /auth;
|
||||
proxy_buffering off;
|
||||
proxy_pass http://fixturenet-eth-lighthouse-1:8001/;
|
||||
}
|
||||
|
||||
location = /auth {
|
||||
internal;
|
||||
@@ -63,7 +66,7 @@ server {
|
||||
proxy_set_header X-Original-Host $host;
|
||||
}
|
||||
|
||||
# location = /basic_status {
|
||||
# stub_status;
|
||||
# }
|
||||
location = /stub_status {
|
||||
stub_status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# From: https://github.com/vyzo/gerbil/blob/master/docker/Dockerfile
|
||||
FROM gerbil/ubuntu
|
||||
|
||||
# Install the Solidity compiler (latest stable version)
|
||||
# and guile
|
||||
# and libsecp256k1-dev
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" && \
|
||||
apt-get install -y software-properties-common && \
|
||||
add-apt-repository ppa:ethereum/ethereum && \
|
||||
apt-get update && \
|
||||
apt-get install -y solc && \
|
||||
apt-get install -y guile-3.0 && \
|
||||
apt-get install -y libsecp256k1-dev && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN mkdir /scripts
|
||||
COPY install-dependencies.sh /scripts
|
||||
|
||||
RUN bash /scripts/install-dependencies.sh
|
||||
|
||||
# Needed to prevent git from raging about /src
|
||||
RUN git config --global --add safe.directory /src
|
||||
|
||||
COPY entrypoint.sh /scripts
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
@@ -0,0 +1,21 @@
|
||||
## Gerbil Scheme Builder
|
||||
|
||||
This container is designed to be used as a simple "build runner" environment for building and running Scheme projects using Gerbil and gerbil-ethereum. Its primary purpose is to allow build/test/run of gerbil code without the need to install and configure all the necessary prerequisites and dependencies on the host system.
|
||||
|
||||
### Usage
|
||||
|
||||
First build the container with:
|
||||
|
||||
```
|
||||
$ laconic-so build-containers --include cerc/builder-gerbil
|
||||
```
|
||||
|
||||
Now, assuming a gerbil project located at `~/projects/my-project`, run bash in the container mounting the project with:
|
||||
|
||||
```
|
||||
$ docker run -it -v $HOME/projects/my-project:/src cerc/builder-gerbil:latest bash
|
||||
root@7c4124bb09e3:/src#
|
||||
```
|
||||
|
||||
Now gerbil commands can be run.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec "$@"
|
||||
@@ -0,0 +1,15 @@
|
||||
DEPS=(github.com/fare/gerbil-utils
|
||||
github.com/fare/gerbil-poo
|
||||
github.com/fare/gerbil-crypto
|
||||
github.com/fare/gerbil-persist
|
||||
github.com/fare/gerbil-ethereum
|
||||
github.com/drewc/gerbil-swank
|
||||
github.com/drewc/drewc-r7rs-swank
|
||||
github.com/drewc/smug-gerbil
|
||||
github.com/drewc/ftw
|
||||
github.com/vyzo/gerbil-libp2p
|
||||
) ;
|
||||
for i in ${DEPS[@]} ; do
|
||||
gxpkg install $i &&
|
||||
gxpkg build $i
|
||||
done
|
||||
@@ -13,6 +13,8 @@ if [[ -z "${CERC_NPM_AUTH_TOKEN}" ]]; then
|
||||
echo "CERC_NPM_AUTH_TOKEN is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Exit on error
|
||||
set -e
|
||||
local_npm_registry_url=$1
|
||||
package_publish_version=$2
|
||||
# TODO: make this a paramater and allow a list of scopes
|
||||
|
||||
@@ -17,6 +17,8 @@ if [[ $# -eq 2 ]]; then
|
||||
else
|
||||
package_publish_version=$( cat package.json | jq -r .version )
|
||||
fi
|
||||
# Exit on error
|
||||
set -e
|
||||
# Get the name of this package from package.json since we weren't passed that
|
||||
package_name=$( cat package.json | jq -r .name )
|
||||
local_npm_registry_url=$1
|
||||
@@ -24,7 +26,7 @@ npm config set @lirewine:registry ${local_npm_registry_url}
|
||||
npm config set @cerc-io:registry ${local_npm_registry_url}
|
||||
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||
# First check if the version of this package we're trying to build already exists in the registry
|
||||
package_exists=$( yarn info --json ${package_name}@${package_publish_version} | jq -r .data.dist.tarball )
|
||||
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
|
||||
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
|
||||
echo "${package_publish_version} of ${package_name} already exists in the registry, skipping build"
|
||||
exit 0
|
||||
|
||||
@@ -14,14 +14,23 @@ if [[ $# -ne 2 ]]; then
|
||||
echo "Illegal number of parameters" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Exit on error
|
||||
set -e
|
||||
target_package=$1
|
||||
local_npm_registry_url=$2
|
||||
# TODO: use jq rather than sed here:
|
||||
versioned_target_package=$(grep ${target_package} package.json | sed -e 's#[[:space:]]\{1,\}\"\('${target_package}'\)\":[[:space:]]\{1,\}\"\(.*\)\",#\1@\2#' )
|
||||
# Use yarn info to get URL checksums etc from the new registry
|
||||
yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null)
|
||||
# Code below parses out the values we need
|
||||
# First check if the target version actually exists.
|
||||
# If it doesn't exist there will be no .data.dist.tarball element,
|
||||
# and jq will output the string "null"
|
||||
package_tarball=$(echo $yarn_info_output | jq -r .data.dist.tarball)
|
||||
if [[ $package_tarball == "null" ]]; then
|
||||
echo "FATAL: Target package version ($versioned_target_package) not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Code below parses out the values we need
|
||||
# When running inside a container, the registry can return a URL with the wrong host name due to proxying
|
||||
# so we need to check if that has happened and fix the URL if so.
|
||||
if ! [[ "${package_tarball}" =~ ^${local_npm_registry_url}.* ]]; then
|
||||
@@ -33,6 +42,7 @@ package_integrity=$(echo $yarn_info_output | jq -r .data.dist.integrity)
|
||||
package_shasum=$(echo $yarn_info_output | jq -r .data.dist.shasum)
|
||||
package_resolved=${package_tarball}#${package_shasum}
|
||||
# Some strings need to be escaped so they work when passed to sed later
|
||||
escaped_package_integrity=$(printf '%s\n' "$package_integrity" | sed -e 's/[\/&]/\\&/g')
|
||||
escaped_package_resolved=$(printf '%s\n' "$package_resolved" | sed -e 's/[\/&]/\\&/g')
|
||||
escaped_target_package=$(printf '%s\n' "$target_package" | sed -e 's/[\/&]/\\&/g')
|
||||
if [ -n "$CERC_SCRIPT_VERBOSE" ]; then
|
||||
@@ -44,4 +54,4 @@ fi
|
||||
# Use magic sed regex to replace the values in yarn.lock
|
||||
# Note: yarn.lock is not json so we can not use jq for this
|
||||
sed -i -e '/^\"'${escaped_target_package}'.*\":$/ , /^\".*$/ s/^\([[:space:]]\{1,\}resolved \).*$/\1'\"${escaped_package_resolved}\"'/' yarn.lock
|
||||
sed -i -e '/^\"'${escaped_target_package}'.*\":$/ , /^\".*$/ s/^\([[:space:]]\{1,\}integrity \).*$/\1'${package_integrity}'/' yarn.lock
|
||||
sed -i -e '/^\"'${escaped_target_package}'.*\":$/ , /^\".*$/ s/^\([[:space:]]\{1,\}integrity \).*$/\1'${escaped_package_integrity}'/' yarn.lock
|
||||
|
||||
@@ -8,12 +8,14 @@ LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL}
|
||||
GETH_BASE_URL=${GETH_BASE_URL}
|
||||
|
||||
if [ -z "$LIGHTHOUSE_BASE_URL" ]; then
|
||||
LIGHTHOUSE_PORT=`docker ps -f "name=fixturenet-eth-lighthouse-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
|
||||
LIGHTHOUSE_CONTAINER=`docker ps -q -f "name=fixturenet-eth-lighthouse-1-1"`
|
||||
LIGHTHOUSE_PORT=`docker port $LIGHTHOUSE_CONTAINER 8001 | cut -d':' -f2`
|
||||
LIGHTHOUSE_BASE_URL="http://localhost:${LIGHTHOUSE_PORT}"
|
||||
fi
|
||||
|
||||
if [ -z "$GETH_BASE_URL" ]; then
|
||||
GETH_PORT=`docker ps -f "name=fixturenet-eth-geth-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
|
||||
GETH_CONTAINER=`docker ps -q -f "name=fixturenet-eth-geth-1-1"`
|
||||
GETH_PORT=`docker port $GETH_CONTAINER 8545 | cut -d':' -f2`
|
||||
GETH_BASE_URL="http://localhost:${GETH_PORT}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
FROM ghcr.io/foundry-rs/foundry
|
||||
# Use locally build foundry base image to work around there being
|
||||
# no aarm64 image published.
|
||||
FROM foundry-rs/foundry:local
|
||||
|
||||
RUN apk update ; apk add --no-cache --allow-untrusted ca-certificates curl bash git jq
|
||||
RUN apk add --no-cache --upgrade grep
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM quay.io/keycloak/keycloak:20.0
|
||||
WORKDIR /opt/keycloak/providers
|
||||
RUN curl -L https://github.com/aerogear/keycloak-metrics-spi/releases/download/2.5.3/keycloak-metrics-spi-2.5.3.jar --output keycloak-metrics-spi.jar
|
||||
RUN curl -L https://github.com/cerc-io/keycloak-api-key-demo/releases/download/v0.1/api-key-module-0.1.jar --output api-key-module.jar
|
||||
RUN curl -L https://github.com/cerc-io/keycloak-api-key-demo/releases/download/v0.2/api-key-module-0.2.jar --output api-key-module.jar
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
FROM alpine:latest
|
||||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" && \
|
||||
apt-get install -y software-properties-common && \
|
||||
apt-get install -y nginx && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY run.sh /app/run.sh
|
||||
|
||||
|
||||
@@ -12,5 +12,5 @@ else
|
||||
echo `date` > $EXISTSFILENAME
|
||||
fi
|
||||
|
||||
# Sleep forever to keep docker happy
|
||||
while true; do sleep 10; done
|
||||
# Run nginx which will block here forever
|
||||
/usr/sbin/nginx -g "daemon off;"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build foundry-rs/foundry
|
||||
# HACK below : TARGETARCH needs to be derived from the host environment
|
||||
docker build -t foundry-rs/foundry:local ${CERC_REPO_BASE_DIR}/foundry
|
||||
@@ -1,3 +1,4 @@
|
||||
foundry-rs/foundry
|
||||
cerc/test-contract
|
||||
cerc/eth-statediff-fill-service
|
||||
cerc/eth-statediff-service
|
||||
@@ -22,3 +23,4 @@ cerc/eth-probe
|
||||
cerc/builder-js
|
||||
cerc/keycloak
|
||||
cerc/tx-spammer
|
||||
cerc/builder-gerbil
|
||||
|
||||
@@ -6,10 +6,10 @@ ipld-eth-beacon-db
|
||||
ipld-eth-beacon-indexer
|
||||
ipld-eth-server
|
||||
lighthouse
|
||||
prometheus-grafana
|
||||
laconicd
|
||||
fixturenet-laconicd
|
||||
fixturenet-eth
|
||||
fixturenet-eth-metrics
|
||||
watcher-mobymask
|
||||
watcher-erc20
|
||||
watcher-erc721
|
||||
|
||||
@@ -16,3 +16,4 @@ vulcanize/uniswap-v3-info
|
||||
vulcanize/assemblyscript
|
||||
cerc-io/eth-probe
|
||||
cerc-io/tx-spammer
|
||||
foundry-rs/foundry
|
||||
|
||||
@@ -13,6 +13,6 @@ containers:
|
||||
- cerc/watcher-erc20
|
||||
pods:
|
||||
- go-ethereum-foundry
|
||||
- db
|
||||
- ipld-eth-db
|
||||
- ipld-eth-server
|
||||
- watcher-erc20
|
||||
|
||||
@@ -13,6 +13,6 @@ containers:
|
||||
- cerc/watcher-erc721
|
||||
pods:
|
||||
- go-ethereum-foundry
|
||||
- db
|
||||
- ipld-eth-db
|
||||
- ipld-eth-server
|
||||
- watcher-erc721
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
version: "1.0"
|
||||
name: fixturenet-eth
|
||||
decription: "Ethereum Fixturenet"
|
||||
repos:
|
||||
- cerc-io/go-ethereum
|
||||
- cerc-io/lighthouse
|
||||
containers:
|
||||
- cerc/go-ethereum
|
||||
- cerc/lighthouse
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
version: "1.0"
|
||||
name: fixturenet-laconicd
|
||||
description: "A laconicd fixturenet"
|
||||
repos:
|
||||
- cerc-io/laconicd
|
||||
- cerc-io/laconic-sdk
|
||||
- cerc-io/laconic-registry-cli
|
||||
npms:
|
||||
- laconic-sdk
|
||||
- laconic-registry-cli
|
||||
containers:
|
||||
- cerc/laconicd
|
||||
- cerc/laconic-registry-cli
|
||||
@@ -0,0 +1,3 @@
|
||||
# Test Stack
|
||||
|
||||
A stack for test/demo purposes.
|
||||
@@ -0,0 +1,9 @@
|
||||
version: "1.0"
|
||||
name: test
|
||||
description: "A test stack"
|
||||
repos:
|
||||
- cerc-io/laconicd
|
||||
containers:
|
||||
- cerc/test-container
|
||||
pods:
|
||||
- test
|
||||
@@ -1,2 +1,2 @@
|
||||
# This file should be re-generated running: scripts/update-version-file.sh script
|
||||
v1.0.9-alpha-04a3049
|
||||
v1.0.14-a144dde
|
||||
|
||||
+29
-10
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2022 Cerc
|
||||
# Copyright © 2022, 2023 Cerc
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@@ -22,7 +22,7 @@ from python_on_whales import DockerClient
|
||||
import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from .util import include_exclude_check
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
|
||||
|
||||
@click.command()
|
||||
@@ -30,9 +30,9 @@ from .util import include_exclude_check
|
||||
@click.option("--exclude", help="don\'t start these components")
|
||||
@click.option("--cluster", help="specify a non-default cluster name")
|
||||
@click.argument('command', required=True) # help: command: up|down|ps
|
||||
@click.argument('services', nargs=-1) # help: command: up|down|ps <service1> <service2>
|
||||
@click.argument('extra_args', nargs=-1) # help: command: up|down|ps <service1> <service2>
|
||||
@click.pass_context
|
||||
def command(ctx, include, exclude, cluster, command, services):
|
||||
def command(ctx, include, exclude, cluster, command, extra_args):
|
||||
'''deploy a stack'''
|
||||
|
||||
# TODO: implement option exclusion and command value constraint lost with the move from argparse to click
|
||||
@@ -40,6 +40,7 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
quiet = ctx.obj.quiet
|
||||
verbose = ctx.obj.verbose
|
||||
dry_run = ctx.obj.dry_run
|
||||
stack = ctx.obj.stack
|
||||
|
||||
# See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure
|
||||
compose_dir = Path(__file__).absolute().parent.joinpath("data", "compose")
|
||||
@@ -56,15 +57,23 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
# 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()
|
||||
all_pods = pod_list_file.read().splitlines()
|
||||
|
||||
pods_in_scope = []
|
||||
if stack:
|
||||
stack_config = get_parsed_stack_config(stack)
|
||||
# TODO: syntax check the input here
|
||||
pods_in_scope = stack_config['pods']
|
||||
else:
|
||||
pods_in_scope = all_pods
|
||||
|
||||
if verbose:
|
||||
print(f"Pods: {pods}")
|
||||
print(f"Pods: {pods_in_scope}")
|
||||
|
||||
# Construct a docker compose command suitable for our purpose
|
||||
|
||||
compose_files = []
|
||||
for pod in pods:
|
||||
for pod in pods_in_scope:
|
||||
if include_exclude_check(pod, include, exclude):
|
||||
compose_file_name = os.path.join(compose_dir, f"docker-compose-{pod}.yml")
|
||||
compose_files.append(compose_file_name)
|
||||
@@ -78,17 +87,27 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
# See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/
|
||||
docker = DockerClient(compose_files=compose_files, compose_project_name=cluster)
|
||||
|
||||
services_list = list(services) or None
|
||||
extra_args_list = list(extra_args) or None
|
||||
|
||||
if not dry_run:
|
||||
if command == "up":
|
||||
if verbose:
|
||||
print(f"Running compose up for services: {services_list}")
|
||||
docker.compose.up(detach=True, services=services_list)
|
||||
print(f"Running compose up for extra_args: {extra_args_list}")
|
||||
docker.compose.up(detach=True, services=extra_args_list)
|
||||
elif command == "down":
|
||||
if verbose:
|
||||
print("Running compose down")
|
||||
docker.compose.down()
|
||||
elif command == "port":
|
||||
if extra_args_list is None or len(extra_args_list) < 2:
|
||||
print("Usage: port <service> <exposed-port>")
|
||||
sys.exit(1)
|
||||
service_name = extra_args_list[0]
|
||||
exposed_port = extra_args_list[1]
|
||||
if verbose:
|
||||
print("Running compose port")
|
||||
mapped_port_data = docker.compose.port(service_name, exposed_port)
|
||||
print(f"{mapped_port_data[0]}:{mapped_port_data[1]}")
|
||||
elif command == "ps":
|
||||
if verbose:
|
||||
print("Running compose ps")
|
||||
|
||||
+27
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright © 2022 Cerc
|
||||
# Copyright © 2022, 2023 Cerc
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@@ -13,6 +13,12 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||
|
||||
import os.path
|
||||
import sys
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def include_exclude_check(s, include, exclude):
|
||||
if include is None and exclude is None:
|
||||
return True
|
||||
@@ -22,3 +28,23 @@ def include_exclude_check(s, include, exclude):
|
||||
if exclude is not None:
|
||||
exclude_list = exclude.split(",")
|
||||
return s not in exclude_list
|
||||
|
||||
|
||||
def get_parsed_stack_config(stack):
|
||||
# In order to be compatible with Python 3.8 we need to use this hack to get the path:
|
||||
# See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure
|
||||
stack_file_path = Path(__file__).absolute().parent.joinpath("data", "stacks", stack, "stack.yml")
|
||||
try:
|
||||
with stack_file_path:
|
||||
stack_config = yaml.safe_load(open(stack_file_path, "r"))
|
||||
return stack_config
|
||||
except FileNotFoundError as error:
|
||||
# We try here to generate a useful diagnostic error
|
||||
# First check if the stack directory is present
|
||||
stack_directory = stack_file_path.parent
|
||||
if os.path.exists(stack_directory):
|
||||
print(f"Error: stack.yml file is missing from stack: {stack}")
|
||||
else:
|
||||
print(f"Error: stack: {stack} does not exist")
|
||||
print(f"Exiting, error: {error}")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -27,13 +27,14 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
||||
# TODO: this seems kind of weird and heavy on boilerplate -- check it is
|
||||
# the best Python can do for us.
|
||||
class Options(object):
|
||||
def __init__(self, stack, quiet, verbose, dry_run, local_stack, debug):
|
||||
def __init__(self, stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error):
|
||||
self.stack = stack
|
||||
self.quiet = quiet
|
||||
self.verbose = verbose
|
||||
self.dry_run = dry_run
|
||||
self.local_stack = local_stack
|
||||
self.debug = debug
|
||||
self.continue_on_error = continue_on_error
|
||||
|
||||
|
||||
@click.group(context_settings=CONTEXT_SETTINGS)
|
||||
@@ -43,11 +44,12 @@ class Options(object):
|
||||
@click.option('--dry-run', is_flag=True, default=False)
|
||||
@click.option('--local-stack', is_flag=True, default=False)
|
||||
@click.option('--debug', is_flag=True, default=False)
|
||||
@click.option('--continue-on-error', is_flag=True, default=False)
|
||||
# See: https://click.palletsprojects.com/en/8.1.x/complex/#building-a-git-clone
|
||||
@click.pass_context
|
||||
def cli(ctx, stack, quiet, verbose, dry_run, local_stack, debug):
|
||||
def cli(ctx, stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error):
|
||||
"""Laconic Stack Orchestrator"""
|
||||
ctx.obj = Options(stack, quiet, verbose, dry_run, local_stack, debug)
|
||||
ctx.obj = Options(stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error)
|
||||
|
||||
|
||||
cli.add_command(setup_repositories.command, "setup-repositories")
|
||||
|
||||
@@ -5,8 +5,11 @@ Thank you for taking the time to make a contribution to Stack Orchestrator.
|
||||
## Install (developer mode)
|
||||
|
||||
Suitable for developers either modifying or debugging the orchestrator Python code:
|
||||
#### Prerequisites
|
||||
In addition to the binary install prerequisites listed above, the following are required:
|
||||
|
||||
### Prerequisites
|
||||
|
||||
In addition to the pre-requisites listed in the [README](/README.md), the following are required:
|
||||
|
||||
1. Python venv package
|
||||
This may or may not be already installed depending on the host OS and version. Check by running:
|
||||
```
|
||||
@@ -18,26 +21,32 @@ In addition to the binary install prerequisites listed above, the following are
|
||||
```
|
||||
$ apt install python3.10-venv
|
||||
```
|
||||
#### Install
|
||||
|
||||
### Install
|
||||
|
||||
1. Clone this repository:
|
||||
```
|
||||
$ git clone (https://github.com/cerc-io/stack-orchestrator.git
|
||||
```
|
||||
4. Enter the project directory:
|
||||
|
||||
2. Enter the project directory:
|
||||
```
|
||||
$ cd stack-orchestrator
|
||||
```
|
||||
5. Create and activate a venv:
|
||||
|
||||
3. Create and activate a venv:
|
||||
```
|
||||
$ python3 -m venv venv
|
||||
$ source ./venv/bin/activate
|
||||
(venv) $
|
||||
```
|
||||
6. Install the cli in edit mode:
|
||||
|
||||
4. Install the cli in edit mode:
|
||||
```
|
||||
$ pip install --editable .
|
||||
```
|
||||
7. Verify installation:
|
||||
|
||||
5. Verify installation:
|
||||
```
|
||||
(venv) $ laconic-so
|
||||
Usage: laconic-so [OPTIONS] COMMAND [ARGS]...
|
||||
@@ -56,19 +65,23 @@ In addition to the binary install prerequisites listed above, the following are
|
||||
setup-repositories git clone the set of repositories required to build...
|
||||
```
|
||||
|
||||
#### Build a zipapp (single file distributable script)
|
||||
## 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
|
||||
$ (venv) pip install wheel
|
||||
```
|
||||
1. Run shiv to create a zipapp file:
|
||||
|
||||
2. 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:
|
||||
|
||||
3. Verify it works:
|
||||
```
|
||||
$ cp stack-orchetrator/laconic-so ~/bin
|
||||
$ laconic-so
|
||||
@@ -88,4 +101,4 @@ Use shiv to build a single file Python executable zip archive of laconic-so:
|
||||
setup-repositories git clone the set of repositories required to build...
|
||||
```
|
||||
|
||||
|
||||
For cutting releases, use the [shiv build script](/scripts/build_shiv_package.sh).
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 999 KiB |
@@ -1 +0,0 @@
|
||||
8f6452ed13e85a447103a7fff7cf3fb8ff5ea51a
|
||||
+59
-14
@@ -1,37 +1,82 @@
|
||||
# Spec
|
||||
# Specification
|
||||
|
||||
TODO: update
|
||||
|
||||
## 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).
|
||||
Files required to build each container image are stored under `./container-build/<container-name>`
|
||||
Files required at deploy-time are stored under `./config/<component-name>`
|
||||
|
||||
The orchestrator's operation is driven by files shown below.
|
||||
|
||||
- `repository-list.txt` contains the list of git repositories;
|
||||
- `container-image-list.txt` contains the list of container image names
|
||||
- `pod-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).
|
||||
- `container-build/` contains the files required to build each container image
|
||||
- `config/` contains the files required at deploy time
|
||||
|
||||
```
|
||||
├── container-image-list.txt
|
||||
├── pod-list.txt
|
||||
├── repository-list.txt
|
||||
├── compose
|
||||
│ ├── docker-compose-contract.yml
|
||||
│ ├── docker-compose-db-sharding.yml
|
||||
│ ├── docker-compose-db.yml
|
||||
│ ├── docker-compose-eth-probe.yml
|
||||
│ ├── docker-compose-eth-statediff-fill-service.yml
|
||||
│ ├── docker-compose-fixturenet-eth.yml
|
||||
│ ├── docker-compose-fixturenet-laconicd.yml
|
||||
│ ├── docker-compose-go-ethereum-foundry.yml
|
||||
│ ├── docker-compose-ipld-eth-beacon-db.yml
|
||||
│ ├── docker-compose-ipld-eth-beacon-indexer.yml
|
||||
│ ├── docker-compose-ipld-eth-db.yml
|
||||
│ ├── docker-compose-ipld-eth-server.yml
|
||||
│ ├── docker-compose-lighthouse.yml
|
||||
│ └── docker-compose-prometheus-grafana.yml
|
||||
│ ├── docker-compose-keycloak.yml
|
||||
│ ├── docker-compose-laconicd.yml
|
||||
│ ├── docker-compose-prometheus-grafana.yml
|
||||
│ ├── docker-compose-test.yml
|
||||
│ ├── docker-compose-tx-spammer.yml
|
||||
│ ├── docker-compose-watcher-erc20.yml
|
||||
│ ├── docker-compose-watcher-erc721.yml
|
||||
│ ├── docker-compose-watcher-mobymask.yml
|
||||
│ └── docker-compose-watcher-uniswap-v3.yml
|
||||
├── config
|
||||
│ └── ipld-eth-server
|
||||
│ ├── fixturenet-eth
|
||||
│ ├── fixturenet-laconicd
|
||||
│ ├── ipld-eth-beacon-indexer
|
||||
│ ├── ipld-eth-server
|
||||
│ ├── keycloak
|
||||
│ ├── postgresql
|
||||
│ ├── tx-spammer
|
||||
│ ├── watcher-erc20
|
||||
│ ├── watcher-erc721
|
||||
│ ├── watcher-mobymask
|
||||
│ └── watcher-uniswap-v3
|
||||
├── container-build
|
||||
│ ├── cerc-builder-js
|
||||
│ ├── cerc-eth-probe
|
||||
│ ├── cerc-eth-statediff-fill-service
|
||||
│ ├── cerc-eth-statediff-service
|
||||
│ ├── cerc-fixturenet-eth-geth
|
||||
│ ├── cerc-fixturenet-eth-lighthouse
|
||||
│ ├── cerc-go-ethereum
|
||||
│ ├── cerc-go-ethereum-foundry
|
||||
│ ├── cerc-ipld-eth-beacon-db
|
||||
│ ├── cerc-ipld-eth-beacon-indexer
|
||||
│ ├── cerc-ipld-eth-db
|
||||
│ ├── cerc-ipld-eth-server
|
||||
│ ├── cerc-keycloak
|
||||
│ ├── cerc-laconic-registry-cli
|
||||
│ ├── cerc-laconicd
|
||||
│ ├── cerc-lighthouse
|
||||
│ └── cerc-test-contract
|
||||
├── container-image-list.txt
|
||||
├── repository-list.txt
|
||||
│ ├── cerc-test-container
|
||||
│ ├── cerc-test-contract
|
||||
│ ├── cerc-tx-spammer
|
||||
│ ├── cerc-uniswap-v3-info
|
||||
│ ├── cerc-watcher-erc20
|
||||
│ ├── cerc-watcher-erc721
|
||||
│ ├── cerc-watcher-mobymask
|
||||
│ ├── cerc-watcher-uniswap-v3
|
||||
└── stacks
|
||||
├── erc20
|
||||
├── erc721
|
||||
├── fixturenet-eth
|
||||
├── fixturenet-laconicd
|
||||
├── mobymask
|
||||
└── uniswap-v3
|
||||
```
|
||||
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: publish_shiv_package_github.sh <major> <minor> <patch>
|
||||
# Uses this script package to publish a new release:
|
||||
# https://github.com/cerc-io/github-release-api
|
||||
# User must define: CERC_GH_RELEASE_SCRIPTS_DIR
|
||||
# pointing to the location of that cloned repository
|
||||
# e.g.
|
||||
# cd ~/projects
|
||||
# git clone https://github.com/cerc-io/github-release-api
|
||||
# cd ./stack-orchestrator
|
||||
# export CERC_GH_RELEASE_SCRIPTS_DIR=~/projects/github-release-api
|
||||
# ./scripts/publish_shiv_package_github.sh
|
||||
# In addition, a valid GitHub token must be defined in
|
||||
# CERC_PACKAGE_RELEASE_GITHUB_TOKEN
|
||||
if [[ -z "${CERC_PACKAGE_RELEASE_GITHUB_TOKEN}" ]]; then
|
||||
echo "CERC_PACKAGE_RELEASE_GITHUB_TOKEN is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
# TODO: check args and env vars
|
||||
major=$1
|
||||
minor=$2
|
||||
patch=$3
|
||||
export PATH=$CERC_GH_RELEASE_SCRIPTS_DIR:$PATH
|
||||
github_org="cerc-io"
|
||||
github_repository="stack-orchestrator"
|
||||
latest_package=$(ls -1t ./package/* | head -1)
|
||||
uploaded_package="./package/laconic-so"
|
||||
# Remove any old package
|
||||
rm ${uploaded_package}
|
||||
cp ${latest_package} ${uploaded_package}
|
||||
github_release_manager.sh \
|
||||
-l notused -t ${CERC_PACKAGE_RELEASE_GITHUB_TOKEN} \
|
||||
-o ${github_org} -r ${github_repository} \
|
||||
-d v${major}.${minor}.${patch} \
|
||||
-c create
|
||||
github_release_manager.sh \
|
||||
-l notused -t ${CERC_PACKAGE_RELEASE_GITHUB_TOKEN} \
|
||||
-o ${github_org} -r ${github_repository} \
|
||||
-d v${major}.${minor}.${patch} \
|
||||
-c upload ${uploaded_package}
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: tag_new_release.sh <major> <minor> <patch>
|
||||
# Uses this script package to tag a new release:
|
||||
# User must define: CERC_GH_RELEASE_SCRIPTS_DIR
|
||||
# pointing to the location of that cloned repository
|
||||
# e.g.
|
||||
# cd ~/projects
|
||||
# git clone https://github.com/cerc-io/github-release-api
|
||||
# cd ./stack-orchestrator
|
||||
# export CERC_GH_RELEASE_SCRIPTS_DIR=~/projects/github-release-api
|
||||
# ./scripts/publish_shiv_package_github.sh
|
||||
# TODO: check args and env vars
|
||||
major=$1
|
||||
minor=$2
|
||||
patch=$3
|
||||
export PATH=$CERC_GH_RELEASE_SCRIPTS_DIR:$PATH
|
||||
git_tag_manager.sh -M ${major} -m ${minor} -p ${patch} -t "Release ${major}.${minor}.${patch}"
|
||||
@@ -6,7 +6,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh:
|
||||
requirements = fh.read()
|
||||
setup(
|
||||
name='laconic-stack-orchestrator',
|
||||
version='1.0.9',
|
||||
version='1.0.12',
|
||||
author='Cerc',
|
||||
author_email='info@cerc.io',
|
||||
license='GNU Affero General Public License',
|
||||
|
||||
@@ -13,13 +13,15 @@ rm -rf $CERC_REPO_BASE_DIR
|
||||
mkdir -p $CERC_REPO_BASE_DIR
|
||||
# Pull an example small public repo to test we can pull a repo
|
||||
$TEST_TARGET_SO setup-repositories --include cerc-io/laconic-sdk
|
||||
# TODO: test building the repo into a container
|
||||
# Build two example containers
|
||||
# TODO:
|
||||
$TEST_TARGET_SO build-containers --include cerc/builder-js,cerc/test-container
|
||||
# Test pulling a stack
|
||||
$TEST_TARGET_SO --stack test setup-repositories
|
||||
# Test building the a stack container
|
||||
$TEST_TARGET_SO --stack test build-containers
|
||||
# Build one example containers
|
||||
$TEST_TARGET_SO build-containers --include cerc/builder-js
|
||||
# Deploy the test container
|
||||
$TEST_TARGET_SO deploy-system --include test up
|
||||
$TEST_TARGET_SO --stack test deploy-system up
|
||||
# TODO: test that we can use the deployed container somehow
|
||||
# Clean up
|
||||
$TEST_TARGET_SO deploy-system --include test down
|
||||
$TEST_TARGET_SO --stack test deploy-system down
|
||||
echo "Test passed"
|
||||
|
||||
Reference in New Issue
Block a user