forked from cerc-io/stack-orchestrator
Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b13300ca81 | ||
|
|
6396de1ecf | ||
|
|
18a7e59a8a | ||
|
|
0a66b7e9d2 | ||
|
|
7edfa1bb29 | ||
|
|
8e184f509d | ||
|
|
5697a39640 | ||
|
|
df469786ca | ||
|
|
d315941f21 | ||
|
|
ae7a17cecd | ||
|
|
261b513d68 | ||
|
|
9278d09096 | ||
|
|
b8b83768d8 | ||
|
|
ddd2ea2724 | ||
|
|
787a5228ea | ||
|
|
2ea87a3a80 | ||
|
|
8669a822df | ||
|
|
738aa1907b | ||
|
|
4b1ca04620 | ||
|
|
48dc431704 | ||
|
|
2eee4d1fb2 | ||
|
|
8e5d0d6c58 | ||
|
|
9d9eb791d1 |
@@ -24,7 +24,7 @@ import os
|
|||||||
from decouple import config
|
from decouple import config
|
||||||
import subprocess
|
import subprocess
|
||||||
import click
|
import click
|
||||||
import importlib
|
import importlib.resources
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from .util import include_exclude_check
|
from .util import include_exclude_check
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ def command(ctx, include, exclude):
|
|||||||
# TODO: make this configurable
|
# TODO: make this configurable
|
||||||
container_build_env = {
|
container_build_env = {
|
||||||
"CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/",
|
"CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/",
|
||||||
"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"],
|
"CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default="<token-not-supplied>"),
|
||||||
"CERC_REPO_BASE_DIR": dev_root_path
|
"CERC_REPO_BASE_DIR": dev_root_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
import os
|
import os
|
||||||
from decouple import config
|
from decouple import config
|
||||||
import click
|
import click
|
||||||
import importlib
|
import importlib.resources
|
||||||
from python_on_whales import docker
|
from python_on_whales import docker
|
||||||
from .util import include_exclude_check
|
from .util import include_exclude_check
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ services:
|
|||||||
|
|
||||||
fixturenet-eth-geth-1:
|
fixturenet-eth-geth-1:
|
||||||
hostname: fixturenet-eth-geth-1
|
hostname: fixturenet-eth-geth-1
|
||||||
|
cap_add:
|
||||||
|
- SYS_PTRACE
|
||||||
|
environment:
|
||||||
|
CERC_REMOTE_DEBUG: "true"
|
||||||
|
CERC_RUN_STATEDIFF: "detect"
|
||||||
|
CERC_STATEDIFF_DB_NODE_ID: 1
|
||||||
env_file:
|
env_file:
|
||||||
- ../config/fixturenet-eth/fixturenet-eth.env
|
- ../config/fixturenet-eth/fixturenet-eth.env
|
||||||
image: cerc/fixturenet-eth-geth:local
|
image: cerc/fixturenet-eth-geth:local
|
||||||
@@ -27,12 +33,10 @@ services:
|
|||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
ports:
|
ports:
|
||||||
- "8545"
|
- "8545"
|
||||||
|
- "40000"
|
||||||
|
|
||||||
fixturenet-eth-geth-2:
|
fixturenet-eth-geth-2:
|
||||||
hostname: fixturenet-eth-geth-2
|
hostname: fixturenet-eth-geth-2
|
||||||
environment:
|
|
||||||
CERC_RUN_STATEDIFF: "detect"
|
|
||||||
CERC_STATEDIFF_DB_NODE_ID: 2
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-v", "localhost", "8545"]
|
test: ["CMD", "nc", "-v", "localhost", "8545"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ CERC_STATEDIFF_DB_NAME="cerc_testing"
|
|||||||
CERC_STATEDIFF_DB_USER="vdbm"
|
CERC_STATEDIFF_DB_USER="vdbm"
|
||||||
CERC_STATEDIFF_DB_PASSWORD="password"
|
CERC_STATEDIFF_DB_PASSWORD="password"
|
||||||
CERC_STATEDIFF_DB_GOOSE_MIN_VER=23
|
CERC_STATEDIFF_DB_GOOSE_MIN_VER=23
|
||||||
|
CERC_STATEDIFF_DB_LOG_STATEMENTS="false"
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||||
|
|
||||||
FROM cerc/go-ethereum:local
|
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
|
||||||
|
FROM golang:1.18-alpine as delve
|
||||||
|
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
||||||
|
|
||||||
|
FROM cerc/go-ethereum:local as geth
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
|
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
|
||||||
|
|
||||||
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
|
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
||||||
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
|
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
|
||||||
COPY --from=ethgen /apps /apps
|
COPY --from=ethgen /apps /apps
|
||||||
|
|
||||||
RUN cd /apps/el-gen && pip3 install -r requirements.txt
|
RUN cd /apps/el-gen && pip3 install -r requirements.txt
|
||||||
@@ -14,6 +21,7 @@ COPY run-el.sh /opt/testnet/run.sh
|
|||||||
|
|
||||||
RUN cd /opt/testnet && make genesis-el
|
RUN cd /opt/testnet && make genesis-el
|
||||||
|
|
||||||
|
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
|
||||||
RUN geth init /opt/testnet/build/el/geth.json && rm -f ~/.ethereum/geth/nodekey
|
RUN geth init /opt/testnet/build/el/geth.json && rm -f ~/.ethereum/geth/nodekey
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/testnet/run.sh"]
|
ENTRYPOINT ["/opt/testnet/run.sh"]
|
||||||
|
|||||||
@@ -9,13 +9,18 @@ cd /opt/testnet/build/el
|
|||||||
python3 -m http.server 9898 &
|
python3 -m http.server 9898 &
|
||||||
cd $HOME_DIR
|
cd $HOME_DIR
|
||||||
|
|
||||||
if [ "true" == "$RUN_BOOTNODE" ]; then
|
START_CMD="geth"
|
||||||
geth \
|
if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then
|
||||||
|
START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /usr/local/bin/geth --continue --"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "true" == "$RUN_BOOTNODE" ]; then
|
||||||
|
$START_CMD \
|
||||||
--nodekeyhex="${BOOTNODE_KEY}" \
|
--nodekeyhex="${BOOTNODE_KEY}" \
|
||||||
--nodiscover \
|
--nodiscover \
|
||||||
--ipcdisable \
|
--ipcdisable \
|
||||||
--networkid=${NETWORK_ID} \
|
--networkid=${NETWORK_ID} \
|
||||||
--netrestrict="${NETRESTRICT}" 2>&1 | tee /var/log/geth_bootnode.log
|
--netrestrict="${NETRESTRICT}"
|
||||||
else
|
else
|
||||||
cd /opt/testnet/accounts
|
cd /opt/testnet/accounts
|
||||||
./import_keys.sh
|
./import_keys.sh
|
||||||
@@ -56,17 +61,18 @@ else
|
|||||||
--statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \
|
--statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \
|
||||||
--statediff.db.port=$CERC_STATEDIFF_DB_PORT \
|
--statediff.db.port=$CERC_STATEDIFF_DB_PORT \
|
||||||
--statediff.db.user=$CERC_STATEDIFF_DB_USER \
|
--statediff.db.user=$CERC_STATEDIFF_DB_USER \
|
||||||
|
--statediff.db.logstatements=${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false} \
|
||||||
--statediff.waitforsync=true \
|
--statediff.waitforsync=true \
|
||||||
--statediff.writing=true"
|
--statediff.writing=true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
geth \
|
$START_CMD \
|
||||||
--bootnodes="${ENODE}" \
|
--bootnodes="${ENODE}" \
|
||||||
--allow-insecure-unlock \
|
--allow-insecure-unlock \
|
||||||
--http \
|
--http \
|
||||||
--http.addr="0.0.0.0" \
|
--http.addr="0.0.0.0" \
|
||||||
--http.vhosts="*" \
|
--http.vhosts="*" \
|
||||||
--http.api="eth,web3,net,admin,personal" \
|
--http.api="eth,web3,net,admin,personal,debug,statediff" \
|
||||||
--http.corsdomain="*" \
|
--http.corsdomain="*" \
|
||||||
--authrpc.addr="0.0.0.0" \
|
--authrpc.addr="0.0.0.0" \
|
||||||
--authrpc.vhosts="*" \
|
--authrpc.vhosts="*" \
|
||||||
@@ -79,6 +85,8 @@ else
|
|||||||
--syncmode=full \
|
--syncmode=full \
|
||||||
--mine \
|
--mine \
|
||||||
--miner.threads=1 \
|
--miner.threads=1 \
|
||||||
--verbosity=5 \
|
--metrics \
|
||||||
--miner.etherbase="${ETHERBASE}" ${STATEDIFF_OPTS} 2>&1 | tee /var/log/geth.log
|
--verbosity=${CERC_GETH_VERBOSITY:-3} \
|
||||||
|
--vmodule="${CERC_GETH_VMODULE:-statediff/*=5}" \
|
||||||
|
--miner.etherbase="${ETHERBASE}" ${STATEDIFF_OPTS}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
contract
|
contract
|
||||||
db
|
ipld-eth-db
|
||||||
eth-statediff-fill-service
|
eth-statediff-fill-service
|
||||||
go-ethereum-foundry
|
go-ethereum-foundry
|
||||||
ipld-eth-beacon-db
|
ipld-eth-beacon-db
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ cerc-io/ipld-eth-db
|
|||||||
cerc-io/go-ethereum
|
cerc-io/go-ethereum
|
||||||
cerc-io/ipld-eth-server
|
cerc-io/ipld-eth-server
|
||||||
cerc-io/eth-statediff-service
|
cerc-io/eth-statediff-service
|
||||||
vulcanize/eth-statediff-fill-service
|
cerc-io/eth-statediff-fill-service
|
||||||
vulcanize/ipld-eth-db-validator
|
cerc-io/ipld-eth-db-validator
|
||||||
cerc-io/ipld-eth-beacon-indexer
|
cerc-io/ipld-eth-beacon-indexer
|
||||||
cerc-io/ipld-eth-beacon-db
|
cerc-io/ipld-eth-beacon-db
|
||||||
cerc-io/laconicd
|
cerc-io/laconicd
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Instructions for deploying a local Laconic blockchain "fixturenet" for developme
|
|||||||
|
|
||||||
## Clone required repositories
|
## Clone required repositories
|
||||||
```
|
```
|
||||||
$ laconic-so setup-repositories --include cerc-io/laconicd,cerc-io/laconic-sdk,cerc-io/laconic-cns-cli
|
$ laconic-so setup-repositories --include cerc-io/laconicd,cerc-io/laconic-sdk,cerc-io/laconic-registry-cli
|
||||||
```
|
```
|
||||||
## Build the laconicd container
|
## Build the laconicd container
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ name: laconicd-fixturenet
|
|||||||
repos:
|
repos:
|
||||||
- cerc-io/laconicd
|
- cerc-io/laconicd
|
||||||
- cerc-io/laconic-sdk
|
- cerc-io/laconic-sdk
|
||||||
- cerc-io/laconic-cns-cli
|
- cerc-io/laconic-registry-cli
|
||||||
containers:
|
containers:
|
||||||
- cerc/laconicd
|
- cerc/laconicd
|
||||||
- cerc/laconic-cns-cli
|
- cerc/laconic-registry-cli
|
||||||
pods:
|
pods:
|
||||||
- fixturenet-laconicd
|
- fixturenet-laconicd
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# This file should be re-generated running: scripts/update-version-file.sh script
|
||||||
|
v1.0.7-alpha-7edfa1b
|
||||||
@@ -20,7 +20,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from python_on_whales import DockerClient
|
from python_on_whales import DockerClient
|
||||||
import click
|
import click
|
||||||
import importlib
|
import importlib.resources
|
||||||
|
from pathlib import Path
|
||||||
from .util import include_exclude_check
|
from .util import include_exclude_check
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from decouple import config
|
|||||||
import git
|
import git
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import click
|
import click
|
||||||
import importlib
|
import importlib.resources
|
||||||
from .util import include_exclude_check
|
from .util import include_exclude_check
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Copyright © 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
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
# 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 click
|
||||||
|
import importlib.resources
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.pass_context
|
||||||
|
def command(ctx):
|
||||||
|
'''print tool version'''
|
||||||
|
|
||||||
|
# See: https://stackoverflow.com/a/20885799/1701505
|
||||||
|
from . import data
|
||||||
|
with importlib.resources.open_text(data, "version.txt") as version_file:
|
||||||
|
# TODO: code better version that skips comment lines
|
||||||
|
version_string = version_file.read().splitlines()[1]
|
||||||
|
|
||||||
|
print(f"Version: {version_string}")
|
||||||
@@ -19,6 +19,7 @@ from app import setup_repositories
|
|||||||
from app import build_containers
|
from app import build_containers
|
||||||
from app import build_npms
|
from app import build_npms
|
||||||
from app import deploy_system
|
from app import deploy_system
|
||||||
|
from app import version
|
||||||
|
|
||||||
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
||||||
|
|
||||||
@@ -49,3 +50,4 @@ cli.add_command(setup_repositories.command, "setup-repositories")
|
|||||||
cli.add_command(build_containers.command, "build-containers")
|
cli.add_command(build_containers.command, "build-containers")
|
||||||
cli.add_command(build_npms.command, "build-npms")
|
cli.add_command(build_npms.command, "build-npms")
|
||||||
cli.add_command(deploy_system.command, "deploy-system")
|
cli.add_command(deploy_system.command, "deploy-system")
|
||||||
|
cli.add_command(version.command, "version")
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
# Builds the shiv "package" for distribution
|
||||||
|
mkdir -p ./package
|
||||||
|
version_string=$( ./scripts/update_version_file.sh)
|
||||||
|
shiv -c laconic-so -o package/laconic-so-${version_string} .
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
version_file_name=./app/data/version.txt
|
||||||
|
echo "# This file should be re-generated running: scripts/update-version-file.sh script" > $version_file_name
|
||||||
|
tag_string=$( git describe --tags --abbrev=0 )
|
||||||
|
commit_string=$( git rev-parse --short HEAD )
|
||||||
|
version_string=${tag_string}-${commit_string}
|
||||||
|
echo ${version_string} >> $version_file_name
|
||||||
|
echo ${version_string}
|
||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
# Basic simple test of stack-orchestrator functionality
|
||||||
|
echo "Running stack-orchestrator smoke test"
|
||||||
|
# Bit of a hack, test the most recent package
|
||||||
|
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
|
||||||
|
# Set a non-default repo dir
|
||||||
|
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
|
||||||
|
echo "Testing this package: $TEST_TARGET_SO"
|
||||||
|
echo "Test version command"
|
||||||
|
reported_version_string=$( $TEST_TARGET_SO version )
|
||||||
|
echo "Version reported is: ${reported_version_string}"
|
||||||
|
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
|
||||||
|
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
|
||||||
|
# Deploy the test container
|
||||||
|
$TEST_TARGET_SO deploy-system --include test up
|
||||||
|
# TODO: test that we can use the deployed container somehow
|
||||||
|
# Clean up
|
||||||
|
$TEST_TARGET_SO deploy-system --include test down
|
||||||
|
echo "Test passed"
|
||||||
Reference in New Issue
Block a user