forked from cerc-io/stack-orchestrator
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c26f8552e1 | ||
|
|
8352893d92 | ||
|
|
a92cabcb39 | ||
|
|
f841f8a2de | ||
|
|
7f652708bb | ||
|
|
c769fce491 | ||
|
|
02335795fb | ||
|
|
c717fd8a59 | ||
|
|
0de2db7e90 | ||
|
|
92f325a09b |
@@ -69,9 +69,3 @@ class package_registry_stack(base_stack):
|
|||||||
|
|
||||||
def get_url(self):
|
def get_url(self):
|
||||||
return self.url
|
return self.url
|
||||||
|
|
||||||
# Temporary helper functions while we figure out a good interface to the stack deploy code
|
|
||||||
|
|
||||||
|
|
||||||
def _get_stack_mapped_port(stack, service, exposed_port):
|
|
||||||
return 3000
|
|
||||||
|
|||||||
+22
-3
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from shutil import rmtree, copytree
|
||||||
from decouple import config
|
from decouple import config
|
||||||
import click
|
import click
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
@@ -65,11 +66,17 @@ def command(ctx, include, exclude):
|
|||||||
else:
|
else:
|
||||||
dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc"))
|
dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc"))
|
||||||
|
|
||||||
if not quiet:
|
build_root_path = os.path.join(dev_root_path, "build-trees")
|
||||||
|
|
||||||
|
if verbose:
|
||||||
print(f'Dev Root is: {dev_root_path}')
|
print(f'Dev Root is: {dev_root_path}')
|
||||||
|
|
||||||
if not os.path.isdir(dev_root_path):
|
if not os.path.isdir(dev_root_path):
|
||||||
print('Dev root directory doesn\'t exist, creating')
|
print('Dev root directory doesn\'t exist, creating')
|
||||||
|
os.makedirs(dev_root_path)
|
||||||
|
if not os.path.isdir(dev_root_path):
|
||||||
|
print('Build root directory doesn\'t exist, creating')
|
||||||
|
os.makedirs(build_root_path)
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/20885799/1701505
|
# See: https://stackoverflow.com/a/20885799/1701505
|
||||||
from . import data
|
from . import data
|
||||||
@@ -92,7 +99,19 @@ def command(ctx, include, exclude):
|
|||||||
print(f"Building npm package: {package}")
|
print(f"Building npm package: {package}")
|
||||||
repo_dir = package
|
repo_dir = package
|
||||||
repo_full_path = os.path.join(dev_root_path, repo_dir)
|
repo_full_path = os.path.join(dev_root_path, repo_dir)
|
||||||
# TODO: make the npm registry url configurable.
|
# Copy the repo and build that to avoid propagating JS tooling file changes back into the cloned repo
|
||||||
|
repo_copy_path = os.path.join(build_root_path, repo_dir)
|
||||||
|
# First delete any old build tree
|
||||||
|
if os.path.isdir(repo_copy_path):
|
||||||
|
if verbose:
|
||||||
|
print(f"Deleting old build tree: {repo_copy_path}")
|
||||||
|
if not dry_run:
|
||||||
|
rmtree(repo_copy_path)
|
||||||
|
# Now copy the repo into the build tree location
|
||||||
|
if verbose:
|
||||||
|
print(f"Copying build tree from: {repo_full_path} to: {repo_copy_path}")
|
||||||
|
if not dry_run:
|
||||||
|
copytree(repo_full_path, repo_copy_path)
|
||||||
build_command = ["sh", "-c", f"cd /workspace && build-npm-package-local-dependencies.sh {npm_registry_url}"]
|
build_command = ["sh", "-c", f"cd /workspace && build-npm-package-local-dependencies.sh {npm_registry_url}"]
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
if verbose:
|
if verbose:
|
||||||
@@ -107,7 +126,7 @@ def command(ctx, include, exclude):
|
|||||||
envs=envs,
|
envs=envs,
|
||||||
# TODO: detect this host name in npm_registry_url rather than hard-wiring it
|
# TODO: detect this host name in npm_registry_url rather than hard-wiring it
|
||||||
add_hosts=[("gitea.local", "host-gateway")],
|
add_hosts=[("gitea.local", "host-gateway")],
|
||||||
volumes=[(repo_full_path, "/workspace")],
|
volumes=[(repo_copy_path, "/workspace")],
|
||||||
command=build_command
|
command=build_command
|
||||||
)
|
)
|
||||||
# Note that although the docs say that build_result should contain
|
# Note that although the docs say that build_result should contain
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
version: "3.2"
|
||||||
|
# See: https://docs.ipfs.tech/install/run-ipfs-inside-docker/#set-up
|
||||||
|
services:
|
||||||
|
ipfs:
|
||||||
|
image: ipfs/kubo:master-2023-02-20-714a968
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./ipfs/import:/import
|
||||||
|
- ./ipfs/data:/data/ipfs
|
||||||
|
ports:
|
||||||
|
- "8080"
|
||||||
|
- "4001"
|
||||||
|
- "5001"
|
||||||
@@ -18,3 +18,4 @@ test
|
|||||||
eth-probe
|
eth-probe
|
||||||
keycloak
|
keycloak
|
||||||
tx-spammer
|
tx-spammer
|
||||||
|
kubo
|
||||||
|
|||||||
@@ -6,23 +6,23 @@ Instructions to deploy a local ERC721 watcher stack (core + watcher) for demonst
|
|||||||
|
|
||||||
* Clone / pull required repositories:
|
* Clone / pull required repositories:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic-so setup-repositories --include cerc-io/go-ethereum,cerc-io/ipld-eth-db,cerc-io/ipld-eth-server,cerc-io/watcher-ts --pull
|
laconic-so --stack erc721 setup-repositories
|
||||||
```
|
```
|
||||||
|
|
||||||
* Build the core and watcher container images:
|
* Build the core and watcher container images:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic-so build-containers --include cerc/go-ethereum,cerc/go-ethereum-foundry,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/watcher-erc721
|
laconic-so --stack erc721 build-containers
|
||||||
```
|
```
|
||||||
|
|
||||||
This should create the required docker images in the local image registry.
|
This should create the required docker images in the local image registry.
|
||||||
|
|
||||||
* Deploy the stack:
|
* Deploy the stack:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic-so deploy-system --include db,go-ethereum-foundry,ipld-eth-server,watcher-erc721 up
|
laconic-so --stack erc721 deploy-system up
|
||||||
```
|
```
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
@@ -209,6 +209,6 @@ Instructions to deploy a local ERC721 watcher stack (core + watcher) for demonst
|
|||||||
|
|
||||||
* To stop all the services running in background:
|
* To stop all the services running in background:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic-so deploy-system --include db,go-ethereum-foundry,ipld-eth-server,watcher-erc721 down
|
laconic-so --stack erc721 deploy-system down
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# This file should be re-generated running: scripts/update-version-file.sh script
|
# This file should be re-generated running: scripts/update-version-file.sh script
|
||||||
v1.0.19-10f2fba
|
v1.0.20-6c1bedc
|
||||||
|
|||||||
Reference in New Issue
Block a user