Skip to content

Commit b7af93a

Browse files
authored
Merge pull request #137 from ethpandaops/pk910/refactoring
Assertoor Refactoring / New UI
2 parents c35b5c3 + cbf7a86 commit b7af93a

431 files changed

Lines changed: 49262 additions & 9338 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ test-*.yaml
88
.hack/devnet/generated-**
99
.hack/devnet/custom-**
1010
CLAUDE.md
11+
12+
# Web UI
13+
web-ui/node_modules/
14+
15+
# Built React assets (generated by make ui)
16+
pkg/web/static/img/*
17+
pkg/web/static/js/*
18+
pkg/web/static/css/*
19+
pkg/web/static/index.html

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ linters:
6666
- linters:
6767
- revive
6868
text: "var-naming: avoid meaningless package names"
69-
path: "pkg/coordinator/(types|web/types|web/utils|web/api)/"
69+
path: "pkg/(types|web/types|web/api)/"
7070
formatters:
7171
enable:
7272
- gofmt

.hack/devnet/run.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,53 @@ yq eval-all '. as $item ireduce ({}; . *+ $item)' "${__dir}/generated-assertoor-
3636
mv "${__dir}/generated-assertoor-config-final.yaml" "${__dir}/generated-assertoor-config.yaml"
3737
rm "${__dir}/generated-assertoor-config-custom.yaml"
3838

39+
# Resolve container hostnames to IPs for running assertoor outside Docker
40+
# Kurtosis service hostnames need to be resolved via Docker network inspection
41+
DOCKER_NETWORK="kt-${ENCLAVE_NAME}"
42+
43+
# Build a map of service hostnames to container IPs
44+
declare -A hostname_to_ip
45+
46+
echo "Building hostname to IP mapping from Docker network..."
47+
# Get all container info from the kurtosis network
48+
# Format: container_name -> IP
49+
while IFS= read -r line; do
50+
if [ -n "$line" ]; then
51+
container_name=$(echo "$line" | cut -d'|' -f1)
52+
container_ip=$(echo "$line" | cut -d'|' -f2 | cut -d'/' -f1)
53+
# Kurtosis container names are like: service--uuid
54+
# Remove the trailing --uuid to get the service name (hostname)
55+
service_name=$(echo "$container_name" | sed 's/--[a-f0-9]*$//')
56+
if [ -n "$service_name" ] && [ -n "$container_ip" ]; then
57+
hostname_to_ip["$service_name"]="$container_ip"
58+
fi
59+
fi
60+
done < <(docker network inspect "$DOCKER_NETWORK" --format '{{range $id, $container := .Containers}}{{$container.Name}}|{{$container.IPv4Address}}{{"\n"}}{{end}}' 2>/dev/null)
61+
62+
# Extract all hostnames from URLs in the config and resolve them
63+
echo "Resolving container hostnames to IPs..."
64+
config_content=$(cat "${__dir}/generated-assertoor-config.yaml")
65+
66+
# Get unique hostnames from http:// URLs (matches pattern http://hostname:port)
67+
hostnames=$(echo "$config_content" | grep -oE 'http://[a-zA-Z0-9_-]+:[0-9]+' | sed 's|http://||' | cut -d':' -f1 | sort -u)
68+
69+
for hostname in $hostnames; do
70+
ip="${hostname_to_ip[$hostname]}"
71+
if [ -n "$ip" ]; then
72+
echo " $hostname -> $ip"
73+
config_content=$(echo "$config_content" | sed "s|http://${hostname}:|http://${ip}:|g")
74+
else
75+
echo " WARNING: Could not resolve $hostname"
76+
fi
77+
done
78+
79+
echo "$config_content" > "${__dir}/generated-assertoor-config.yaml"
80+
81+
if [ -f "${__dir}/custom-ai-config.yaml" ]; then
82+
ai_config_file="${__dir}/custom-ai-config.yaml"
83+
cat "$ai_config_file" | envsubst >> "${__dir}/generated-assertoor-config.yaml"
84+
fi
85+
3986
cat <<EOF
4087
============================================================================================================
4188
Assertoor config at ${__dir}/generated-assertoor-config.yaml

0 commit comments

Comments
 (0)