Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monolithic Control Service #3652

Merged
merged 3 commits into from
Feb 5, 2020
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
16 changes: 0 additions & 16 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,3 @@ steps:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
- label: "Integration: end2end_integration"
command:
- bazel build //:scion //:scion-ci >/dev/null 2>&1
- tar -kxf bazel-bin/scion.tar -C bin --overwrite
- tar -kxf bazel-bin/scion-ci.tar -C bin --overwrite
- ./scion.sh topology -t --monolith
- ./scion.sh run && sleep 10
- ./bin/end2end_integration -log.console warn
artifact_paths:
- "artifacts.out/**/*"
timeout_in_minutes: 10
key: integration_tests_monolith
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
3 changes: 0 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ pkg_tar(
name = "scion",
package_dir = "",
srcs = [
"//go/beacon_srv:beacon_srv",
"//go/border:border",
"//go/cs:cs",
"//go/cert_srv:cert_srv",
"//go/godispatcher:godispatcher",
"//go/tools/logdog:logdog",
"//go/path_srv:path_srv",
"//go/sciond:sciond",
"//go/tools/scion-pki:scion-pki",
"//go/tools/scmp:scmp",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Notes about `topology/Default.topo`:

* `core` (optional): specify if this is a core AS or not (defaults to 'false').

* `beacon_servers`, `certificate_servers`, `path_servers`, (all optional):
* `control_servers` (optional):
number of such servers in a specific AS (override the default value 1).

* `links`: keys are `ISD_ID-AS_ID` (format also used for the keys of the JSON
Expand Down
12 changes: 1 addition & 11 deletions acceptance/br_child_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,7 @@
}
}
},
"PathService": {
"psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} }
},
"BeaconService": {
"bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} }
Expand Down
12 changes: 1 addition & 11 deletions acceptance/br_core_childIf_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,7 @@
}
}
},
"PathService": {
"core-psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} }
},
"BeaconService": {
"core-bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"core-csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} }
Expand Down
12 changes: 1 addition & 11 deletions acceptance/br_core_coreIf_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,7 @@
}
}
},
"PathService": {
"core-psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} }
},
"BeaconService": {
"core-bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"core-csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} }
Expand Down
12 changes: 1 addition & 11 deletions acceptance/br_core_multi_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,7 @@
}
}
},
"PathService": {
"core-psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} }
},
"BeaconService": {
"core-bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"core-csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} }
Expand Down
22 changes: 7 additions & 15 deletions acceptance/br_multi_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,17 @@
}
}
},
"BeaconService": {
"bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
"SIG": {
"sigA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 31014, "Addr": "192.168.0.51" } }
} },
"sigB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 31014, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} },
"csB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.72" } }
} }
},
"PathService": {
"psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} },
"psB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20055, "Addr": "192.168.0.51" } }
} }
}
}
2 changes: 1 addition & 1 deletion acceptance/br_multi_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COMMAND="${1:?}"
# This function is called from test_setup
set_veths() {
create_veth veth_int_host veth_int 192.168.0.11/24 f0:0d:ca:fe:00:01 \
192.168.0.12 192.168.0.13 192.168.0.14 192.168.0.51 192.168.0.61 192.168.0.71 192.168.0.72
192.168.0.12 192.168.0.13 192.168.0.14 192.168.0.51 192.168.0.61 192.168.0.71
create_veth veth_121_host veth_121 192.168.12.2/31 f0:0d:ca:fe:00:12 192.168.12.3
create_veth veth_131_host veth_131 192.168.13.2/31 f0:0d:ca:fe:00:13 192.168.13.3
create_veth veth_141_host veth_141 192.168.14.2/31 f0:0d:ca:fe:00:14 192.168.14.3
Expand Down
22 changes: 7 additions & 15 deletions acceptance/br_parent_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,17 @@
}
}
},
"BeaconService": {
"bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
"SIG": {
"sigA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 31014, "Addr": "192.168.0.51" } }
} },
"sigB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 31014, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} },
"csB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.72" } }
} }
},
"PathService": {
"psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} },
"psB": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20055, "Addr": "192.168.0.51" } }
} }
}
}
2 changes: 1 addition & 1 deletion acceptance/br_parent_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COMMAND="${1:?}"
# This function is called from test_setup
set_veths() {
create_veth veth_int_host veth_int 192.168.0.11/24 f0:0d:ca:fe:00:01 \
192.168.0.12 192.168.0.13 192.168.0.14 192.168.0.51 192.168.0.61 192.168.0.71 192.168.0.72
192.168.0.12 192.168.0.13 192.168.0.14 192.168.0.51 192.168.0.61 192.168.0.71
create_veth veth_131_host veth_131 192.168.13.2/31 f0:0d:ca:fe:00:13 192.168.13.3
}

Expand Down
12 changes: 1 addition & 11 deletions acceptance/br_peer_acceptance/conf/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,7 @@
}
}
},
"PathService": {
"psA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20005, "Addr": "192.168.0.51" } }
} }
},
"BeaconService": {
"bsA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20006, "Addr": "192.168.0.61" } }
} }
},
"CertificateService": {
"ControlService": {
"csA": { "Addrs": {
"IPv4": { "Public": { "L4Port": 20007, "Addr": "192.168.0.71" } }
} }
Expand Down
14 changes: 7 additions & 7 deletions acceptance/bs_add_link_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ logger = logging.getLogger(__name__)

class Test(TestBase):
"""
Test that an interface can be added to the topology and the
beacon server starts beaconing on that interface.
Test that an interface can be added to the topology and the beacon server
starts beaconing on that interface.

In the setup phase, the tiny topology is started with the link between
1-ff00:0:110 and 1-ff00:0:111 missing from the topology of the beacon
servers.

In the run phase, we first check that the end2end connectivity is broken.
Then we set the topology containing the link and send a reload signal
to the BSes. After some time that allows for beacon propagation, the test
checks that end2end connectivity is established.
Then we set the topology containing the link and send a reload signal to the
control services. After some time that allows for beacon propagation, the
test checks that end2end connectivity is established.
"""


Expand All @@ -55,7 +55,7 @@ def topology_files() -> LocalPath:
Return the paths to all topology files for beacon servers in
AS 1-ff00:0:110 and 1-ff00:0:111.
"""
return local.path('gen/ISD1') // 'ASff00_0_11[0,1]/bs*/topology.json'
return local.path('gen/ISD1') // 'ASff00_0_11[0,1]/cs*/topology.json'


@Test.subcommand('setup')
Expand All @@ -69,7 +69,7 @@ class TestSetup(CmdBase):
self.scion.set_configs({
'logging.file.FlushInterval': 1,
'logging.file.Level': 'debug',
}, local.path('gen/ISD1') // '*/bs*/bs.toml')
}, local.path('gen/ISD1') // '*/cs*/cs.toml')
self.scion.run()
if not self.no_docker:
self.tools_dc('start', 'tester*')
Expand Down
2 changes: 1 addition & 1 deletion acceptance/cert_renewal_acceptance_disabled/test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CORE_IA_FILE="$(ia_file $CORE_IA)"

test_setup() {
set -e
./scion.sh topology -c $TEST_TOPOLOGY -d -t
./scion.sh topology -c $TEST_TOPOLOGY -d -t --database=sqlite
sed -i -e 's/Level = .*$/Level = "trace"/g' \
-e '/\[logging\.file\]/a FlushInterval = 1' \
-e '/\[cs\]/a AutomaticRenewal = true' \
Expand Down
4 changes: 1 addition & 3 deletions acceptance/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ collect_metrics() {

collect_elem_metrics 'BorderRouters' '30442' 'InternalAddrs.IPv4.PublicOverlay.Addr'
collect_elem_metrics 'SIG' '30456'
collect_elem_metrics 'BeaconService'
collect_elem_metrics 'CertificateService'
collect_elem_metrics 'PathService'
collect_elem_metrics 'ControlService'
}

#######################################
Expand Down
6 changes: 3 additions & 3 deletions acceptance/discovery_br_fetches_dynamic_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ test_run() {
sleep 3
check_connectivity "initial check"

log "Staring to serve dynamic topology with wrong BS address."
jq ".BeaconService[].Addrs.IPv4.Public.Addr = \"127.42.42.42\" | .Timestamp = $( date +%s) | .TTL = 7" $TOPO | sponge $DYNAMIC_FULL
log "Waiting for BS to issue revocation and link going down"
log "Staring to serve dynamic topology with wrong CS address."
jq ".ControlService[].Addrs.IPv4.Public.Addr = \"127.42.42.42\" | .Timestamp = $( date +%s) | .TTL = 7" $TOPO | sponge $DYNAMIC_FULL
log "Waiting for CS to issue revocation and link going down"
sleep 4
check_connectivity_broken "invalid beacon service address"

Expand Down
6 changes: 3 additions & 3 deletions acceptance/discovery_br_fetches_static_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ test_run() {
sleep 3
check_connectivity "initial check"

log "Staring to serve static topology with wrong BS address."
jq ".BeaconService[].Addrs.IPv4.Public.Addr = \"127.42.42.42\" | .Timestamp = $( date +%s)" $TOPO | sponge $STATIC_FULL
log "Waiting for BS to issue revocation and link going down"
log "Staring to serve static topology with wrong CS address."
jq ".ControlService[].Addrs.IPv4.Public.Addr = \"127.42.42.42\" | .Timestamp = $( date +%s)" $TOPO | sponge $STATIC_FULL
log "Waiting for CS to issue revocation and link going down"
sleep 4
check_connectivity_broken "invalid beacon service address"

Expand Down
4 changes: 1 addition & 3 deletions acceptance/discovery_infra_fetches_dynamic_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test_setup() {
set -e
base_setup

for cfg in gen/ISD1/AS$AS_FILE/*/{bs,cs,ps,sd}.toml; do
for cfg in gen/ISD1/AS$AS_FILE/*/{cs,sd}.toml; do
set_log_lvl "$cfg"
set_interval "$cfg" "dynamic"
done
Expand All @@ -31,9 +31,7 @@ test_run() {
check_file "dynamic"

sleep 7
check_logs "bs$IA_FILE-1"
check_logs "cs$IA_FILE-1"
check_logs "ps$IA_FILE-1"
check_logs "sd$IA_FILE"

log "Checking fail action."
Expand Down
6 changes: 1 addition & 5 deletions acceptance/discovery_infra_fetches_static_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test_setup() {
set -e
base_setup

for elem in gen/ISD1/AS$AS_FILE/{bs,cs,ps,endhost}*; do
for elem in gen/ISD1/AS$AS_FILE/{cs,endhost}*; do
for cfg in $elem/*.toml; do
set_log_lvl "$cfg"
set_interval "$cfg" "static"
Expand All @@ -36,14 +36,10 @@ test_run() {
check_file "static"

sleep 3
check_logs "bs$IA_FILE-1"
check_logs "cs$IA_FILE-1"
check_logs "ps$IA_FILE-1"
check_logs "sd$IA_FILE"

check_diff "bs$IA_FILE-1"
check_diff "cs$IA_FILE-1"
check_diff "ps$IA_FILE-1"
check_diff "sd$IA_FILE"

log "Checking fail action."
Expand Down
14 changes: 5 additions & 9 deletions acceptance/discovery_util/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ base_setup() {
export DISC_DIR="$( grep -oh '\/.*\/gen' gen/scion-dc.yml | grep -v ':' -m 1 )/discovery_acceptance"

# Get the network AS 1-ff00_0_111 is on. And replace it in the template.
local network=$(awk '/ scion_disp_1-ff00_0_111:/,/ volumes/ {if (f=="networks:") {gsub(":", "",$1); print $1}} {f=$1}' gen/scion-dc.yml)
local network=$(awk '/ scion_disp_cs1-ff00_0_111-1:/,/ volumes/ {if (f=="networks:") {gsub(":", "",$1); print $1}} {f=$1}' gen/scion-dc.yml)
# Modify docker compose file to contain mock discovery service.
sed -e "s/REPLACE_NETWORK/$network/" "$UTIL_PATH/dc.tmpl" | sed -i -e "/services:/r /dev/stdin" "gen/scion-dc.yml"
}
Expand Down Expand Up @@ -74,24 +74,20 @@ check_file() {
check_infra_fail_action() {
stop_mock_ds
# Check that services continue if fail action is not set.
for cfg in gen/ISD1/AS$AS_FILE/*/{bs,cs,ps,sd}.toml; do
for cfg in gen/ISD1/AS$AS_FILE/*/{cs,sd}.toml; do
set_connect "$cfg" "$1" "3s"
done
./tools/dc scion restart "scion_bs$IA_FILE-1" "scion_ps$IA_FILE-1" "scion_cs$IA_FILE-1" "scion_sd$IA_FILE"
./tools/dc scion restart "scion_cs$IA_FILE-1" "scion_sd$IA_FILE"
sleep 10
check_running "bs$IA_FILE-1" || fail "Error: bs$IA_FILE-1 not running"
check_running "cs$IA_FILE-1" || fail "Error: cs$IA_FILE-1 not running"
check_running "ps$IA_FILE-1" || fail "Error: ps$IA_FILE-1 not running"
check_running "sd$IA_FILE" || fail "Error: sd$IA_FILE not running"

# Check that services exit if fail action is fatal
for cfg in gen/ISD1/AS$AS_FILE/*/{bs,cs,ps,sd}.toml; do
for cfg in gen/ISD1/AS$AS_FILE/*/{cs,sd}.toml; do
set_fail_action "$cfg" "$1" "Fatal"
done
./tools/dc scion restart "scion_bs$IA_FILE-1" "scion_ps$IA_FILE-1" "scion_cs$IA_FILE-1" "scion_sd$IA_FILE"
./tools/dc scion restart "scion_cs$IA_FILE-1" "scion_sd$IA_FILE"
sleep 10
check_not_running "bs$IA_FILE-1" || fail "Error: bs$IA_FILE-1 still running"
check_not_running "ps$IA_FILE-1" || fail "Error: ps$IA_FILE-1 still running"
check_not_running "cs$IA_FILE-1" || fail "Error: cs$IA_FILE-1 still running"
check_not_running "sd$IA_FILE" || fail "Error: sd$IA_FILE still running"
}
Expand Down
2 changes: 1 addition & 1 deletion acceptance/reconnecting_acceptance/test
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ print_help() {
execute only the setup phase.
$PROGRAM run
execute only the run phase.
$PROGRAM teardown
$PROGRAM teardown
execute only the teardown phase.
_EOF
}
Expand Down
Loading