Skip to content

Commit

Permalink
Cleanup PoC so goth is able to run both hybrid and old net
Browse files Browse the repository at this point in the history
  • Loading branch information
maaktweluit committed Nov 15, 2021
1 parent 15b6f41 commit 38dee3f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion goth/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _with_default(self, mapping: Mapping[str, object]):
PROXY_HOST = "proxy-nginx"

ROUTER_HOST = "router"
ROUTER_PORT = 7464
ROUTER_PORT = 7477
ROUTER_PROTOCOL = "udp"
ROUTER_BASE_URL = DefaultTemplate(
_BASE_URL_TEMPLATE,
Expand Down
47 changes: 47 additions & 0 deletions goth/default-assets/docker/docker-compose-hybrid-net.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "3.3"

services:

router:
image: yagna-goth
entrypoint: /usr/bin/ya-net-server
command: ["-a", "udp://0.0.0.0:7477"]

proxy-nginx:
# A service that runs `nginx` and routes API calls to
# the `mitmproxy` instance running as part of the test
# harness on the host machine
image: proxy-nginx
ports:
# Requests to ports 6001-6100 in proxy-nginx are forwarded
# to the MITM proxy started by the test runner, and further
# to yagna API port (usually 6000) in yagna containers:
# request to port 6001 is forwarded to (yagna API port in)
# the first yagna container, request to port 6002 -- to
# the second one, and so on.
# To make these ports available from Docker host (on some
# systems, Docker network may be unreachable from the host)
# we map them to ports 16001-16100 on the host.
- "16001-16100:6001-6100"

ethereum:
image: docker.pkg.github.com/golemfactory/gnt2/gnt2-docker-yagna:483c6f241edd
ports:
- "8545:8545"

zksync:
image: docker.pkg.github.com/golemfactory/yagna-zksync/yagna-zksync-mock:fddc527d2bf1
ports:
- "3030:3030"
environment:
- WEB3_PROVIDER_URI=http://ethereum:8545
depends_on:
- ethereum

networks:
default:
ipam:
config:
# Fix the IP address range to ensure the host machine
# is reachable at the fixed address 172.19.0.1
- subnet: 172.19.0.0/16
4 changes: 2 additions & 2 deletions goth/default-assets/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:

router:
image: yagna-goth
entrypoint: /usr/bin/ya-net-server
command: ["-a", "udp://0.0.0.0:7464"]
entrypoint: /usr/bin/ya-sb-router
command: ["-l", "tcp://0.0.0.0:7477"]

proxy-nginx:
# A service that runs `nginx` and routes API calls to
Expand Down
2 changes: 2 additions & 0 deletions goth/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def node_environment(
"""Construct an environment for executing commands in a yagna docker container."""

daemon_env = {
# TODO: Remove old net
"CENTRAL_NET_HOST": f"{ROUTER_HOST}:{ROUTER_PORT}",
"NET_RELAY_HOST": f"{ROUTER_HOST}:{ROUTER_PORT}",
"GSB_URL": YAGNA_BUS_URL.substitute(host="0.0.0.0"),
"IDLE_AGREEMENT_TIMEOUT": "600s",
Expand Down
1 change: 1 addition & 0 deletions goth/runner/container/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
}

DEB_RELEASE_REPOS = [
"ya-service-bus",
"ya-relay",
"ya-runtime-wasi",
"ya-runtime-vm",
Expand Down

0 comments on commit 38dee3f

Please sign in to comment.