Skip to content

Commit fb4768f

Browse files
committed
finish remaining dbs
1 parent 221b8e9 commit fb4768f

26 files changed

+324
-200
lines changed

_run-druid.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
5+
source "$SOURCE_DIR/env-druid.sh"
6+
7+
source "$SOURCE_DIR/common.sh"
8+
9+
kill-existing ${CONTAINER_NAME}
10+
docker run \
11+
-p ${WEB_PORT}:8081 \
12+
-p ${HOST_PORT}:8082 \
13+
-p 8888:8888 \
14+
-e CLUSTER_SIZE=nano-quickstart \
15+
--name ${CONTAINER_NAME} \
16+
--rm \
17+
-d metabase/druid:${DRUID_VERSION}
18+
19+
cat <<EOF
20+
21+
Started Druid ${DRUID_VERSION} on ports ${WEB_PORT}, ${HOST_PORT}, and 8888.
22+
23+
Visit http://localhost:${WEB_PORT} in your browser to view the web console.
24+
25+
EOF
26+
27+
print-druid-vars

_run-mariadb.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! /usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
5+
source "$SOURCE_DIR/env-mariadb.sh"
6+
7+
source "$SOURCE_DIR/common.sh"
8+
9+
kill-existing ${CONTAINER_NAME}
10+
11+
docker run -p ${HOST_PORT}:3306 \
12+
-e MYSQL_DATABASE=${DB_NAME} \
13+
-e MYSQL_USER=${DB_USER} \
14+
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
15+
--name ${CONTAINER_NAME} \
16+
--rm \
17+
-d mariadb:${MARIADB_VERSION}
18+
19+
cat <<EOF
20+
21+
Started MariaDB ${MARIADB_VERSION} on port ${HOST_PORT}.
22+
23+
Connect with the MySQL CLI tool:
24+
mysql --user=${DB_USER} --host=127.0.0.1 --port=${HOST_PORT} --database=${DB_NAME}
25+
26+
JDBC URL: jdbc:mysql://localhost:${HOST_PORT}/${DB_NAME}?user=${DB_USER}
27+
28+
EOF
29+
30+
print-mariadb-vars

run-presto.sh _run-presto.sh

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#! /usr/bin/env bash
22

3-
set -euo pipefail
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
44

5-
echo "Removing existing container..."
5+
source "$SOURCE_DIR/env-presto.sh"
66

7-
docker rm -fv presto 2>/dev/null || echo "Nothing to remove"
7+
source "$SOURCE_DIR/common.sh"
88

9-
docker run -p 8080:8080 \
9+
kill-existing ${CONTAINER_NAME}
10+
11+
docker run -p ${HOST_PORT}:8080 \
1012
-p 8443:8443 \
11-
--name presto \
13+
--name ${CONTAINER_NAME} \
1214
--hostname presto \
1315
--rm \
14-
-d metabase/presto-mb-ci
15-
16-
SERVER_CA_PEM_FILE=/tmp/presto-ssl-ca.pem
17-
SERVER_CA_DER_FILE=/tmp/presto-ssl-ca.der
18-
MODIFIED_CACERTS_FILE=/tmp/cacerts-with-presto-ssl.jks
16+
-d prestodb/presto:${PRESTO_VERSION}
1917

2018
cat << EOF
21-
Started Presto on port 8080 (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
19+
20+
Started Presto on port ${HOST_PORT} (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
2221
2322
To make the self signed certificate that was generated for this Presto instance available to your Java application
2423
(ex: Metabase), perform the following steps after Presto is completely online. You can run
2524
26-
docker logs --tail 5 presto
25+
docker logs --tail 5 ${CONTAINER_NAME}
2726
2827
to see the current output. Once Presto is online, you will see a line containing something like the following:
2928
@@ -44,4 +43,7 @@ also have the JAVA_HOME env var set for this all to work.
4443
Finally, this can be made available to Metabase by adding the following JVM args when starting:
4544
4645
-Djavax.net.ssl.trustStore=$MODIFIED_CACERTS_FILE -Djavax.net.ssl.trustStorePassword=changeit
46+
4747
EOF
48+
49+
print-presto-vars

_run-sparksql.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
6+
7+
source "$SOURCE_DIR/env-sparksql.sh"
8+
9+
source "$SOURCE_DIR/common.sh"
10+
11+
kill-existing ${CONTAINER_NAME}
12+
13+
docker run -p ${HOST_PORT}:10000 \
14+
--name ${CONTAINER_NAME} \
15+
--rm \
16+
-d metabase/spark:${SPARKSQL_VERSION}
17+
18+
cat <<EOF
19+
20+
Started Spark SQL ${SPARKSQL_VERSION} on port ${HOST_PORT}.
21+
22+
JDBC URL: jdbc:hive2://localhost:${HOST_PORT}/?user=${DB_USER}&password=${DB_PASSWORD}
23+
For a specific database: jdbc:hive2://localhost:${HOST_PORT}/${DB_NAME}?user=${DB_USER}&password=${DB_PASSWORD}
24+
25+
EOF

_run-vertica.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#! /usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
5+
source "$SOURCE_DIR/env-vertica.sh"
6+
7+
source "$SOURCE_DIR/common.sh"
8+
9+
ENV=""
10+
if [[ $(uname -m) == 'arm64' ]]; then
11+
echo "Warning! The database will be likely extremely slow on arm64!"
12+
ENV+=" --env VERTICA_MEMDEBUG=2"
13+
fi
14+
15+
kill-existing ${CONTAINER_NAME}
16+
17+
docker run -p ${HOST_PORT}:5433 \
18+
--name ${CONTAINER_NAME} \
19+
--rm \
20+
${ENV} \
21+
-d opentext/vertica-ce:${VERTICA_VERSION}
22+
23+
cat <<EOF
24+
25+
Started Vertica ${VERTICA_VERSION} on port ${HOST_PORT}.
26+
27+
JDBC URL: "jdbc:vertica://localhost:${HOST_PORT}/${DB_NAME}?user=${DB_USER}"
28+
29+
EOF
30+
31+
print-vertica-vars

appdb/appdb-mariadb.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
env vars: MB_DB_TYPE=mysql MB_DB_DBNAME=metabase_test MB_DB_HOST=localhost MB_DB_PASS='' MB_DB_PORT=3306 MB_DB_USER=root MB_MYSQL_TEST_USER=root
2+
3+
Clojure CLI:
4+
5+
clojure -J-Dmb.db-type=mysql -J-Dmb.db-port=3306 -J-Dmb.db.dbname=metabase_test -J-Dmb.db.user=root -J-Dmb.db.pass=''
6+
7+
or add a profile for it to your ~/.clojure/deps.edn:
8+
9+
{:profiles
10+
{:user/mysql
11+
{:jvm-opts
12+
["-Dmb.db-type=mysql"
13+
"-Dmb.db-port=3306"
14+
"-Dmb.db.dbname=metabase_test"
15+
"-Dmb.db.user=root"
16+
"-Dmb.db.pass="]}}}

env-druid.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
CONTAINER_NAME=mb-druid-db
6+
WEB_PORT=8081
7+
HOST_PORT=8082
8+
9+
function print-druid-vars() {
10+
cat <<EOF
11+
Java properties:
12+
-Dmb.druid.test.host=localhost -Dmb.druid.test.port=${HOST_PORT}
13+
14+
Clojure pairs:
15+
:mb-druid-test-host "localhost" :mb-druid-test-port "${HOST_PORT}"
16+
17+
Bash variables:
18+
MB_DRUID_TEST_HOST=localhost MB_DRUID_TEST_PORT=${HOST_PORT}
19+
EOF
20+
}
21+
22+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
23+
print-druid-vars
24+
fi

env-mariadb.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
CONTAINER_NAME=mb-mariadb-db
6+
HOST_PORT=3307
7+
DB_NAME=metabase_test
8+
DB_USER=root
9+
10+
function print-mariadb-vars() {
11+
cat <<EOF
12+
Java properties:
13+
-Dmb.mysql.test.host=localhost -Dmb.mysql.test.port=${HOST_PORT} -Dmb.mysql.test.db=${DB_NAME} -Dmb.mysql.test.user=${DB_USER} -Dmb.mysql.test.password=
14+
15+
Clojure pairs:
16+
:mb-mysql-test-host "localhost" :mb-mysql-test-port "${HOST_PORT}" :mb-mysql-test-db "${DB_NAME}" :mb-mysql-test-user "${DB_USER}" :mb-mysql-test-password ""
17+
18+
Bash variables:
19+
MB_MYSQL_TEST_HOST=localhost MB_MYSQL_TEST_PORT=${HOST_PORT} MB_MYSQL_TEST_DB=${DB_NAME} MB_MYSQL_TEST_USER=${DB_USER} MB_MYSQL_TEST_PASSWORD=''
20+
EOF
21+
}
22+
23+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
24+
print-mariadb-vars
25+
fi
26+

env-presto.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
CONTAINER_NAME=mb-presto-db
6+
HOST_PORT=8083
7+
DB_USER=presto
8+
DB_PASSWORD=''
9+
SERVER_CA_PEM_FILE=/tmp/presto-ssl-ca.pem
10+
SERVER_CA_DER_FILE=/tmp/presto-ssl-ca.der
11+
MODIFIED_CACERTS_FILE=/tmp/cacerts-with-presto-ssl.jks
12+
13+
function print-presto-vars() {
14+
cat <<EOF
15+
Java properties:
16+
-Dmb.presto.test.host=localhost -Dmb.presto.test.port=${HOST_PORT} -Dmb.presto.test.user=${DB_USER} -Dmb.presto.test.password=${DB_PASSWORD}
17+
18+
Clojure pairs:
19+
:mb-presto-test-host "localhost" :mb-presto-test-port "${HOST_PORT}" :mb-presto-test-user "${DB_USER}" :mb-presto-test-password "${DB_PASSWORD}"
20+
21+
Bash variables:
22+
MB_PRESTO_TEST_HOST=localhost MB_PRESTO_TEST_PORT=${HOST_PORT} MB_PRESTO_TEST_USER=${DB_USER} MB_PRESTO_TEST_PASSWORD=${DB_PASSWORD}
23+
EOF
24+
}
25+
26+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
27+
print-presto-vars
28+
fi

env-sparksql.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
CONTAINER_NAME=mb-sparksql-db
6+
HOST_PORT=10000
7+
DB_NAME=test_data
8+
DB_USER=admin
9+
DB_PASSWORD=admin
10+
11+
function print-sparksql-vars() {
12+
cat <<EOF
13+
Java properties:
14+
-Dmb.sparksql.test.host=localhost -Dmb.sparksql.test.port=${HOST_PORT} -Dmb.sparksql.test.db=${DB_NAME} -Dmb.sparksql.test.user=${DB_USER} -Dmb.sparksql.test.password=${DB_PASSWORD}
15+
16+
Clojure pairs:
17+
:mb-sparksql-test-host "localhost" :mb-sparksql-test-port "${HOST_PORT}" :mb-sparksql-test-db "${DB_NAME}" :mb-sparksql-test-user "${DB_USER}" :mb-sparksql-test-password "${DB_PASSWORD}"
18+
19+
Bash variables:
20+
MB_SPARKSQL_TEST_HOST=localhost MB_SPARKSQL_TEST_PORT=${HOST_PORT} MB_SPARKSQL_TEST_DB=${DB_NAME} MB_SPARKSQL_TEST_USER=${DB_USER} MB_SPARKSQL_TEST_PASSWORD=${DB_PASSWORD}
21+
EOF
22+
}
23+
24+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
25+
print-sparksql-vars
26+
fi

env-vertica.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
CONTAINER_NAME=mb-vertica-db
6+
HOST_PORT=5433
7+
DB_NAME=vmart
8+
DB_USER=dbadmin
9+
DB_PASSWORD=''
10+
11+
function print-vertica-vars() {
12+
cat <<EOF
13+
Java properties:
14+
-Dmb.vertica.test.host=localhost -Dmb.vertica.test.port=${HOST_PORT} -Dmb.vertica.test.dbname=${DB_NAME} -Dmb.vertica.test.user=${DB_USER} -Dmb.vertica.test.password=${DB_PASSWORD}
15+
16+
Clojure pairs:
17+
:mb-vertica-test-host "localhost" :mb-vertica-test-port "${HOST_PORT}" :mb-vertica-test-dbname "${DB_NAME}" :mb-vertica-test-user "${DB_USER}" :mb-vertica-test-password "${DB_PASSWORD}"
18+
19+
Bash variables:
20+
MB_VERTICA_TEST_HOST=localhost MB_VERTICA_TEST_PORT=${HOST_PORT} MB_VERTICA_TEST_DBNAME=${DB_NAME} MB_VERTICA_TEST_USER=${DB_USER} MB_VERTICA_TEST_PASSWORD=${DB_PASSWORD}
21+
EOF
22+
}
23+
24+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
25+
print-vertica-vars
26+
fi

run-druid-latest.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
5+
DRUID_VERSION=29.0.0 $SOURCE_DIR/_run-druid.sh

run-druid-oldest.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
5+
DRUID_VERSION=0.20.2 $SOURCE_DIR/_run-druid.sh

run-druid.sh

-21
This file was deleted.

run-mariadb-10-2.sh

-47
This file was deleted.

0 commit comments

Comments
 (0)