-
Notifications
You must be signed in to change notification settings - Fork 0
Add backbeat route apis #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2a6bce6
c2269ca
4a27551
d52e917
b3e03bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| services: | ||
| # =================== | ||
| # MongoDB | ||
| # =================== | ||
| mongodb: | ||
| image: ${MONGODB_IMAGE} | ||
| command: mongod --replSet rs0 --port ${MONGODB_PORT} --bind_ip_all | ||
| ports: | ||
| - "127.0.0.1:${MONGODB_PORT}:${MONGODB_PORT}" | ||
| healthcheck: | ||
| test: echo 'db.runCommand("ping").ok' | mongo --port ${MONGODB_PORT} --quiet | ||
| interval: 5s | ||
| timeout: 10s | ||
| retries: 5 | ||
| start_period: 10s | ||
| profiles: | ||
| - mongo | ||
| - backbeat | ||
|
|
||
| mongodb-init: | ||
| image: ${MONGODB_IMAGE} | ||
| depends_on: | ||
| mongodb: | ||
| condition: service_healthy | ||
| command: > | ||
| mongo --host mongodb:${MONGODB_PORT} --eval | ||
| 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:${MONGODB_PORT}"}]})' | ||
| restart: "no" | ||
| profiles: | ||
| - mongo | ||
| - backbeat | ||
|
|
||
| # =================== | ||
| # Cloudserver with MongoDB backend | ||
| # =================== | ||
| cloudserver: | ||
| image: ${CLOUDSERVER_IMAGE} | ||
| ports: | ||
| - "127.0.0.1:${CLOUDSERVER_PORT}:${CLOUDSERVER_PORT}" | ||
| environment: | ||
| - S3VAULT=mem | ||
| - S3METADATA=mongodb | ||
| - S3DATA=mem | ||
| - MONGODB_HOSTS=mongodb:${MONGODB_PORT} | ||
| - MONGODB_RS=rs0 | ||
| - REMOTE_MANAGEMENT_DISABLE=true | ||
| - LOG_LEVEL=info | ||
| - CRR_METRICS_HOST=backbeat-api | ||
| - CRR_METRICS_PORT=${BACKBEAT_PORT} | ||
| depends_on: | ||
| mongodb-init: | ||
| condition: service_completed_successfully | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:${CLOUDSERVER_PORT}/', r => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))\""] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 12 | ||
| profiles: | ||
| - mongo | ||
| - backbeat | ||
|
|
||
| # =================== | ||
| # Metadata backend services | ||
| # =================== | ||
| metadata-standalone: | ||
| image: ${METADATA_IMAGE} | ||
| network_mode: 'host' | ||
| volumes: | ||
| - ./md-config.json:/mnt/standalone_workdir/config.json:ro | ||
| profiles: | ||
| - metadata | ||
|
|
||
| cloudserver-metadata: | ||
| image: ${CLOUDSERVER_IMAGE} | ||
| network_mode: 'host' | ||
| environment: | ||
| - S3VAULT=mem | ||
| - S3METADATA=scality | ||
| - S3DATA=mem | ||
| - REMOTE_MANAGEMENT_DISABLE=true | ||
| - LOG_LEVEL=info | ||
| depends_on: | ||
| - metadata-standalone | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:${CLOUDSERVER_PORT}/', r => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))\""] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 12 | ||
| profiles: | ||
| - metadata | ||
|
|
||
| # =================== | ||
| # Backbeat services | ||
| # =================== | ||
| zookeeper: | ||
| image: ${ZOOKEEPER_IMAGE} | ||
| ports: | ||
| - "127.0.0.1:${ZOOKEEPER_PORT}:${ZOOKEEPER_PORT}" | ||
| healthcheck: | ||
| test: ["CMD", "zkServer.sh", "status"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| profiles: | ||
| - backbeat | ||
|
|
||
| zk-init: | ||
| image: ${ZOOKEEPER_IMAGE} | ||
| depends_on: | ||
| zookeeper: | ||
| condition: service_healthy | ||
| command: > | ||
| bash -c " | ||
| sleep 2 && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat '' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication '' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state '' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/ingestion '' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/ingestion/state '' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/us-east-1 '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/us-east-2 '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/wontwork-location '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/location-dmf-v1 '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/zenko '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/state/aws-location '{\"paused\":false}' && | ||
| zkCli.sh -server zookeeper:${ZOOKEEPER_PORT} create /backbeat/replication/replayState '' && | ||
| echo 'Zookeeper paths initialized successfully' | ||
| " | ||
| restart: "no" | ||
| profiles: | ||
| - backbeat | ||
|
|
||
| redis: | ||
| image: ${REDIS_IMAGE} | ||
| ports: | ||
| - "127.0.0.1:${REDIS_PORT}:${REDIS_PORT}" | ||
| profiles: | ||
| - backbeat | ||
|
|
||
| kafka: | ||
| image: ${KAFKA_IMAGE} | ||
| ports: | ||
| - "127.0.0.1:${KAFKA_PORT}:${KAFKA_PORT}" | ||
| environment: | ||
| KAFKA_ZOOKEEPER_CONNECT: zookeeper:${ZOOKEEPER_PORT} | ||
| KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:${KAFKA_PORT} | ||
| KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:${KAFKA_PORT} | ||
| KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
| depends_on: | ||
| zookeeper: | ||
| condition: service_healthy | ||
| profiles: | ||
| - backbeat | ||
|
|
||
| backbeat-api: | ||
| image: ${BACKBEAT_IMAGE} | ||
| ports: | ||
| - "127.0.0.1:${BACKBEAT_PORT}:${BACKBEAT_PORT}" | ||
| environment: | ||
| ZOOKEEPER_CONNECTION_STRING: zookeeper:${ZOOKEEPER_PORT} | ||
| REDIS_HOST: redis | ||
| KAFKA_HOSTS: kafka:${KAFKA_PORT} | ||
| MONGODB_HOSTS: mongodb:${MONGODB_PORT} | ||
| REMOTE_MANAGEMENT_DISABLE: "1" | ||
| HEALTHCHECKS_ALLOWFROM: "0.0.0.0/0" | ||
| depends_on: | ||
| mongodb-init: | ||
| condition: service_completed_successfully | ||
| zk-init: | ||
| condition: service_completed_successfully | ||
| kafka: | ||
| condition: service_started | ||
| redis: | ||
| condition: service_started | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:${BACKBEAT_PORT}/_/healthcheck', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))\""] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 12 | ||
| command: node bin/backbeat.js | ||
| profiles: | ||
| - backbeat |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # MongoDB | ||
| MONGODB_IMAGE=mongo:4.4 | ||
| MONGODB_PORT=27018 | ||
|
|
||
| # Cloudserver | ||
| CLOUDSERVER_IMAGE=ghcr.io/scality/cloudserver:9.3.0-preview.1 | ||
| CLOUDSERVER_PORT=8000 | ||
|
|
||
| # Metadata | ||
| METADATA_IMAGE=ghcr.io/scality/metadata:8.11.0-standalone | ||
| METADATA_PORT=9000 | ||
|
|
||
| # Zookeeper | ||
| ZOOKEEPER_IMAGE=zookeeper:3.8 | ||
| ZOOKEEPER_PORT=2181 | ||
|
|
||
| # Kafka | ||
| KAFKA_IMAGE=wurstmeister/kafka:latest | ||
| KAFKA_PORT=9092 | ||
|
|
||
| # Redis | ||
| REDIS_IMAGE=redis:7-alpine | ||
| REDIS_PORT=6379 | ||
|
|
||
| # Backbeat | ||
| BACKBEAT_IMAGE=ghcr.io/scality/backbeat:9.1.3 | ||
| BACKBEAT_PORT=8900 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,4 +44,4 @@ structure LocationMDObj { | |
|
|
||
| /// Version ID in the data store for this location | ||
| dataStoreVersionId: String | ||
| } | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All models are coming from https://github.com/scality/zenkoclient/blob/development/1.3/zenko-2018-07-08-json.api.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| $version: "2.0" | ||
| namespace cloudserver.proxyBackbeatApis | ||
|
|
||
| @readonly | ||
| @http(method: "GET", uri: "/_/backbeat/api/healthcheck") | ||
| operation CheckConnection { | ||
| input: CheckConnectionInput, | ||
| output: CheckConnectionOutput | ||
| } | ||
|
|
||
| structure CheckConnectionInput {} | ||
|
|
||
| structure CheckConnectionOutput {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| $version: "2.0" | ||
| namespace cloudserver.proxyBackbeatApis | ||
|
|
||
| map LocationStatusMap { | ||
| key: String, | ||
| value: Document | ||
| } | ||
|
|
||
| structure FailedObjectVersion { | ||
| Bucket: String, | ||
|
|
||
| Key: String, | ||
|
|
||
| VersionId: String, | ||
|
|
||
| StorageClass: String, | ||
|
|
||
| Size: Integer, | ||
|
|
||
| LastModified: Timestamp | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing line at EOF |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this new setup is just to be able to run backbeat api server. I don't particularly like it, most of it is copied from backbeat actions, and it's very long considering it's just for testing (and the tests aren't even thorough as you'll see). But it couldn't find anything else simplier