Skip to content

Commit 73d90c6

Browse files
fixup
1 parent 4ae3727 commit 73d90c6

File tree

3 files changed

+86
-37
lines changed

3 files changed

+86
-37
lines changed

.github/authdata.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"accounts": [{
3+
"name": "bart",
4+
"arn": "aws::iam:123456789012:root",
5+
"canonicalID": "79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be",
6+
"displayName": "bart",
7+
"keys": {
8+
"access": "accessKey1",
9+
"secret": "verySecretKey1"
10+
}
11+
}, {
12+
"name": "lisa",
13+
"arn": "aws::iam:123456789013:root",
14+
"canonicalID": "79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2bf",
15+
"displayName": "lisa",
16+
"keys": {
17+
"access": "accessKey2",
18+
"secret": "verySecretKey2"
19+
}
20+
}]
21+
}

.github/docker-compose.backbeat.yml

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@ version: '3.8'
33
# This docker-compose is meant to be copied to your client test codebase
44
# It sets up Backbeat with all required services using published images
55

6+
networks:
7+
backbeat-net:
8+
driver: bridge
9+
610
services:
711
zookeeper:
812
image: zookeeper:3.8
913
platform: linux/amd64
10-
network_mode: 'host'
14+
ports:
15+
- "2181:2181"
16+
networks:
17+
- backbeat-net
1118
environment:
1219
- ALLOW_ANONYMOUS_LOGIN=yes
1320

1421
kafka:
1522
image: confluentinc/cp-kafka:7.4.0
1623
platform: linux/amd64
17-
network_mode: 'host'
24+
ports:
25+
- "9092:9092"
26+
networks:
27+
- backbeat-net
1828
environment:
19-
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
29+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
2030
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
2131
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
2232
KAFKA_BROKER_ID: 1
@@ -27,44 +37,51 @@ services:
2737
mongodb:
2838
image: mongo:5.0
2939
platform: linux/amd64
30-
network_mode: 'host'
31-
command: mongod --port 27018 --replSet rs0
40+
ports:
41+
- "27018:27018"
42+
networks:
43+
- backbeat-net
44+
command: mongod --port 27018 --replSet rs0 --bind_ip_all
3245
healthcheck:
33-
test: echo 'db.runCommand({serverStatus:1}).ok' | mongo localhost:27018/test --quiet
46+
test: echo 'db.runCommand("ping").ok' | mongosh --port 27018 --quiet
3447
interval: 10s
3548
timeout: 5s
3649
retries: 5
50+
start_period: 10s
3751

3852
mongodb-init:
3953
image: mongo:5.0
4054
platform: linux/amd64
41-
network_mode: 'host'
55+
networks:
56+
- backbeat-net
4257
depends_on:
4358
mongodb:
4459
condition: service_healthy
4560
command: >
46-
bash -c "
47-
echo 'Waiting for MongoDB to be ready...' &&
48-
sleep 5 &&
49-
mongo --host localhost:27018 --eval 'rs.initiate({_id:\"rs0\",members:[{_id:0,host:\"localhost:27018\"}]})' &&
50-
echo 'MongoDB replica set initialized'
51-
"
61+
mongosh --host mongodb:27018 --eval
62+
'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27018"}]})'
5263
restart: "no"
5364

5465
redis:
5566
image: redis:7-alpine
5667
platform: linux/amd64
57-
network_mode: 'host'
68+
ports:
69+
- "6379:6379"
70+
networks:
71+
- backbeat-net
5872

5973
cloudserver:
6074
image: ghcr.io/scality/cloudserver:9.1.4
6175
platform: linux/amd64
62-
network_mode: 'host'
76+
ports:
77+
- "8000:8000"
78+
networks:
79+
- backbeat-net
6380
environment:
6481
- S3VAULT=mem
6582
- S3METADATA=mongodb
6683
- S3DATA=mem
67-
- MONGODB_HOSTS=localhost:27018
84+
- MONGODB_HOSTS=mongodb:27018
6885
- MONGODB_RS=rs0
6986
- REMOTE_MANAGEMENT_DISABLE=true
7087
- SCALITY_ACCESS_KEY_ID=accessKey1
@@ -82,42 +99,45 @@ services:
8299
backbeat-api:
83100
image: ghcr.io/scality/backbeat:9.1.3
84101
platform: linux/amd64
85-
network_mode: 'host'
102+
ports:
103+
- "8900:8900"
104+
networks:
105+
- backbeat-net
86106
environment:
87107
# Kafka configuration
88-
KAFKA_HOSTS: localhost:9092
108+
KAFKA_HOSTS: kafka:9092
89109
KAFKA_COMPRESSION_TYPE: snappy
90110

91111
# Zookeeper configuration
92-
ZOOKEEPER_CONNECTION_STRING: localhost:2181/backbeat
112+
ZOOKEEPER_CONNECTION_STRING: zookeeper:2181/backbeat
93113
ZOOKEEPER_AUTO_CREATE_NAMESPACE: "true"
94114

95115
# Redis configuration
96-
REDIS_HOST: localhost
116+
REDIS_HOST: redis
97117
REDIS_PORT: 6379
98118

99119
# MongoDB configuration
100-
MONGODB_HOSTS: localhost:27018
120+
MONGODB_HOSTS: mongodb:27018
101121
MONGODB_DATABASE: metadata
102122

103123
# Management backend
104124
MANAGEMENT_BACKEND: operator
105125
REMOTE_MANAGEMENT_DISABLE: "true"
106126

107-
# Cloudserver configuration (adjust to your CloudServer host/port)
108-
CLOUDSERVER_HOST: localhost
127+
# Cloudserver configuration
128+
CLOUDSERVER_HOST: cloudserver
109129
CLOUDSERVER_PORT: 8000
110130

111131
# Replication source S3
112-
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: localhost
132+
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: cloudserver
113133
EXTENSIONS_REPLICATION_SOURCE_S3_PORT: 8000
114134
EXTENSIONS_REPLICATION_SOURCE_AUTH_TYPE: service
115135
EXTENSIONS_REPLICATION_SOURCE_AUTH_ACCOUNT: service-replication
116136

117137
# Replication destination
118138
EXTENSIONS_REPLICATION_DEST_AUTH_TYPE: service
119139
EXTENSIONS_REPLICATION_DEST_AUTH_ACCOUNT: service-replication
120-
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: localhost:8001
140+
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: cloudserver:8001
121141
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST_MORE: '{"site": "wontwork-location", "type": "aws_s3"}, {"site": "aws-location", "type": "aws_s3"}'
122142

123143
# Lifecycle
@@ -141,42 +161,45 @@ services:
141161
backbeat-queue-processor:
142162
image: ghcr.io/scality/backbeat:9.1.3
143163
platform: linux/amd64
144-
network_mode: 'host'
164+
ports:
165+
- "4043:4043"
166+
networks:
167+
- backbeat-net
145168
environment:
146169
# Kafka configuration
147-
KAFKA_HOSTS: localhost:9092
170+
KAFKA_HOSTS: kafka:9092
148171
KAFKA_COMPRESSION_TYPE: snappy
149172

150173
# Zookeeper configuration
151-
ZOOKEEPER_CONNECTION_STRING: localhost:2181/backbeat
174+
ZOOKEEPER_CONNECTION_STRING: zookeeper:2181/backbeat
152175
ZOOKEEPER_AUTO_CREATE_NAMESPACE: "true"
153176

154177
# Redis configuration
155-
REDIS_HOST: localhost
178+
REDIS_HOST: redis
156179
REDIS_PORT: 6379
157180

158181
# MongoDB configuration
159-
MONGODB_HOSTS: localhost:27018
182+
MONGODB_HOSTS: mongodb:27018
160183
MONGODB_DATABASE: metadata
161184

162185
# Management backend
163186
MANAGEMENT_BACKEND: operator
164187
REMOTE_MANAGEMENT_DISABLE: "true"
165188

166189
# Cloudserver configuration
167-
CLOUDSERVER_HOST: localhost
190+
CLOUDSERVER_HOST: cloudserver
168191
CLOUDSERVER_PORT: 8000
169192

170193
# Replication source S3
171-
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: localhost
194+
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: cloudserver
172195
EXTENSIONS_REPLICATION_SOURCE_S3_PORT: 8000
173196
EXTENSIONS_REPLICATION_SOURCE_AUTH_TYPE: service
174197
EXTENSIONS_REPLICATION_SOURCE_AUTH_ACCOUNT: service-replication
175198

176199
# Replication destination
177200
EXTENSIONS_REPLICATION_DEST_AUTH_TYPE: service
178201
EXTENSIONS_REPLICATION_DEST_AUTH_ACCOUNT: service-replication
179-
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: localhost:8001
202+
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: cloudserver:8001
180203
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST_MORE: '{"site": "wontwork-location", "type": "aws_s3"}, {"site": "aws-location", "type": "aws_s3"}'
181204

182205
# Probe server port

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,22 @@ jobs:
160160
username: ${{ github.repository_owner }}
161161
password: ${{ github.token }}
162162

163-
- name: Start Cloudserver with MongoDB backend
164-
run: docker compose -f .github/docker-compose.cloudserver-mongo.yml up -d
163+
- name: Start Backbeat with CloudServer
164+
run: docker compose -f .github/docker-compose.backbeat.yml up -d
165165

166166
- name: Wait for Cloudserver to be ready
167167
run: |
168168
set -o pipefail
169169
bash .github/scripts/wait_for_local_port.bash 8000 40
170170
171+
# - name: Wait for Backbeat API to be ready
172+
# run: |
173+
# set -o pipefail
174+
# bash .github/scripts/wait_for_local_port.bash 8900 60
175+
171176
- name: Run backbeat apis tests
172177
run: yarn test:backbeat-apis
173178

174-
- name: Stop Cloudserver
179+
- name: Stop Backbeat and Cloudserver
175180
if: always()
176-
run: docker compose -f .github/docker-compose.cloudserver-mongo.yml down
181+
run: docker compose -f .github/docker-compose.backbeat.yml down

0 commit comments

Comments
 (0)