Skip to content

Commit e151c50

Browse files
fixup
1 parent 4ae3727 commit e151c50

File tree

3 files changed

+89
-40
lines changed

3 files changed

+89
-40
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: 59 additions & 36 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,48 +37,53 @@ 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
70-
- SCALITY_ACCESS_KEY_ID=accessKey1
71-
- SCALITY_SECRET_ACCESS_KEY=verySecretKey1
7287
- LOG_LEVEL=info
7388
depends_on:
7489
mongodb-init:
@@ -82,42 +97,45 @@ services:
8297
backbeat-api:
8398
image: ghcr.io/scality/backbeat:9.1.3
8499
platform: linux/amd64
85-
network_mode: 'host'
100+
ports:
101+
- "8900:8900"
102+
networks:
103+
- backbeat-net
86104
environment:
87105
# Kafka configuration
88-
KAFKA_HOSTS: localhost:9092
106+
KAFKA_HOSTS: kafka:9092
89107
KAFKA_COMPRESSION_TYPE: snappy
90108

91109
# Zookeeper configuration
92-
ZOOKEEPER_CONNECTION_STRING: localhost:2181/backbeat
110+
ZOOKEEPER_CONNECTION_STRING: zookeeper:2181/backbeat
93111
ZOOKEEPER_AUTO_CREATE_NAMESPACE: "true"
94112

95113
# Redis configuration
96-
REDIS_HOST: localhost
114+
REDIS_HOST: redis
97115
REDIS_PORT: 6379
98116

99117
# MongoDB configuration
100-
MONGODB_HOSTS: localhost:27018
118+
MONGODB_HOSTS: mongodb:27018
101119
MONGODB_DATABASE: metadata
102120

103121
# Management backend
104122
MANAGEMENT_BACKEND: operator
105123
REMOTE_MANAGEMENT_DISABLE: "true"
106124

107-
# Cloudserver configuration (adjust to your CloudServer host/port)
108-
CLOUDSERVER_HOST: localhost
125+
# Cloudserver configuration
126+
CLOUDSERVER_HOST: cloudserver
109127
CLOUDSERVER_PORT: 8000
110128

111129
# Replication source S3
112-
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: localhost
130+
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: cloudserver
113131
EXTENSIONS_REPLICATION_SOURCE_S3_PORT: 8000
114132
EXTENSIONS_REPLICATION_SOURCE_AUTH_TYPE: service
115133
EXTENSIONS_REPLICATION_SOURCE_AUTH_ACCOUNT: service-replication
116134

117135
# Replication destination
118136
EXTENSIONS_REPLICATION_DEST_AUTH_TYPE: service
119137
EXTENSIONS_REPLICATION_DEST_AUTH_ACCOUNT: service-replication
120-
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: localhost:8001
138+
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: cloudserver:8001
121139
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST_MORE: '{"site": "wontwork-location", "type": "aws_s3"}, {"site": "aws-location", "type": "aws_s3"}'
122140

123141
# Lifecycle
@@ -141,42 +159,45 @@ services:
141159
backbeat-queue-processor:
142160
image: ghcr.io/scality/backbeat:9.1.3
143161
platform: linux/amd64
144-
network_mode: 'host'
162+
ports:
163+
- "4043:4043"
164+
networks:
165+
- backbeat-net
145166
environment:
146167
# Kafka configuration
147-
KAFKA_HOSTS: localhost:9092
168+
KAFKA_HOSTS: kafka:9092
148169
KAFKA_COMPRESSION_TYPE: snappy
149170

150171
# Zookeeper configuration
151-
ZOOKEEPER_CONNECTION_STRING: localhost:2181/backbeat
172+
ZOOKEEPER_CONNECTION_STRING: zookeeper:2181/backbeat
152173
ZOOKEEPER_AUTO_CREATE_NAMESPACE: "true"
153174

154175
# Redis configuration
155-
REDIS_HOST: localhost
176+
REDIS_HOST: redis
156177
REDIS_PORT: 6379
157178

158179
# MongoDB configuration
159-
MONGODB_HOSTS: localhost:27018
180+
MONGODB_HOSTS: mongodb:27018
160181
MONGODB_DATABASE: metadata
161182

162183
# Management backend
163184
MANAGEMENT_BACKEND: operator
164185
REMOTE_MANAGEMENT_DISABLE: "true"
165186

166187
# Cloudserver configuration
167-
CLOUDSERVER_HOST: localhost
188+
CLOUDSERVER_HOST: cloudserver
168189
CLOUDSERVER_PORT: 8000
169190

170191
# Replication source S3
171-
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: localhost
192+
EXTENSIONS_REPLICATION_SOURCE_S3_HOST: cloudserver
172193
EXTENSIONS_REPLICATION_SOURCE_S3_PORT: 8000
173194
EXTENSIONS_REPLICATION_SOURCE_AUTH_TYPE: service
174195
EXTENSIONS_REPLICATION_SOURCE_AUTH_ACCOUNT: service-replication
175196

176197
# Replication destination
177198
EXTENSIONS_REPLICATION_DEST_AUTH_TYPE: service
178199
EXTENSIONS_REPLICATION_DEST_AUTH_ACCOUNT: service-replication
179-
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: localhost:8001
200+
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST: cloudserver:8001
180201
EXTENSIONS_REPLICATION_DEST_BOOTSTRAPLIST_MORE: '{"site": "wontwork-location", "type": "aws_s3"}, {"site": "aws-location", "type": "aws_s3"}'
181202

182203
# Probe server port
@@ -185,8 +206,10 @@ services:
185206
# Logging
186207
LOG_LEVEL: info
187208
depends_on:
209+
mongodb-init:
210+
condition: service_completed_successfully
188211
cloudserver:
189-
condition: service_healthy
212+
condition: service_started
190213
backbeat-api:
191214
condition: service_started
192215
command: node extensions/replication/queueProcessor/task.js

.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)