Skip to content

Commit

Permalink
Change to simple endpoint (#17)
Browse files Browse the repository at this point in the history
* change to test ci

* Change to single file

* Add Check CI

* Remove Report CI

* Update action title

* Remove protocol

* Remove report

* Add envoy test config

* Rename custom.yml to submit_rpc.yml
  • Loading branch information
fewensa authored Jul 10, 2023
1 parent 3dd1f49 commit 53ad3bf
Show file tree
Hide file tree
Showing 488 changed files with 155 additions and 2,253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ body:
- Crab
validations:
required: true
- type: input
id: rpc-http
attributes:
label: Http Endpoint
description: Http rpc endpoint
placeholder: ex. 100.100.100.100:9933
validations:
required: true
- type: input
id: rpc-ws
attributes:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
deploy-rpc:
name: Deploy rpc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install dependencies
env:
GOMPLATE_VERSION: 3.11.4
MILLER_VERSION: 6.7.0
run: |
BIN_PATH=$HOME/.local/bin
rm -rf ${BIN_PATH} || true
mkdir -p ${BIN_PATH}
# gomplate
curl -L -o ${BIN_PATH}/gomplate \
https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-amd64
# miller
curl -LO https://github.com/johnkerl/miller/releases/download/v${MILLER_VERSION}/miller-${MILLER_VERSION}-linux-amd64.tar.gz
tar -zxf miller-${MILLER_VERSION}-linux-amd64.tar.gz -C ./
mv miller-${MILLER_VERSION}-linux-amd64/mlr $BIN_PATH/
# set execute permission
chmod +x ${BIN_PATH}/gomplate
chmod +x ${BIN_PATH}/mlr
# clean
rm -rf miller-*
- name: Generate cds
run: scripts/generate-cds.sh

- name: Preview changes
env:
GITHUB_TOKEN: ${{ secrets.GH_TKN_DARWINIA }}
run: cat dist/cds.local.yaml
6 changes: 2 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
run: scripts/generate-cds.sh

- name: Trigger deploy
env:
GITHUB_TOKEN: ${{ secrets.GH_TKN_DARWINIA }}
run: |
MESSAGE="${{ github.event.head_commit.message }}"
jq -n \
Expand All @@ -57,7 +59,3 @@ jobs:
--repo=darwinia-network/ansible-playbooks \
--raw-field="changes=${MULTI_CHANGES}" \
--raw-field="message=[community-rpc]: ${MESSAGE}" \
# --raw-field="key=.resources[0].outlier_detection.interval" \
# --raw-field="value=4s"
env:
GITHUB_TOKEN: ${{ secrets.GH_TKN_DARWINIA }}
64 changes: 0 additions & 64 deletions .github/workflows/report.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ generated
*.dep.txt
*.log
*.local.*
*.env

package-lock.json
dist
4 changes: 2 additions & 2 deletions assets/cds.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- "@type": type.googleapis.com/envoy.config.cluster.v3.Cluster
name: cds_{{ (ds "schema").chain }}_rpc_{{ (ds "schema").protocol }}
name: cds_{{ (ds "schema").chain }}_rpc
connect_timeout: 10s
lb_policy: ROUND_ROBIN
type: STRICT_DNS
Expand All @@ -20,7 +20,7 @@
- start: 405
end: 406
load_assignment:
cluster_name: cds_{{ (ds "schema").chain }}_rpc_{{ (ds "schema").protocol }}
cluster_name: cds_{{ (ds "schema").chain }}_rpc
endpoints:
- lb_endpoints:
{{ range (ds "endpoints") }}
Expand Down
1 change: 1 addition & 0 deletions envoy/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PATH_CONF=/path/to/envoy/conf
18 changes: 18 additions & 0 deletions envoy/conf/envoy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
node:
cluster: cluster-1
id: envoy-instance-1

admin:
access_log_path: "/dev/stdout"
address:
socket_address:
address: 0.0.0.0
port_value: 15000

# 动态配置
dynamic_resources:
lds_config:
path: "/etc/envoy/lds.yaml"
cds_config:
path: "/etc/envoy/cds.local.yaml"

35 changes: 35 additions & 0 deletions envoy/conf/lds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.config.listener.v3.Listener
name: listener_0
address:
socket_address:
address: 0.0.0.0
port_value: 15001
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: auto
stat_prefix: ingress_http
access_log:
name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
path: /dev/stdout
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
upgrade_configs:
- upgrade_type: websocket
request_id_extension:
typed_config:
"@type": type.googleapis.com/envoy.extensions.request_id.uuid.v3.UuidRequestIdConfig
pack_trace_reason: false
use_request_id_for_trace_sampling: true
rds:
route_config_name: route_config_1
config_source:
path: /etc/envoy/rds.yaml
32 changes: 32 additions & 0 deletions envoy/conf/rds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.config.route.v3.RouteConfiguration
name: route_config_1
virtual_hosts:
- name: backend
domains:
- "*"
routes:
- match:
prefix: "/"
# headers:
# - name: ":authority"
# exact_match: "localhost"
route:
cluster: cds_crab_rpc
host_rewrite_literal: localhost
retry_policy:
retry_on: "5xx"
num_retries: 5

- match:
prefix: "/"
# headers:
# - name: ":authority"
# exact_match: "localhost"
route:
cluster: cds_darwinia_rpc
host_rewrite_literal: localhost
retry_policy:
retry_on: "5xx"
num_retries: 5
12 changes: 12 additions & 0 deletions envoy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:

envoy:
container_name: envoy
image: envoyproxy/envoy:v1.26-latest
network_mode: host
restart: always
volumes:
- /etc/localtime:/etc/localtime
- ${PATH_CONF}:/etc/envoy

File renamed without changes.
2 changes: 0 additions & 2 deletions provider/crab/http.csv

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions provider/darwinia/http.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-05-09/darwinia-1606.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-05-10/crab-0211.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-05-10/darwinia-0211.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-05-22/crab-1650.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-05-22/darwinia-1650.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-05-29/crab-0245.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-05-29/darwinia-0245.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/crab-0645.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/crab-0647.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/crab-0701.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-0709.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-0730.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-0821.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-0902.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-1018.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-1235.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-1416.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-1624.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-1821.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/crab-2018.csv

This file was deleted.

3 changes: 0 additions & 3 deletions report/2023-06-14/darwinia-0645.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/darwinia-0647.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/darwinia-0701.csv

This file was deleted.

5 changes: 0 additions & 5 deletions report/2023-06-14/darwinia-0709.csv

This file was deleted.

Loading

0 comments on commit 53ad3bf

Please sign in to comment.