forked from cadence-workflow/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pinot integration test (cadence-workflow#6044)
* add pinot integration test for PR * add pinot integration test into pipeline * still not working * running new kafka, but container doesn't connect with integration test * all components started, but kafka doesn't publish or consume * make sure pinot uses v7 es * update pinot test pipeline-pull-request cmd * update timeout time * delete cmd in docker-compose-pinot.yml * test pinot integration test * comment out local run cmd * longer timeout time for pinot integration test * make fmt * revert unnecessary changes * change back a kafka setting * cleanup dead code * also add pinot integration test into pipeline-master
- Loading branch information
Showing
7 changed files
with
280 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
version: "3.5" | ||
|
||
services: | ||
cassandra: | ||
image: cassandra:4.1.1 | ||
ports: | ||
- "9042:9042" | ||
environment: | ||
- "MAX_HEAP_SIZE=256M" | ||
- "HEAP_NEWSIZE=128M" | ||
networks: | ||
services-network: | ||
aliases: | ||
- cassandra | ||
healthcheck: | ||
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"] | ||
interval: 15s | ||
timeout: 30s | ||
retries: 10 | ||
prometheus: | ||
image: prom/prometheus:latest | ||
networks: | ||
services-network: | ||
aliases: | ||
- prometheus | ||
volumes: | ||
- ./prometheus:/etc/prometheus | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
ports: | ||
- '9090:9090' | ||
|
||
kafka: | ||
image: docker.io/bitnami/kafka:3.7 | ||
restart: unless-stopped | ||
container_name: "kafka" | ||
ports: | ||
- "9092:9092" | ||
- "9093:9093" | ||
environment: | ||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 | ||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,OUTSIDE:PLAINTEXT | ||
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9093,OUTSIDE://:9092 | ||
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9093,OUTSIDE://kafka:9092 | ||
- KAFKA_CFG_BROKER_ID=0 | ||
- ALLOW_PLAINTEXT_LISTENER=yes | ||
# Topic settings | ||
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true | ||
depends_on: | ||
- zookeeper | ||
networks: | ||
services-network: | ||
aliases: | ||
- kafka | ||
|
||
# will be deleted later when we get rid of ES usages | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3 | ||
# version here must be the same as the one in testdata/integration_pinot_cluster | ||
ports: | ||
- "9200:9200" | ||
networks: | ||
services-network: | ||
aliases: | ||
- elasticsearch | ||
environment: | ||
- discovery.type=single-node | ||
|
||
zookeeper: | ||
image: zookeeper:3.5.8 | ||
restart: always | ||
hostname: zookeeper | ||
container_name: zookeeper | ||
ports: | ||
- '2181:2181' | ||
environment: | ||
- ZOOKEEPER_CLIENT_PORT=2181 | ||
- ZOOKEEPER_TICK_TIME=2000 | ||
networks: | ||
services-network: | ||
aliases: | ||
- zookeeper | ||
|
||
pinot-controller: | ||
image: apachepinot/pinot:0.12.1 | ||
command: "StartController -zkAddress zookeeper:2181 -controllerPort 9001" | ||
container_name: pinot-controller | ||
restart: unless-stopped | ||
ports: | ||
- "9001:9001" | ||
environment: | ||
JAVA_OPTS: "-Dplugins.dir=/opt/pinot/plugins -Xms1G -Xmx4G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xloggc:gc-pinot-controller.log" | ||
depends_on: | ||
- zookeeper | ||
networks: | ||
services-network: | ||
aliases: | ||
- pinot-controller | ||
pinot-broker: | ||
image: apachepinot/pinot:0.12.1 | ||
command: "StartBroker -zkAddress zookeeper:2181" | ||
restart: unless-stopped | ||
container_name: "pinot-broker" | ||
ports: | ||
- "8099:8099" | ||
environment: | ||
JAVA_OPTS: "-Dplugins.dir=/opt/pinot/plugins -Xms4G -Xmx4G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xloggc:gc-pinot-broker.log" | ||
depends_on: | ||
- pinot-controller | ||
networks: | ||
services-network: | ||
aliases: | ||
- pinot-broker | ||
pinot-server: | ||
image: apachepinot/pinot:0.12.1 | ||
command: "StartServer -zkAddress zookeeper:2181" | ||
restart: unless-stopped | ||
container_name: "pinot-server" | ||
ports: | ||
- "8098:8098" | ||
environment: | ||
JAVA_OPTS: "-Dplugins.dir=/opt/pinot/plugins -Xms4G -Xmx16G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xloggc:gc-pinot-server.log" | ||
depends_on: | ||
- pinot-broker | ||
networks: | ||
services-network: | ||
aliases: | ||
- pinot-server | ||
|
||
pinot-admin: | ||
image: apachepinot/pinot:latest | ||
container_name: pinot-admin | ||
depends_on: | ||
- pinot-controller | ||
- pinot-broker | ||
- pinot-server | ||
entrypoint: ["/bin/sh", "-c", "cp /schema/pinot/create_pinot_table.sh /opt/pinot/create_pinot_table.sh && chmod +x /opt/pinot/create_pinot_table.sh && /opt/pinot/create_pinot_table.sh"] | ||
volumes: | ||
- ../../schema:/schema # Ensure the schema files and script are available in the container | ||
networks: | ||
services-network: | ||
aliases: | ||
- pinot-server | ||
|
||
integration-test-cassandra-pinot: | ||
build: | ||
context: ../../ | ||
dockerfile: ./docker/buildkite/Dockerfile | ||
# When run integration test locally, uncomment this. | ||
# command: | ||
# - /bin/sh | ||
# - -e | ||
# - -c | ||
# - > | ||
# go test -timeout 600s | ||
# -run ^TestPinotIntegrationSuite$ | ||
# -tags pinotintegration | ||
# -count 1 | ||
# -v | ||
# github.com/uber/cadence/host | ||
# | tee test.log | ||
# ports: | ||
# - "7933:7933" | ||
# - "7934:7934" | ||
# - "7935:7935" | ||
# - "7939:7939" | ||
environment: | ||
- "CASSANDRA=1" | ||
- "CASSANDRA_SEEDS=cassandra" | ||
- "ES_SEEDS=elasticsearch" | ||
- "TEST_TAG=pinotintegration" | ||
- "ES_VERSION=v7" | ||
- "KAFKA_SEEDS=kafka" | ||
- "PINOT_SEEDS=pinot-broker" | ||
- BUILDKITE_AGENT_ACCESS_TOKEN | ||
- BUILDKITE_JOB_ID | ||
- BUILDKITE_BUILD_ID | ||
- BUILDKITE_BUILD_NUMBER | ||
depends_on: | ||
cassandra: | ||
condition: service_healthy | ||
elasticsearch: | ||
condition: service_started | ||
kafka: | ||
condition: service_started | ||
pinot-controller: | ||
condition: service_started | ||
pinot-broker: | ||
condition: service_started | ||
pinot-server: | ||
condition: service_started | ||
pinot-admin: | ||
condition: service_started | ||
volumes: | ||
- ../../:/cadence | ||
networks: | ||
services-network: | ||
aliases: | ||
- integration-test | ||
|
||
networks: | ||
services-network: | ||
enable_ipv6: true | ||
ipam: | ||
config: | ||
- subnet: 2001:0DB8::/112 | ||
name: services-network | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# Wait for Pinot components to start | ||
sleep 30 | ||
|
||
# Add the table | ||
/opt/pinot/bin/pinot-admin.sh AddTable \ | ||
-schemaFile /schema/pinot/cadence-visibility-schema.json \ | ||
-tableConfigFile /schema/pinot/cadence-visibility-config.json \ | ||
-controllerProtocol http \ | ||
-controllerHost pinot-controller \ | ||
-controllerPort 9001 \ | ||
-exec |