forked from cerc-io/stack-orchestrator
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b94cfb4de8 | ||
|
|
ed4352911d | ||
|
|
e5c18ba77a | ||
|
|
5dda2303d3 | ||
|
|
1a5844af7a | ||
|
|
5a69bf471b | ||
|
|
7a5834a021 | ||
|
|
70b7476318 | ||
|
|
8b12dec75b |
@@ -34,7 +34,7 @@ Ensure that the following are already installed:
|
||||
1. Download the latest release from [this page](https://github.com/cerc-io/stack-orchestrator/tags), into a suitable directory (e.g. `~/bin`):
|
||||
```
|
||||
$ cd ~/bin
|
||||
$ curl https://github.com/cerc-io/stack-orchestrator/releases/download/v1.0.0-alpha/laconic-so
|
||||
$ curl https://github.com/cerc-io/stack-orchestrator/releases/download/v1.0.2-alpha/laconic-so
|
||||
```
|
||||
1. Ensure `laconic-so` is on the `PATH`
|
||||
1. Verify operation:
|
||||
|
||||
@@ -25,6 +25,7 @@ import sys
|
||||
from decouple import config
|
||||
import subprocess
|
||||
import click
|
||||
import pkg_resources
|
||||
from .util import include_exclude_check
|
||||
|
||||
# TODO: find a place for this
|
||||
@@ -55,8 +56,8 @@ def command(ctx, include, exclude):
|
||||
if not os.path.isdir(dev_root_path):
|
||||
print('Dev root directory doesn\'t exist, creating')
|
||||
|
||||
with open("container-image-list.txt") as container_list_file:
|
||||
containers = container_list_file.read().splitlines()
|
||||
with pkg_resources.resource_stream(__name__, "data/container-image-list.txt") as container_list_file:
|
||||
containers = container_list_file.read().decode().splitlines()
|
||||
|
||||
if verbose:
|
||||
print(f'Containers: {containers}')
|
||||
|
||||
@@ -20,6 +20,7 @@ import os
|
||||
import sys
|
||||
from python_on_whales import DockerClient
|
||||
import click
|
||||
import pkg_resources
|
||||
from .util import include_exclude_check
|
||||
|
||||
|
||||
@@ -48,11 +49,11 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
if verbose:
|
||||
print(f"Using cluster name: {cluster}")
|
||||
|
||||
with open("pod-list.txt") as pod_list_file:
|
||||
pods = pod_list_file.read().splitlines()
|
||||
with pkg_resources.resource_stream(__name__, "data/pod-list.txt") as pod_list_file:
|
||||
pods = pod_list_file.read().decode().splitlines()
|
||||
|
||||
if verbose:
|
||||
print(f'Pods: {pods}')
|
||||
print(f"Pods: {pods}")
|
||||
|
||||
# Construct a docker compose command suitable for our purpose
|
||||
|
||||
|
||||
+15
-11
@@ -22,6 +22,7 @@ from decouple import config
|
||||
import git
|
||||
from tqdm import tqdm
|
||||
import click
|
||||
import pkg_resources
|
||||
from .util import include_exclude_check
|
||||
|
||||
|
||||
@@ -52,11 +53,12 @@ def is_git_repo(path):
|
||||
@click.command()
|
||||
@click.option("--include", help="only clone these repositories")
|
||||
@click.option("--exclude", help="don\'t clone these repositories")
|
||||
@click.option('--git-ssh', is_flag=True, default=False)
|
||||
@click.option('--check-only', is_flag=True, default=False)
|
||||
@click.option('--pull', is_flag=True, default=False)
|
||||
@click.option('--branches-file', help="checkout branches specified in this file")
|
||||
@click.pass_context
|
||||
def command(ctx, include, exclude, check_only, pull, branches_file):
|
||||
def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file):
|
||||
'''git clone the set of repositories required to build the complete system from source'''
|
||||
|
||||
quiet = ctx.obj.quiet
|
||||
@@ -77,23 +79,23 @@ def command(ctx, include, exclude, check_only, pull, branches_file):
|
||||
|
||||
if local_stack:
|
||||
dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")]
|
||||
print(f'Local stack dev_root_path (CERC_REPO_BASE_DIR) overridden to: {dev_root_path}')
|
||||
print(f"Local stack dev_root_path (CERC_REPO_BASE_DIR) overridden to: {dev_root_path}")
|
||||
else:
|
||||
dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc"))
|
||||
|
||||
if not quiet:
|
||||
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 quiet:
|
||||
print('Dev root directory doesn\'t exist, creating')
|
||||
os.makedirs(dev_root_path)
|
||||
|
||||
with open("repository-list.txt") as repository_list_file:
|
||||
all_repos = repository_list_file.read().splitlines()
|
||||
with pkg_resources.resource_stream(__name__, "data/repository-list.txt") as repository_list_file:
|
||||
all_repos = repository_list_file.read().decode().splitlines()
|
||||
|
||||
if verbose:
|
||||
print(f'Repos: {all_repos}')
|
||||
print(f"Repos: {all_repos}")
|
||||
|
||||
repos = []
|
||||
for repo in all_repos:
|
||||
@@ -104,23 +106,25 @@ def command(ctx, include, exclude, check_only, pull, branches_file):
|
||||
print(f"Excluding: {repo}")
|
||||
|
||||
def process_repo(repo):
|
||||
full_github_repo_path = f'git@github.com:{repo}'
|
||||
git_ssh_prefix = "git@github.com:"
|
||||
git_http_prefix = "https://github.com/"
|
||||
full_github_repo_path = f"{git_ssh_prefix if git_ssh else git_http_prefix}{repo}"
|
||||
repoName = repo.split("/")[-1]
|
||||
full_filesystem_repo_path = os.path.join(dev_root_path, repoName)
|
||||
is_present = os.path.isdir(full_filesystem_repo_path)
|
||||
if not quiet:
|
||||
present_text = f'already exists active branch: {git.Repo(full_filesystem_repo_path).active_branch}' if is_present \
|
||||
present_text = f"already exists active branch: {git.Repo(full_filesystem_repo_path).active_branch}" if is_present \
|
||||
else 'Needs to be fetched'
|
||||
print(f'Checking: {full_filesystem_repo_path}: {present_text}')
|
||||
print(f"Checking: {full_filesystem_repo_path}: {present_text}")
|
||||
# Quick check that it's actually a repo
|
||||
if is_present:
|
||||
if not is_git_repo(full_filesystem_repo_path):
|
||||
print(f'Error: {full_filesystem_repo_path} does not contain a valid git repository')
|
||||
print(f"Error: {full_filesystem_repo_path} does not contain a valid git repository")
|
||||
sys.exit(1)
|
||||
else:
|
||||
if pull:
|
||||
if verbose:
|
||||
print(f'Running git pull for {full_filesystem_repo_path}')
|
||||
print(f"Running git pull for {full_filesystem_repo_path}")
|
||||
if not check_only:
|
||||
git_repo = git.Repo(full_filesystem_repo_path)
|
||||
origin = git_repo.remotes.origin
|
||||
|
||||
@@ -18,6 +18,8 @@ setup(
|
||||
packages=find_packages(),
|
||||
install_requires=[requirements],
|
||||
python_requires='>=3.7',
|
||||
include_package_data=True,
|
||||
package_data={'': ['data/*.txt']},
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Operating System :: OS Independent",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Laconicd Fixturenet
|
||||
|
||||
Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#install)):
|
||||
Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#user-mode)):
|
||||
|
||||
## Clone required repositories
|
||||
```
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
The MobyMask watcher is a Laconic Network component that provides efficient access to MobyMask contract data from Ethereum, along with evidence allowing users to verify the correctness of that data. The watcher source code is available in [this repository](https://github.com/cerc-io/watcher-ts/tree/main/packages/mobymask-watcher) and a developer-oriented Docker Compose setup for the watcher can be found [here](https://github.com/cerc-io/mobymask-watcher). The watcher can be deployed automatically using the Laconic Stack Orchestrator tool as detailed below:
|
||||
|
||||
## Deploy the MobyMask Watcher
|
||||
The instructions below show how to deploy a MobyMask watcher using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#install)).
|
||||
The instructions below show how to deploy a MobyMask watcher using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#user-mode)).
|
||||
|
||||
This deployment expects that ipld-eth-server's endpoints are available on the local machine at http://ipld-eth-server.example.com:8083/graphql and http://ipld-eth-server.example.com:8082. More advanced configurations are supported by modifying the watcher's [config file](../../config/watcher-mobymask/mobymask-watcher.toml).
|
||||
## Clone required repositories
|
||||
|
||||
Reference in New Issue
Block a user