Skip to content

Commit

Permalink
add envoy
Browse files Browse the repository at this point in the history
  • Loading branch information
reliveyy committed Jun 26, 2020
1 parent 7a25aa3 commit 4364820
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
3 changes: 3 additions & 0 deletions images/envoy/latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM envoyproxy/envoy:v1.14.1
COPY envoy.yaml /etc/envoy/envoy.yaml
CMD ["envoy", "-c", "/etc/envoy/envoy.yaml", "-l", "trace"]
45 changes: 45 additions & 0 deletions images/envoy/latest/envoy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9901 }

static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 9090 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" }
route:
cluster: xud_service
max_grpc_timeout: 0s
cors:
allow_origin_string_match:
- prefix: "*"
allow_methods: GET, PUT, DELETE, POST, OPTIONS
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
max_age: "1728000"
expose_headers: custom-header-1,grpc-status,grpc-message
http_filters:
- name: envoy.grpc_web
- name: envoy.cors
- name: envoy.router
clusters:
- name: xud_service
connect_timeout: 0.25s
type: strict_dns
http2_protocol_options: {}
lb_policy: round_robin
# win/mac hosts: Use address: host.docker.internal instead of address: localhost in the line below
hosts: [{ socket_address: { address: xud, port_value: 28885 }}]
11 changes: 9 additions & 2 deletions images/utils/launcher/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,19 +391,26 @@ def update_lndltc(self, parsed):
self.update_ports(node, parsed)

def update_connext(self, parsed):
"""Update Connext related configurations from parsed TOML raiden section
"""Update Connext related configurations from parsed TOML connext section
:param parsed: Parsed raiden TOML section
"""
node = self.nodes["connext"]
self.update_ports(node, parsed)

def update_webui(self, parsed):
"""Update Connext related configurations from parsed TOML raiden section
"""Update webui related configurations from parsed TOML webui section
:param parsed: Parsed raiden TOML section
"""
node = self.nodes.get("webui", None)
self.update_ports(node, parsed)

def update_envoy(self, parsed):
"""Update envoy related configurations from parsed TOML envoy section
:param parsed: Parsed raiden TOML section
"""
node = self.nodes.get("envoy", None)
self.update_ports(node, parsed)

def update_raiden(self, parsed):
"""Update raiden related configurations from parsed TOML raiden section
:param parsed: Parsed raiden TOML section
Expand Down
9 changes: 9 additions & 0 deletions images/utils/launcher/config/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ def __eq__(self, other):
"mode": "native",
"preserve_config": False,
"use_local_image": False,
},
"envoy": {
"name": "envoy",
"image": "exchangeunion/envoy:latest",
"volumes": [],
"ports": [PortPublish("9090")],
"mode": "native",
"preserve_config": False,
"use_local_image": False,
}
},
"testnet": {
Expand Down
1 change: 1 addition & 0 deletions images/utils/launcher/node/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .image import Image, ImageManager
from .lnd import Lndbtc, Lndltc
from .webui import Webui
from .envoy import Envoy
from .xud import Xud, XudApiError
from ..config import Config
from ..errors import FatalError
Expand Down
9 changes: 9 additions & 0 deletions images/utils/launcher/node/envoy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .base import Node


class Envoy(Node):
def __init__(self, name, ctx):
super().__init__(name, ctx)

def status(self):
return "Ready"
3 changes: 0 additions & 3 deletions images/utils/launcher/node/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ class Webui(Node):
def __init__(self, name, ctx):
super().__init__(name, ctx)

self._cli = None
self.api = None

def status(self):
return "Ready"

0 comments on commit 4364820

Please sign in to comment.