Skip to content

Commit c029807

Browse files
authored
feat: Horizon upgrade support and improved development workflow (#811)
* fix(docker): resolve dev container startup and standardize compose configs - Fix dev containers exiting immediately by adding proper entrypoints - Consolidate profiling config from docker-compose.prof.yml into dev.yml - Standardize volume mounts and add missing horizon.json mappings - Update configs for Horizon upgrade (GraphTallyCollector vs TAPVerifier) - Add profiling support with proper security options and permissions Resolves issues preventing indexer-service and tap-agent from running in dev mode * refactor(indexer-service): update for Horizon upgrade and improve config generation - Migrate from TAPVerifier to GraphTallyCollector contract addresses - Replace sed-based template config with inline TOML generation - Add horizon.json support and Horizon migration detection - Streamline profiling configuration and reduce script verbosity * refactor(tap-agent): update for Horizon upgrade and add profiling capabilities - Migrate from TAPVerifier to GraphTallyCollector contract addresses - Replace sed-based config templates with inline generation - Bundle horizon.json and .env files in Docker image - Simplify startup script structure and improve logging - Remove indexer-service dependency for independent startup * chore(dev-workflow): improve container management - Separate prod/dev workflows and add services-status command - Improve container cleanup and colorized output for better UX * chore(test): remove profiling script no longer needed * fix(integration-tests): update fund_escrow.sh for correct file paths and formatting - Fix contract file paths to use ../contrib/local-network/ directory - Update error message to reflect correct execution directory - Remove set -e to allow graceful error handling - Clean up formatting and spacing consistency * feat(setup): add timing reports and improve disk usage tracking - Add script execution time tracking with minutes/seconds display - Improve Docker size calculation with robust fallback methods - Remove debug output (ls, pwd) and unused environment variables - Update gateway container to use horizon.json instead of tap-contracts.json - Disable set -e to allow graceful error handling - Add structured completion report with timing and disk usage metrics * fix(test): clone local-network submodule necessary for testing containers * fix(test): remove unnecessary sections for compose file
1 parent 038ff50 commit c029807

File tree

13 files changed

+429
-346
lines changed

13 files changed

+429
-346
lines changed

.github/workflows/tap_integration_test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ jobs:
4545
# registry: ghcr.io
4646
# username: ${{ github.actor }}
4747
# password: ${{ secrets.GITHUB_TOKEN }}
48+
# TODO: Improve this later
49+
# evaluate if it makes sense to use a git submodule instead
50+
- name: Clone local-network dependency for Docker builds
51+
run: |
52+
cd contrib/
53+
if [ ! -d "local-network" ]; then
54+
git clone https://github.com/semiotic-ai/local-network.git
55+
cd local-network
56+
git checkout suchapalaver/test/horizon
57+
fi
58+
4859
- name: Build indexer-service image with Docker Compose
4960
run: docker compose -f contrib/docker-compose.yml build indexer-service
5061

contrib/docker-compose.dev.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
services:
22
indexer-service:
33
image: indexer-base:latest
4+
build:
5+
context: ..
46
container_name: indexer-service
57
volumes:
6-
- ../target/release/indexer-service-rs:/usr/local/bin/indexer-service-rs
7-
- ./indexer-service/start.sh:/usr/local/bin/start.sh
8-
- ./indexer-service/config.toml:/opt/config/config.toml
98
- ./local-network/tap-contracts.json:/opt/contracts.json:ro
9+
- ./local-network/horizon.json:/opt/horizon.json:ro
1010
- ./local-network/.env:/opt/.env:ro
11+
- ./profiling:/opt/profiling:rw
12+
# - ./indexer-service/config.toml:/opt/config/config.toml
13+
- ./indexer-service/start.sh:/usr/local/bin/start.sh
1114
- ../migrations:/opt/migrations:ro
15+
- ../target/release/indexer-service-rs:/usr/local/bin/indexer-service-rs
1216
entrypoint: ["/usr/local/bin/start.sh"]
1317
environment:
1418
- RUST_BACKTRACE=1
1519
- RUST_LOG=debug
20+
- PROFILER=${PROFILER:-none}
1621
ports:
1722
- "7601:7601"
1823
networks:
@@ -23,23 +28,29 @@ services:
2328
timeout: 3s
2429
retries: 10
2530
start_period: 10s
31+
cap_add:
32+
- SYS_ADMIN
33+
privileged: true
34+
security_opt:
35+
- seccomp:unconfined
2636

2737
tap-agent:
2838
image: indexer-base:latest # Pre-built base image with dependencies
2939
container_name: tap-agent
30-
depends_on:
31-
indexer-service:
32-
condition: service_healthy
3340
volumes:
3441
- ../target/release/indexer-tap-agent:/usr/local/bin/indexer-tap-agent
35-
- ./tap-agent:/opt/config:ro
42+
- ./tap-agent/start.sh:/usr/local/bin/start.sh
43+
# - ./tap-agent:/opt/config:ro
44+
- ./profiling:/opt/profiling:rw
3645
- ./local-network/.env:/opt/.env:ro
3746
- ./local-network/tap-contracts.json:/opt/contracts.json:ro
47+
- ./local-network/horizon.json:/opt/horizon.json:ro
3848
- ../migrations:/opt/migrations:ro
39-
entrypoint: ["/bin/bash", "-c", "/opt/config/start.sh"]
49+
entrypoint: ["/usr/local/bin/start.sh"]
4050
environment:
4151
- RUST_BACKTRACE=1
4252
- RUST_LOG=debug
53+
- PROFILER=${PROFILER:-none}
4354
ports:
4455
# to expose the metrics port
4556
- "7300:7300"
@@ -51,6 +62,11 @@ services:
5162
timeout: 3s
5263
retries: 10
5364
start_period: 10s
65+
cap_add:
66+
- SYS_ADMIN
67+
privileged: true
68+
security_opt:
69+
- seccomp:unconfined
5470

5571
networks:
5672
local-network:

contrib/docker-compose.prof.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

contrib/docker-compose.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ services:
55
dockerfile: ./contrib/indexer-service/Dockerfile
66
container_name: indexer-service
77
volumes:
8-
- ./indexer-service:/opt/config:ro # From contrib dir to indexer-service dir
98
- ./local-network/tap-contracts.json:/opt/contracts.json:ro
9+
- ./local-network/horizon.json:/opt/horizon.json:ro
1010
- ./local-network/.env:/opt/.env:ro
1111
- ../migrations:/opt/migrations:ro
12-
entrypoint: ["/bin/bash", "-c", "/opt/config/start.sh"]
1312
environment:
1413
- RUST_BACKTRACE=1
1514
- RUST_LOG=debug
@@ -33,16 +32,15 @@ services:
3332
indexer-service:
3433
condition: service_healthy
3534
volumes:
36-
- ./tap-agent:/opt/config:ro # From contrib dir to tap-agent dir
3735
- ./local-network/.env:/opt/.env:ro
3836
- ./local-network/tap-contracts.json:/opt/contracts.json:ro
37+
- ./local-network/horizon.json:/opt/horizon.json:ro
3938
- ../migrations:/opt/migrations:ro
40-
entrypoint: ["/bin/bash", "-c", "/opt/config/start.sh"]
4139
environment:
4240
- RUST_BACKTRACE=1
4341
- RUST_LOG=debug
42+
- PROFILER=${PROFILER:-none}
4443
ports:
45-
# to expose the metrics port
4644
- "7300:7300"
4745
networks:
4846
- local-network

contrib/indexer-service/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2121
COPY --from=build /root/target/release/indexer-service-rs /usr/local/bin/indexer-service-rs
2222

2323
# Copy our start script into the image
24+
COPY contrib/local-network/.env /opt/.env
2425
COPY contrib/indexer-service/start.sh /usr/local/bin/start.sh
2526
COPY contrib/indexer-service/config.toml /opt/config/config.toml
27+
COPY contrib/local-network/horizon.json /opt/horizon.json
2628

2729
RUN chmod +x /usr/local/bin/start.sh
2830

0 commit comments

Comments
 (0)