featurebase/idk/docker-compose.yml
Travis Turner 468461fbcf
Add Drop Database and Drop Table support (#2208)
* Support Drop Table in serverless (include Snapshotter, Writelogger)

* Finish Database methods

Things like:
- `Databases`
- `DatabaseByID`
- `DatabaseByName`
- `DropDatabase`

* Change Poller to use NodeService instead of its own map

Instead of the Poller maintaining its own map of Addresses to poll, this
commit changes the Poller to use the NodeService interface to get all
known nodes from the Controller.

The next commit needs to:
Next, the logic in the boltdb NodeService implementation was moved to
the boltdb Balancer implementation. That way, the Balancer can be the
source of truth for all things nodes/workers/jobs.

* Move NodeService from Controller to Balancer

This commit moves the implementation of the NodeService into the
Balancer, and aligns `Balancer.AddWorker` with `NodeService.CreateNode`
so that they stay in sync. (Same for `Balancer.RemoveWorker` and
`NodeService.DeleteNode`).

* fix import of private repo

* Fix go vet issues

* Fix bug in DeregisterNode

We need to remove the node from the NodeService even if it's not
assigned to a database. The logic had a bug in it.

This also adds some no-op implementations for SnapshotService and
WriteloggerService. If a directory was not configured for that, then the
computer node would panic on trying to read from the Snapshotter upon
receiving a Directive.

* queryer response content-type: json

* Add support for NULL to WriteloggerDir and SnapshotterDir configs

This commit changes the way WriteLoggerDir and SnapshotterDir are
handled.
If value is empty `""`, an error will be returned on computer startup.
If value is `"NULL"`, a no-op implementation of the service will be
used. This would be for a case that wanted to run serverless on-prem
with no durable storage.
Finally, any other value will be used as the directory to use.

Some things which aren't considered here and may result in unexpected
behavior:
- a value with spaces `" "`
- any "null" which is not "NULL"... like lowercase.

* Finish the DropTable test

* Change "disable service" value to case-insensitive "off"

This commit also removes an unnecessary sleep in the tests.

* Fix docker-compose variables for IDK test

Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
2023-01-23 19:59:47 -06:00

149 lines
4.9 KiB
YAML

version: '3'
services:
postgres:
image: postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
zookeeper:
image: confluentinc/cp-zookeeper:${CONFLUENT_VERSION:-5.5.3}
environment:
ZOOKEEPER_CLIENT_PORT: 2181
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/secrets/jaas_kafka_broker.conf"
volumes:
- ./docker-sasl/ssl_keys:/etc/kafka/secrets
kafka:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION:-5.5.3}
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka:19092,LISTENER_DOCKER_EXTERNAL://kafka:9092,LISTENER_DOCKER_EXTERNAL_SSL://kafka:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL_SSL:SASL_SSL
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/secrets/jaas_kafka_broker.conf"
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
KAFKA_SSL_KEYSTORE_FILENAME: broker_kafkaBroker_server.keystore.jks
KAFKA_SSL_KEYSTORE_CREDENTIALS: credentials
KAFKA_SSL_KEY_CREDENTIALS: credentials
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
volumes:
- ./docker-sasl/ssl_keys:/etc/kafka/secrets
depends_on:
- zookeeper
# UI can be nice for debugging stuff and messing with Kafka. Not used by tests.
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
- zookeeper
- kafka
- schema-registry
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
KAFKA_CLUSTERS_0_JMXPORT: 9997
KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schema-registry:8081
schema-registry:
image: confluentinc/cp-schema-registry:${CONFLUENT_VERSION:-5.5.3}
environment:
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:19092
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
depends_on:
- zookeeper
- kafka
pilosa:
#image: registry.gitlab.com/molecula/featurebase/featurebase:linux-amd64-${BRANCH_NAME} # (jaffee) I think we should build directly from this tree rather than pulling the image... makes the local dev flow easier
build: ..
environment:
PILOSA_DATA_DIR: /data
PILOSA_BIND: 0.0.0.0:10101
PILOSA_BIND_GRPC: 0.0.0.0:20101
PILOSA_ADVERTISE: pilosa:10101
PILOSA_LOOKUP_DB_DSN: "postgresql://postgres:password@postgres:5432/postgres?sslmode=disable"
depends_on:
- postgres
volumes:
- ./testenv/certs:/certs
pilosa-tls:
#image: registry.gitlab.com/molecula/featurebase/featurebase:linux-amd64-${BRANCH_NAME}
build: ..
environment:
PILOSA_DATA_DIR: /data
PILOSA_BIND: https://0.0.0.0:10111
PILOSA_BIND_GRPC: 0.0.0.0:20111
PILOSA_ADVERTISE: https://pilosa-tls:10111
PILOSA_TLS_CA_CERTIFICATE: /certs/ca.crt
PILOSA_TLS_CERTIFICATE: /certs/pilosa-tls.crt
PILOSA_TLS_KEY: /certs/pilosa-tls.key
PILOSA_TLS_ENABLE_CLIENT_VERIFICATION: 1
volumes:
- ./testenv/certs:/certs
pilosa-auth:
#image: registry.gitlab.com/molecula/featurebase/featurebase:linux-amd64-${BRANCH_NAME}
build: ..
environment:
PILOSA_DATA_DIR: /data
PILOSA_BIND: 0.0.0.0:10105
PILOSA_BIND_GRPC: 0.0.0.0:20105
PILOSA_ADVERTISE: pilosa-auth:10105
PILOSA_CONFIG: /testdata/featurebase.conf
volumes:
- ./testdata:/testdata
depends_on:
- fakeidp
fakeidp:
build:
context: .
dockerfile: Dockerfile-fakeIDP
idk-test:
build:
context: ../.
dockerfile: ./idk/Dockerfile-test
environment:
IDK_DEFAULT_SHARD_TRANSACTIONAL: ${IDK_DEFAULT_SHARD_TRANSACTIONAL}
volumes:
- ./testenv/certs:/certs
- ./docker-sasl/ssl_keys:/ssl_keys
- ./testdata:/testdata
depends_on:
- fakeidp
wait:
build:
context: .
dockerfile: Dockerfile-wait
volumes:
- ./testenv/certs:/certs
dax:
build:
context: ..
dockerfile: Dockerfile-dax
environment:
FEATUREBASE_BIND: 0.0.0.0:8080
FEATUREBASE_VERBOSE: "true"
FEATUREBASE_QUERYER_RUN: "true"
FEATUREBASE_MDS_RUN: "true"
FEATUREBASE_MDS_CONFIG_DATA_DIR: /dax-data/mds
FEATUREBASE_COMPUTER_RUN: "true"
FEATUREBASE_COMPUTER_CONFIG_DATA_DIR: /dax-data/computer
FEATUREBASE_COMPUTER_CONFIG_WRITELOGGER_DIR: /dax-data/wl
FEATUREBASE_COMPUTER_CONFIG_SNAPSHOTTER_DIR: /dax-data/snaps