Skip to content

Commit

Permalink
Basic Metabase demo CI test (MaterializeInc#2065)
Browse files Browse the repository at this point in the history
Addition to the Buildkite test pipeline. Checks that:
-  metabase, materialized, zookeeper, and kafka containers run and don't crash
- that metabase is available and responding to requests on port 3000
  • Loading branch information
JLDLaughlin authored Feb 20, 2020
1 parent 66d010d commit 0affd1e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
38 changes: 38 additions & 0 deletions ci/test/metabase-demo.compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright Materialize, Inc. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

version: '3.7'
services:
healthcheck:
image: materialize/ci-healthcheck:latest
depends_on: [metabase]
metabase:
image: materialize/metabase:latest
depends_on: [materialized]
ports:
- "3000:3000"
materialized:
image: materialize/ci-materialized:${BUILDKITE_BUILD_NUMBER}
command: --logging-granularity=10ms
depends_on: [kafka]
ulimits:
nofile:
soft: "65536"
hard: "65536"
zookeeper:
image: zookeeper:3.4.13
kafka:
image: wurstmeister/kafka:2.12-2.2.0
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_ADVERTISED_HOST_NAME=kafka
depends_on: [zookeeper]

volumes:
db-data:
13 changes: 12 additions & 1 deletion ci/test/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ steps:
run: billing-demo
if: $CHANGED_RUST

- id: metabase-demo
label: "metabase-demo"
depends_on: build
timeout_in_minutes: 10
plugins:
- MaterializeInc/uid#master: ~
- docker-compose#v3.0.3:
config: ci/test/metabase-demo.compose.yml
run: healthcheck
if: $CHANGED_RUST

- id: full-sqllogictest
label: ":bulb: :bulb: Full SQL logic tests"
depends_on: build
Expand All @@ -126,7 +137,7 @@ steps:

- id: deploy
label: ":rocket: Deploy"
depends_on: [lint-fast, lint-slow, cargo-test, testdrive, streaming-demo, short-sqllogictest]
depends_on: [lint-fast, lint-slow, cargo-test, testdrive, streaming-demo, metabase-demo, short-sqllogictest]
trigger: deploy
async: true
branches: "master v*.*"
Expand Down
16 changes: 16 additions & 0 deletions misc/docker/ci-healthcheck/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright Materialize, Inc. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

FROM ubuntu:bionic

RUN apt-get update && apt-get install -y curl

COPY healthcheck /usr/local/bin/healthcheck

ENTRYPOINT ["healthcheck"]
23 changes: 23 additions & 0 deletions misc/docker/ci-healthcheck/healthcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Copyright Materialize, Inc. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

# Point of this test: Assert Metabase and related containers
# can run.
# - If we see a successful curl, Metabase is up and working!
# - If we don't see a successful curl, Buildkite will time out
# and fail this test.

while ! curl -fsS metabase:3000; do
echo "Failed to curl metabase:3000. Sleeping..."
sleep 15
done

echo "Successfully pinged Metabase!"

0 comments on commit 0affd1e

Please sign in to comment.