Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/private_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-----BEGIN PRIVATE KEY-----
MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEA0RuIiBEhPUhVjYyZ
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private key 误提交?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是测试的 不是线上的 需要提交

Ng9IRFzjbSMNUIjaGhUwHIbVQS2jkdPcgkmdImKwmBv+6Pw0l0Fs5p4wZTlspaBN
5HwuXQIDAQABAkAG7u/G+zJr8sMLb3cBCN6vjZjo3Hmriu4YYU14FKxrfcWGTzc4
F2jiP+MTcNDR8NL171rvW8oWK/ciGJ1GOe4tAiEA+AbpONDM5DstShHzaa8bjzix
lUENOIp/TIH6+zatjysCIQDX1FerMmocfggfkGu0HvDqUPoBCBZk1S8TDh3MZRg0
lwIgXMFQ5POJPG05EbNG4aYf217rYpLyW8vHsZgGgX5ASAMCIDIo0GMiKVUL2Vl0
mANZeYYLYb7hoUq33OPh0P0StahrAiEAsJ5IjnPpCTfeV42AATwoYvOhM2NcSV/e
2UPKPXGV3bA=
-----END PRIVATE KEY-----
54 changes: 40 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,39 @@ jobs:
docker run --rm --name breeze_ci_mysql4623 -p 4623:3306 -d parabala/mysqlci_with_schema:v0.0.2
docker run --rm --name breeze_ci_mysql4624 -p 4624:3306 -d parabala/mysqlci_with_schema:v0.0.2
- name: Prepare Vintage_MC_Redis
run: docker run -d -v /home/runner/work/breeze:/data1/resource/breeze --net="host" --name breeze_github_ci hustfisher/breeze:githubci115
run: |
docker run -d \
-v /home/runner/work/breeze:/data1/resource/breeze \
-p 8080:8080 \
-p 13739:13739 \
-p 13740:13740 \
-p 13741:13741 \
-p 13742:13742 \
-p 56378:56378 \
-p 56379:56379 \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把--net="host" 改为逐个端口映射的目的是啥?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

环境有问题 host模式无法暴露端口了 我本地也这样 但是改完了github上还是有些端口有问题 后面再查

-p 56380:56380 \
-p 56381:56381 \
-p 56382:56382 \
-p 56383:56383 \
-p 56384:56384 \
-p 56385:56385 \
-p 56386:56386 \
-p 56387:56387 \
-p 56388:56388 \
-p 56389:56389 \
-p 56390:56390 \
-p 56391:56391 \
-p 56392:56392 \
-p 56393:56393 \
-p 8010:8010 \
-p 8011:8011 \
-p 8012:8012 \
-p 8013:8013 \
-p 8775:8775 \
-p 8776:8776 \
-p 8777:8777 \
-p 8778:8778 \
--name breeze_github_ci viciousstar/breeze:githubci120
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -42,7 +74,6 @@ jobs:
run: cargo build
- name: Check Vintage
run: |
docker ps -a
curl http://127.0.0.1:8080/config/cloud/redis/testbreeze/redismeshtest
curl http://127.0.0.1:8080/config/v1/cache.service.testbreeze.pool.yf/all
sleep 1
Expand Down Expand Up @@ -76,20 +107,12 @@ jobs:
- name: Check Status
run: |
sleep 6s
netstat -nat|grep LISTEN
#ps -aux|grep breeze
docker ps -a
docker inspect breeze_github_ci
netstat -natp|grep LISTEN
ls -all /home/runner/work/breeze/snapshot
ls -all /home/runner/work/breeze/socks
ls -all /home/runner/work/breeze/logs
tail -10 /home/runner/work/breeze/logs/log.file
tail -10 /home/runner/work/breeze/logs/breeze.log
#cat /home/runner/work/breeze/logs/log.file
#cat /home/runner/work/breeze/logs/breeze.log
#- name: Run cargo-tarpaulin
# uses: actions-rs/[email protected]
# with:
# version: "0.22.0"
# args: "--features=github_workflow --features=console-api -- --test-threads 1"
- name: Run unit tests
run: cargo test -p tests --features github_workflow -p endpoint
- name: wait until 2 mins
Expand Down Expand Up @@ -125,4 +148,7 @@ jobs:
if: failure()
run: |
cat /home/runner/work/breeze/logs/log.file
cat /home/runner/work/breeze/logs/breeze.log
- name: Output docker log
if: failure()
run: |
docker logs breeze_github_ci
39 changes: 36 additions & 3 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
brz_home="/data1/ci/breeze"
mkdir -p $brz_home

Expand All @@ -11,7 +11,39 @@ container_name=breeze_github_ci
docker ps -a | grep "$container_name" && docker rm -f "$container_name"


docker run --rm -d -v $brz_home:/data1/resource/breeze --net="host" --name "$container_name" parabala/breeze:githubci108
docker run --rm -d \
-v "$brz_home":/data1/resource/breeze \
-p 8080:8080 \
-p 13739:13739 \
-p 13740:13740 \
-p 13741:13741 \
-p 13742:13742 \
-p 56378:56378 \
-p 56379:56379 \
-p 56380:56380 \
-p 56381:56381 \
-p 56382:56382 \
-p 56383:56383 \
-p 56384:56384 \
-p 56385:56385 \
-p 56386:56386 \
-p 56387:56387 \
-p 56388:56388 \
-p 56389:56389 \
-p 56390:56390 \
-p 56391:56391 \
-p 56392:56392 \
-p 56393:56393 \
-p 8010:8010 \
-p 8011:8011 \
-p 8012:8012 \
-p 8013:8013 \
-p 8775:8775 \
-p 8776:8776 \
-p 8777:8777 \
-p 8778:8778 \
--name "$container_name" \
viciousstar/breeze:githubci120

# rm -rf $brz_home/*
mkdir -p $brz_home/logs
Expand All @@ -24,7 +56,7 @@ touch $brz_home/socks/127.0.0.1:8080+config+cloud+counterservice+testbreeze+mesh
touch $brz_home/socks/127.0.0.1:8080+config+cloud+phantom+testbreeze+phantomtest@phantom:9303@pt
touch $brz_home/socks/127.0.0.1:8080+config+cloud+kv+testbreeze+kvmeshtest@kv:3306@kv
touch $brz_home/socks/127.0.0.1:8080+config+cloud+vector+testbreeze+vectortest@vector:3308@vector

touch $brz_home/socks/127.0.0.1:8080+config+cloud+mq+testbreeze+mcqmeshtest_1@msgque:56815@mq

cargo build
nohup ./target/debug/agent --discovery vintage://127.0.0.1:8080 --snapshot $brz_home/snapshot --service-path $brz_home/socks --log-dir $brz_home/logs --port 9984 --metrics-probe 8.8.8.8:53 --log-level info --idc-path 127.0.0.1:8080/3/config/breeze/idc_region --key-path .github/workflows/private_key.pem > $brz_home/logs/log.file 2>&1 &
Expand All @@ -38,6 +70,7 @@ export mc=localhost:9301
export phantom=localhost:9303
export mysql=localhost:3306
export vector=localhost:3308
export mq=localhost:56815
export min_key=1
export max_key=10000
export socks_dir=$brz_home/socks
Expand Down
4 changes: 2 additions & 2 deletions discovery/src/dns/lookup.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{Ipv4Vec, Record};
pub(super) struct Lookup {}

use dns_lookup::{getaddrinfo, AddrInfoHints};
use dns_lookup::{AddrInfoHints, getaddrinfo};
use libc::SOCK_STREAM;

use std::net::IpAddr;
Expand Down Expand Up @@ -37,7 +37,7 @@ impl Lookup {
let ret = self.dns_lookup(host);
if ret.is_err() {
log::error!("Failed to lookup ip for {} err:{:?}", host, ret.err());
break;
continue;
}
let ips = ret.unwrap();
if r.refresh(ips) {
Expand Down
Loading