Skip to content

Commit d424ca4

Browse files
chore: modernize stack tooling and add e2e tests (#16)
* chore: modernize stack tooling and add e2e tests - Reverse compose detection order: docker compose V2 > V1 > podman Image upgrades: - postgres 17.4, pgadmin 9.2 - mysql 9.3 (remove deprecated auth flag) - redis 7.4, RedisInsight redislabs→redis/redisinsight:3.2.0 (port 5540) - mongo 8.0, mongo-express 1.0.2 - kafka bitnami→apache/kafka:3.9.0, kafbat/kafka-ui:v1.4.2 - rabbitmq 4.1-management-alpine - localstack 4.14.0 - hyperdx 2.23.2 - otel-collector 0.123.0, jaeger 1.76.0, prometheus v3.3.0, grafana 11.6.0 Compose improvements: - Drop deprecated `version: '3'` field - Add healthchecks + `service_healthy` dependencies across all services - Remove jaeger receiver from OTel config (deprecated) - Remove legacy Jaeger ports (14268, 6832) Docs: - Fix pgAdmin port (8039), remove defunct Jaeger rows, fix -d→-f typo Tests: - Add tests/lib.sh with shared helpers (wait_healthy, wait_http, wait_port, etc.) - Add e2e tests for all 10 stack components - Add tests/run-all.sh suite runner with pass/fail summary - Add `make test` target - Add .github/workflows/e2e.yml CI workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: update docker-compose files with modernized images and healthchecks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cf869d5 commit d424ca4

27 files changed

+676
-46
lines changed

.env.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ MYSQL_PORT=3306
1111
PHPMYADMIN_PORT=8031
1212

1313
STATSD_PORT=8125
14-
JAEGER_HTTP_PORT=14268
15-
JAEGER_UDP_PORT=6832
1614
OTLP_GRPC_PORT=4317
1715
OTLP_HTTP_PORT=4318
1816
JAEGER_UI_PORT=8034

.github/workflows/e2e.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: e2e
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Free up disk space
18+
run: |
19+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
20+
docker system prune -af
21+
22+
- name: Run e2e tests
23+
run: make test

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ install:
99
@echo "Creating network..."
1010
@stack network
1111
@echo "🧱 Installed. Happy hacking!"
12+
13+
.PHONY: test
14+
test:
15+
@bash $(STACK_PATH)/tests/run-all.sh

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/opencodeco/stack/main/in
1717
| `stack mysql`| MySQL & phpMyAdmin (http://localhost:8031) |
1818
| `stack redis` | Redis & RedisInsight (http://localhost:8032) |
1919
| `stack mongo` | MongoDB & Mongo Express (http://localhost:8033) |
20-
| `stack postgres` | PostgreSQL & pgAdmin (http://localhost:8034) |
20+
| `stack postgres` | PostgreSQL & pgAdmin (http://localhost:8039) |
2121
| `stack kafka` | Kafka and UI for Apache Kafka (http://localhost:8037) |
2222
| `stack rabbitmq` | RabbitMQ & Management Plugin (http://localhost:8038) |
2323
| `stack aws` | AWS services via LocalStack _(legacy, [see details below](#aws-localstack-vs-ministack))_ (http://localhost:4566) |
@@ -29,8 +29,6 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/opencodeco/stack/main/in
2929

3030
| Component | Description | Port |
3131
| --- | --- | --- |
32-
| OpenTelemetry Collector | Jaeger HTTP | `14268` |
33-
| OpenTelemetry Collector | Jaeger UDP | `6832` |
3432
| OpenTelemetry Collector | Statsd UDP | `8125` |
3533
| OpenTelemetry Collector | OTLP gRPC | `4317` |
3634
| OpenTelemetry Collector | OTLP HTTP | `4318` |
@@ -77,7 +75,7 @@ stack mysql up -d
7775
```
7876
Which does a:
7977
```shell
80-
docker-compose -d mysql/docker-compose.yml up -d
78+
docker-compose -f mysql/docker-compose.yml up -d
8179
```
8280
Behind the scenes.
8381

@@ -109,3 +107,5 @@ stack mysql logs -f
109107
---
110108

111109
⚠️ **Remember:** this is suited for development environments only.
110+
111+
> **Note on upgrades:** Major version upgrades for MySQL (8→9), MongoDB (6→8), and RabbitMQ (3→4) may require recreating volumes if you have existing data. Run `stack <component> down -v` to remove volumes before upgrading.

aws/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
opencodeco-aws:
33
container_name: opencodeco-aws
4-
image: localstack/localstack:2.2.0
4+
image: localstack/localstack:4.14.0
55
ports:
66
- ${AWS_PORT}:4566
77

hyperdx/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
opencodeco-hyperx:
33
container_name: opencodeco-hyperx
4-
image: hyperdx/hyperdx-local
4+
image: hyperdx/hyperdx-local:2.23.2
55
ports:
66
- ${HYPERDX_API_PORT}:8000
77
- ${HYPERDX_APP_PORT}:8080

kafka/docker-compose.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
services:
22
opencodeco-kafka:
33
container_name: opencodeco-kafka
4-
image: bitnami/kafka:3.5
4+
image: apache/kafka:3.9.0
55
ports:
66
- ${KAFKA_PORT}:9092
77
volumes:
8-
- opencodeco-kafka:/bitnami
8+
- opencodeco-kafka:/var/lib/kafka/data
99
environment:
10-
- KAFKA_CFG_NODE_ID=0
11-
- KAFKA_CFG_PROCESS_ROLES=controller,broker
12-
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
13-
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
14-
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@opencodeco-kafka:9093
15-
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
10+
- KAFKA_NODE_ID=1
11+
- KAFKA_PROCESS_ROLES=broker,controller
12+
- KAFKA_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
13+
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://opencodeco-kafka:9092
14+
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
15+
- KAFKA_CONTROLLER_QUORUM_VOTERS=1@opencodeco-kafka:9093
16+
- KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
17+
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
18+
- KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
19+
- KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1
20+
healthcheck:
21+
test: ["CMD-SHELL", "/opt/kafka/bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092 > /dev/null 2>&1"]
22+
interval: 15s
23+
timeout: 10s
24+
retries: 5
1625

1726
opencodeco-kafka-ui:
1827
container_name: opencodeco-kafka-ui
19-
image: provectuslabs/kafka-ui:latest
28+
image: ghcr.io/kafbat/kafka-ui:v1.4.2
2029
ports:
2130
- ${KAFKA_UI_PORT}:8080
2231
depends_on:
23-
- opencodeco-kafka
32+
opencodeco-kafka:
33+
condition: service_healthy
2434
environment:
2535
DYNAMIC_CONFIG_ENABLED: 'true'
2636
volumes:

mongo/docker-compose.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
services:
22
opencodeco-mongo:
33
container_name: opencodeco-mongo
4-
image: mongo:6.0
4+
image: mongo:8.0
55
ports:
66
- ${MONGO_PORT}:27017
77
volumes:
88
- opencodeco-mongo:/data/db
9+
healthcheck:
10+
test: ["CMD", "mongosh", "--eval", "db.runCommand('ping').ok", "--quiet"]
11+
interval: 10s
12+
timeout: 5s
13+
retries: 5
914

1015
opencodeco-mongo-express:
1116
container_name: opencodeco-mongo-express
12-
image: mongo-express:1.0.0-alpha
17+
image: mongo-express:1.0.2
1318
ports:
1419
- ${MONGO_EXPRESS_PORT}:8081
1520
environment:
1621
ME_CONFIG_MONGODB_URL: mongodb://opencodeco-mongo:27017/
1722
depends_on:
18-
- opencodeco-mongo
23+
opencodeco-mongo:
24+
condition: service_healthy
1925

2026
networks:
2127
default:

mysql/docker-compose.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
services:
22
opencodeco-mysql:
33
container_name: opencodeco-mysql
4-
image: mysql:8.1
5-
command: --default-authentication-plugin=mysql_native_password
4+
image: mysql:9.3
65
ports:
76
- ${MYSQL_PORT}:3306
87
environment:
98
MYSQL_ROOT_PASSWORD: opencodeco
109
volumes:
1110
- opencodeco-mysql:/var/lib/mysql
11+
healthcheck:
12+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-popencodeco"]
13+
interval: 10s
14+
timeout: 5s
15+
retries: 5
1216

1317
opencodeco-phpmyadmin:
1418
container_name: opencodeco-phpmyadmin
@@ -17,6 +21,9 @@ services:
1721
- ${PHPMYADMIN_PORT}:80
1822
environment:
1923
- PMA_HOST=opencodeco-mysql
24+
depends_on:
25+
opencodeco-mysql:
26+
condition: service_healthy
2027

2128
networks:
2229
default:

o11y/docker-compose.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
services:
22
opencodeco-otelcol:
33
container_name: opencodeco-otelcol
4-
image: otel/opentelemetry-collector-contrib:0.95.0
4+
image: otel/opentelemetry-collector-contrib:0.123.0
55
volumes:
66
- ./otelcol-config.yml:/etc/otelcol-contrib/config.yaml
77
ports:
8-
- ${JAEGER_HTTP_PORT}:14268
9-
- ${JAEGER_UDP_PORT}:6832/udp
108
- ${STATSD_PORT}:8125/udp
119
- ${OTLP_GRPC_PORT}:4317
1210
- ${OTLP_HTTP_PORT}:4318
1311

1412
opencodeco-jaeger:
1513
container_name: opencodeco-jaeger
16-
image: jaegertracing/all-in-one:1.54
14+
image: jaegertracing/all-in-one:1.76.0
1715
ports:
1816
- ${JAEGER_UI_PORT}:16686
1917

2018
opencodeco-prometheus:
2119
container_name: opencodeco-prometheus
22-
image: prom/prometheus:v2.46.0
20+
image: prom/prometheus:v3.3.0
2321
volumes:
2422
- ./prometheus.yml:/etc/prometheus/prometheus.yml
2523
ports:
2624
- ${PROMETHEUS_PORT}:9090
2725

2826
opencodeco-grafana:
2927
container_name: opencodeco-grafana
30-
image: grafana/grafana:10.0.3
28+
image: grafana/grafana:11.6.0
3129
ports:
3230
- ${GRAFANA_PORT}:3000
3331
volumes:

0 commit comments

Comments
 (0)