Repository navigation
136 lines (123 loc) · 5.9 KB
/
Copy pathprotocol-services.yml
File metadata and controls
136 lines (123 loc) · 5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
name: Real protocol services
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
protocol-service:
name: ${{ matrix.service }} through Sōzu
# MongoDB's TCMalloc guard rejects Ubuntu 7.0.0 kernel release strings
# (SERVER-136848). Keep its host on Ubuntu 22.04's compatible 6.8 kernel.
runs-on: ${{ matrix.service == 'mongodb' && 'ubuntu-22.04' || 'ubuntu-latest' }}
timeout-minutes: 25
strategy:
fail-fast: false
max-parallel: 3
matrix:
include:
- service: postgresql
feature: service-postgres
test: tests::real_services_tcp::postgres::round_trip_and_reconnect_via_sozu
image: postgres:18.6-alpine@sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873
- service: mysql
feature: service-mysql
test: tests::real_services_tcp::mysql::round_trip_and_reconnect_via_sozu
image: mysql:8.4.11@sha256:6ea90827b1100f8f2ae306a539f86d2c264a26ed435a2a9f75551dd5c3aeb242
- service: redis
feature: service-redis
test: tests::real_services_tcp::redis::round_trip_and_reconnect_via_sozu
image: redis:8.2.10-alpine@sha256:b51665e66f00759be7c3152ad5ac3c66fb2f619c13ef62dea7cc1f9914524635
- service: mongodb
feature: service-mongodb
test: tests::real_services_tcp::mongodb::round_trip_and_reconnect_via_sozu
image: mongo:8.0.32-noble@sha256:0393ab544cbbe92b2dd64719205ecb14a8b3824b17ea75051e2f22482c3e4e66
- service: kafka
feature: service-kafka
test: tests::real_services_tcp::kafka::round_trip_and_reconnect_via_sozu
image: apache/kafka:4.1.2@sha256:5cc2a2fd93fa2687b44015eee04fb2c3edd9e526bd64bf8bec5ff1e268772e0e
- service: rabbitmq
feature: service-rabbitmq
test: tests::real_services_tcp::rabbitmq::round_trip_and_reconnect_via_sozu
image: rabbitmq:4.2.9-alpine@sha256:d5d8797191db5828a2a2a3dabf295d2b558ae81e215e6c6cba26d567ae8fb236
- service: pulsar
feature: service-pulsar
test: tests::real_services_tcp::pulsar::round_trip_and_reconnect_via_sozu
image: apachepulsar/pulsar:4.2.4@sha256:cd5d4a64a32c0770d5d2dbb526169a70081605bbec4b59b73471b68d0a451fb4
- service: coredns
feature: service-coredns
test: tests::real_services_udp::authoritative_queries_expiry_and_reactivation_via_sozu_udp
image: coredns/coredns:1.14.7@sha256:7efd3c635b03efd68c4e8398fc45f0d993d0e9ab016f72c1cefb0fd6d01aa286
env:
SOZU_CONTAINER_ENGINE: docker
SOZU_PROTOCOL_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.service }}
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust 1.93.1
uses: dtolnay/rust-toolchain@1.93.1
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Cache Cargo target
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
cache-all-crates: true
prefix-key: protocol-service-${{ matrix.service }}
workspaces: . -> target/
- name: Verify container server and pull pinned service image
run: |
docker info --format '{{.ID}}|{{.Name}}|{{.ServerVersion}}'
docker pull '${{ matrix.image }}'
- name: Exercise real service through Sōzu
env:
SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR: ${{ runner.temp }}/sozu-protocol-services/${{ matrix.service }}
run: |
mkdir -p "$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR"
set -o pipefail
cargo test -p sozu-e2e --locked -j4 \
--features '${{ matrix.feature }}' '${{ matrix.test }}' -- \
--exact --nocapture --test-threads=1 2>&1 \
| tee "$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR/test.log"
- name: Verify failed container diagnostics and cleanup
if: matrix.service == 'redis'
env:
SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR: ${{ runner.temp }}/sozu-protocol-services/${{ matrix.service }}
run: |
set -o pipefail
cargo test -p sozu-e2e --locked -j4 --features service-redis \
tests::real_services_tcp::fixture::tests:: -- \
--nocapture --test-threads=1 2>&1 \
| tee "$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR/fixture-cleanup.log"
grep -F 'test result: ok. 2 passed; 0 failed;' \
"$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR/fixture-cleanup.log"
- name: Collect and remove only this cell's containers
if: always()
env:
SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR: ${{ runner.temp }}/sozu-protocol-services/${{ matrix.service }}
run: |
mkdir -p "$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR"
mapfile -t ids < <(docker ps -aq \
--filter "label=org.sozu.e2e.run=$SOZU_PROTOCOL_SERVICE_RUN_ID")
for id in "${ids[@]}"; do
docker logs "$id" \
> "$SOZU_PROTOCOL_SERVICE_ARTIFACT_DIR/$id.log" 2>&1 || true
docker rm --volumes --force "$id"
done
remaining="$(docker ps -aq \
--filter "label=org.sozu.e2e.run=$SOZU_PROTOCOL_SERVICE_RUN_ID")"
test -z "$remaining"
- name: Upload service logs on failure
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: protocol-service-${{ matrix.service }}-${{ github.sha }}
path: ${{ runner.temp }}/sozu-protocol-services/${{ matrix.service }}
if-no-files-found: error