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

2024 changes from ETH + Restart script #1

Open
wants to merge 4 commits into
base: commnet24
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion platform/cleanup/hard_reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ovs-vsctl emer-reset

# Delete virtual interfaces except for known system interfaces.
for n in $(ip -o link show | awk -F': ' '{print $2}'); do
if [[ ! $n =~ ^(en|lo|eth|docker0|virbr0) ]]; then
if [[ ! $n =~ ^(en|lo|eth|docker0|virbr0|bond0) ]]; then
ip link delete $(echo $n | cut -d'@' -f 1)
fi
done
Expand Down
2 changes: 1 addition & 1 deletion platform/config/aslevel_links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@
112 CAIR Peer 141 None Peer 1mbit 2.5ms 50ms 1,3,5,7,9,11,13,102,104,106,108,110,114
113 ADDI Peer 114 ADDI Peer 1mbit 2.5ms 50ms 179.113.114.0/24
113 ACCR Peer 146 None Peer 1mbit 2.5ms 50ms 82,84,86,88,90,92,94
114 ACCR Peer 141 None Peer 1mbit 2.5ms 50ms 1,3,5,7,9,11,13
114 ACCR Peer 141 None Peer 1mbit 2.5ms 50ms 1,3,5,7,9,11,13
2 changes: 1 addition & 1 deletion platform/config/aslevel_links_students.txt
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,4 @@
113 ACCR Peer 146 None Peer 180.146.0.113/24
146 None Peer 113 ACCR Peer 180.146.0.146/24
114 ACCR Peer 141 None Peer 180.141.0.114/24
141 None Peer 114 ACCR Peer 180.141.0.141/24
141 None Peer 114 ACCR Peer 180.141.0.141/24
2 changes: 1 addition & 1 deletion platform/config/l2_switches.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
L2N S1 ACCR 11:11:11:11:11:11 1
L2S S2 CAPE 22:22:22:22:22:22 2
L2S S3 N/A 33:33:33:33:33:33 3
L2S S3 N/A 33:33:33:33:33:33 3
4 changes: 2 additions & 2 deletions platform/config/l3_routers.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CAIR N/A routinator:miniinterneteth/d_routinator vtysh
CAIR N/A host:miniinterneteth/d_host vtysh
KHAR MATRIX_TARGET host:miniinterneteth/d_host vtysh
ADDI N/A host:miniinterneteth/d_host vtysh
NAIR MEASUREMENT host:miniinterneteth/d_host vtysh
CAPE N/A L2-L2S:miniinterneteth/d_host linux
LUAN MATRIX host:miniinterneteth/d_host vtysh
KINS DNS host:miniinterneteth/d_host vtysh
ACCR N/A L2-L2N:miniinterneteth/d_host linux
ACCR N/A L2-L2N:miniinterneteth/d_host linux
2 changes: 1 addition & 1 deletion platform/config/l3_routers_krill.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CAIR MATRIX_TARGET routinator:miniinterneteth/d_routinator vtysh ALL
CAIR DNS krill:miniinterneteth/d_krill vtysh ALL
CAIR MATRIX N/A vtysh ALL
CAIR MEASUREMENT N/A vtysh ALL
CAIR MEASUREMENT N/A vtysh ALL
2 changes: 1 addition & 1 deletion platform/config/l3_routers_tier1_and_stub.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CAIR MATRIX_TARGET routinator:miniinterneteth/d_routinator vtysh ALL
CAIR MATRIX_TARGET host:miniinterneteth/d_host vtysh ALL
CAIR DNS N/A vtysh ALL
CAIR MATRIX N/A vtysh ALL
CAIR MEASUREMENT N/A vtysh ALL
20 changes: 11 additions & 9 deletions platform/config/variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DOCKERHUB_PREFIX="miniinterneteth/"
# This URL will be suggested as the default location for students
# to download their configs. It should be publicly accessible via ssh at port
# 2000 + X, where X is each AS number.
SSH_URL="duvel.ethz.ch"
SSH_URL="internet.netd.cs.tu-dresden.de"

# =============================================================================
# WEBSERVER
Expand All @@ -21,8 +21,8 @@ SSH_URL="duvel.ethz.ch"
# You need to specify the hostname of the server and an email for
# LetsEncrypt to be enabled.
# UPDATE THOSE VARIABLES. WEBSERVER_HOSTNAME -> hostname of the server and EMAIL -> empty string (for http)
WEBSERVER_HOSTNAME="duvel.ethz.ch"
WEBSERVER_ACME_MAIL="[email protected]"
WEBSERVER_HOSTNAME="internet.netd.cs.tu-dresden.de"
WEBSERVER_ACME_MAIL="[email protected]"
# Hostname and ports for the webserver and krill on the host.
# (must be publicly available)
# you can change http and https ports, but letsencrypt won't work, so its not recommended.
Expand All @@ -31,7 +31,7 @@ WEBSERVER_PORT_HTTPS="443"
# Use the one you want, make sure to make it reachable from outside.
WEBSERVER_PORT_KRILL="3000"
# Put your timezone here.
WEBSERVER_TZ="Europe/Zurich"
WEBSERVER_TZ="Europe/Berlin"

# =============================================================================
# Connections
Expand Down Expand Up @@ -60,29 +60,31 @@ MATRIX_CONCURRENT_PINGS=500
MATRIX_PING_FLAGS="-c 3 -i 0.01" # Three pings, 10ms interval.
# Whether to pause the matrix container after starting it.
# Can reduce load when the mini internet is not used immediately.
# Unpause container at any time with `docker container unpause MATRIX`
MATRIX_PAUSE_AFTER_START=false

# =============================================================================
# History collector.
# =============================================================================

# Whether to enable the history collector.
HISTORY_ENABLED=true
HISTORY_ENABLED=false
# Whether to pause the matrix container after starting it.
# Can reduce disk usage when the mini internet is not used immediately.
# Unpause container at any time with `docker container unpause HISTORY`
HISTORY_PAUSE_AFTER_START=false
# How often to fetch update configs and matrix state.
HISTORY_UPDATE_FREQUENCY=$(( 60*60 )) # every hours (in seconds)
HISTORY_UPDATE_FREQUENCY=$(( 60*60 )) # every hour (in seconds)
# Timeout for ./save_configs.sh
HISTORY_TIMEOUT="300s"
# Username and email that will show up on the commit.
HISTORY_GIT_USER="Mini-Internet History"
HISTORY_GIT_EMAIL="[email protected]"
HISTORY_GIT_USER=""
HISTORY_GIT_EMAIL=""
# URL of the git repository to push the snapshots to; should be accessible.
# For example, create a gitlab access token and use it in the URL.
# The token needs to have write access to the repository.
# HISTORY_GIT_URL="https://gitlab-ci-token:<TOKEN HERE>@gitlab.ethz.ch/nsg/lectures/lec_commnet/projects/2024/routing_project/test_history.git"
HISTORY_GIT_URL="https://gitlab-ci-token:[email protected]/nsg/lectures/lec_commnet/projects/2024/routing_project/config-and-matrix-history.git"
HISTORY_GIT_URL=""
HISTORY_GIT_BRANCH="main"
# switch.db and rpki.cache are binaries that cannot be stored easily in git.
# If this option is "true" (recommend), we re-write the git history at every
Expand Down
24 changes: 24 additions & 0 deletions platform/docker_images/history/update_history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ update_history() {
local git_branch=$7
local forget_binaries=$8

<<<<<<< HEAD
=======
# If a git url is provided, test if it exists, otherwise print error.
git ls-remote "$git_url" > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo "Error! Unable to access '$git_url'"
# Reset to ignore it in the rest of the script. Makes things easier.
git_url=""
fi


>>>>>>> zurich/master
# Get git directory ready and cd into it.
if [ -d $output_dir/.git ]; then
echo "Directory $output_dir is already a git repository."
Expand All @@ -76,9 +88,15 @@ update_history() {
git push --set-upstream origin $git_branch
fi
fi
<<<<<<< HEAD
# Ensure we are up-to-date.
git pull --rebase -X theirs
git push
=======
# Ensure we are up-to-date. Ignore errors (no repo).
git pull --rebase -X theirs 2>/dev/null
git push 2>/dev/null
>>>>>>> zurich/master
elif [ -n "$git_url" ]; then
if git clone -b $git_branch $git_url $output_dir ; then
# Remote branch exists, we are ready.
Expand All @@ -99,8 +117,14 @@ update_history() {
git branch -m $git_branch
fi
# If the update was interrupted, there may be some changes left.
<<<<<<< HEAD
# Clean up the working directory.
git reset --hard HEAD
=======
# Clean up the working directory. Ignore errors (empty repo).
git reset --hard HEAD 2>/dev/null

>>>>>>> zurich/master

# Git repository is ready!

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading