Skip to content

Commit

Permalink
build(docker): clean up minio setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jan 28, 2024
1 parent 0f43667 commit a8164d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
10 changes: 5 additions & 5 deletions ci/schema/trino.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE hive.default.diamonds (
"y" DOUBLE,
"z" DOUBLE
) WITH (
external_location = 's3a://warehouse/diamonds',
external_location = 's3a://trino/diamonds',
format = 'PARQUET'
);

Expand Down Expand Up @@ -45,7 +45,7 @@ CREATE TABLE hive.default.astronauts (
"eva_hrs_mission" REAL,
"total_eva_hrs" REAL
) WITH (
external_location = 's3a://warehouse/astronauts',
external_location = 's3a://trino/astronauts',
format = 'PARQUET'
);

Expand Down Expand Up @@ -77,7 +77,7 @@ CREATE TABLE hive.default.batting (
"SF" BIGINT,
"GIDP" BIGINT
) WITH (
external_location = 's3a://warehouse/batting',
external_location = 's3a://trino/batting',
format = 'PARQUET'
);

Expand All @@ -93,7 +93,7 @@ CREATE TABLE hive.default.awards_players (
"tie" VARCHAR,
"notes" VARCHAR
) WITH (
external_location = 's3a://warehouse/awards-players',
external_location = 's3a://trino/awards-players',
format = 'PARQUET'
);

Expand All @@ -116,7 +116,7 @@ CREATE TABLE hive.default.functional_alltypes (
"year" INTEGER,
"month" INTEGER
) WITH (
external_location = 's3a://warehouse/functional-alltypes',
external_location = 's3a://trino/functional-alltypes',
format = 'PARQUET'
);
CREATE OR REPLACE VIEW memory.default.functional_alltypes AS
Expand Down
6 changes: 2 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ services:
retries: 20
test:
- CMD-SHELL
- mc ping --count 1 trino
- mc ready data && mc mb --ignore-existing data/trino
networks:
- trino
volumes:
- minio:/data
- $PWD/docker/minio/config.json:/.mc/config.json:ro

hive-metastore:
Expand All @@ -119,7 +118,7 @@ services:
HIVE_METASTORE_JDBC_URL: jdbc:postgresql://hive-metastore-db:23456/metastore
HIVE_METASTORE_USER: admin
HIVE_METASTORE_PASSWORD: admin
HIVE_METASTORE_WAREHOUSE_DIR: s3://warehouse/
HIVE_METASTORE_WAREHOUSE_DIR: s3://trino/
HIVE_METASTORE_USERS_IN_ADMIN_ROLE: "admin"
S3_ENDPOINT: http://minio:9000
S3_ACCESS_KEY: accesskey
Expand Down Expand Up @@ -569,6 +568,5 @@ volumes:
mysql:
oracle:
postgres:
minio:
exasol:
impala:
2 changes: 1 addition & 1 deletion docker/minio/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "10",
"aliases": {
"trino": {
"data": {
"url": "http://minio:9000",
"accessKey": "accesskey",
"secretKey": "secretkey",
Expand Down
20 changes: 3 additions & 17 deletions ibis/backends/trino/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TestConf(ServiceBackendTest):
# for numeric and decimal

service_name = "minio"
data_volume = "/bitnami/minio/data"
returned_timestamp_unit = "s"
supports_structs = True
supports_map = True
Expand All @@ -47,21 +48,6 @@ class TestConf(ServiceBackendTest):
_tpch_query_schema = "hive.ibis_sf1"

def preload(self):
# create buckets
subprocess.run(
[
"docker",
"compose",
"exec",
"minio",
"mc",
"mb",
"--ignore-existing",
"trino/warehouse",
],
check=True,
)

# copy files to the minio host
super().preload()

Expand All @@ -74,11 +60,11 @@ def preload(self):
"docker",
"compose",
"exec",
"minio",
self.service_name,
"mc",
"cp",
f"{self.data_volume}/{path.name}",
f"trino/warehouse/{dirname}/{path.name}",
f"data/trino/{dirname}/{path.name}",
],
check=True,
)
Expand Down

0 comments on commit a8164d2

Please sign in to comment.