-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#434] feat(CI): Graviton Trino connector E2E testing #616
Changes from all commits
69556df
8311ed0
0e867a7
d355c6c
ea76b6d
234fad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- | ||
Copyright 2023 Datastrato. | ||
This software is licensed under the Apache License version 2. | ||
--> | ||
|
||
# Mac Docker Connector | ||
Because Docker Desktop for Mac does not provide access to container IP from host(macOS). | ||
This can result in host(macOS) and containers not being able to access each other's internal services directly over IPs. | ||
The [mac-docker-connector](https://github.com/wenjunxiao/mac-docker-connector) provides the ability for the macOS host to directly access the docker container IP. | ||
Before running the integration tests, make sure to execute the `dev/docker/tools/mac-docker-connector.sh` script. | ||
> Developing Gravitino in a linux environment does not have this limitation and does not require executing the `mac-docker-connector.sh` script ahead of time. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
#set -ex | ||
|
||
bin="$(dirname "${BASH_SOURCE-$0}")" | ||
bin="$(cd "${bin}">/dev/null; pwd)" | ||
|
||
OS=$(uname -s) | ||
if [ "${OS}" != "Darwin" ]; then | ||
echo "Only macOS needs to run mac-docker-connector." | ||
exit 1 | ||
fi | ||
|
||
if pgrep -xq "docker-connector"; then | ||
echo "docker-connector is running." | ||
exit 1 | ||
fi | ||
|
||
# Download docker-connector | ||
DOCKER_CONNECTOR_PACKAGE_NAME="docker-connector-darwin.tar.gz" | ||
DOCKER_CONNECTOR_DOWNLOAD_URL="https://github.com/wenjunxiao/mac-docker-connector/releases/download/v3.2/${DOCKER_CONNECTOR_PACKAGE_NAME}" | ||
if [ ! -f "${bin}/docker-connector" ]; then | ||
wget -q -P "${bin}" ${DOCKER_CONNECTOR_DOWNLOAD_URL} | ||
tar -xzf "${bin}/${DOCKER_CONNECTOR_PACKAGE_NAME}" -C "${bin}" | ||
rm -rf "${bin}/${DOCKER_CONNECTOR_PACKAGE_NAME}" | ||
fi | ||
|
||
# Create a docker-connector.conf file with the routes to the docker networks | ||
if [ ! -f "${bin}/docker-connector.conf" ]; then | ||
docker network ls --filter driver=bridge --format "{{.ID}}" | xargs docker network inspect --format "route {{range .IPAM.Config}}{{.Subnet}}{{end}}" > ${bin}/docker-connector.conf | ||
fi | ||
|
||
echo "Start docker-connector requires root privileges, Please enter the root password." | ||
sudo ${bin}/docker-connector -config ${bin}/docker-connector.conf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = gravitino | ||
gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT | ||
gravitino.metalake = GRAVITINO_METALAKE_NAME |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = hive | ||
hive.metastore.uri = thrift://HIVE_HOST_IP:9083 | ||
hive.allow-drop-table = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = jmx |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = tpcds | ||
tpcds.splits-per-node = 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = tpch | ||
tpch.splits-per-node = 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
#single node install config | ||
#coordinator = true | ||
#node-scheduler.include-coordinator = true | ||
#http-server.http.port = 8080 | ||
#discovery-server.enabled = true | ||
#discovery.uri = http://localhost:8080 | ||
#protocol.v1.alternate-header-name = Presto | ||
#hive.hdfs.impersonation.enabled = true | ||
coordinator = true | ||
node-scheduler.include-coordinator = true | ||
http-server.http.port = 8080 | ||
discovery.uri = http://0.0.0.0:8080 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
-server | ||
-Xmx1G | ||
-XX:-UseBiasedLocking | ||
-XX:+UseG1GC | ||
-XX:G1HeapRegionSize=32M | ||
-XX:+ExplicitGCInvokesConcurrent | ||
-XX:+HeapDumpOnOutOfMemoryError | ||
-XX:+UseGCOverheadLimit | ||
-XX:+ExitOnOutOfMemoryError | ||
-XX:ReservedCodeCacheSize=256M | ||
-Djdk.attach.allowAttachSelf=true | ||
-Djdk.nio.maxCachedBufferSize=2000000 | ||
-DHADOOP_USER_NAME=hive | ||
-Dlog4j.configurationFile=/etc/trino/log4j2.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
# Enable verbose logging from Trino | ||
io.trino = INFO |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
|
||
# Set to debug or trace if log4j initialization is failing | ||
status = info | ||
|
||
# Name of the configuration | ||
name = ConsoleLogConfig | ||
|
||
# Console appender configuration | ||
appender.console.type = Console | ||
appender.console.name = consoleLogger | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | ||
|
||
# File appender configuration | ||
appender.file.type = File | ||
appender.file.name = fileLogger | ||
appender.file.fileName = gravitino-trino-connector.log | ||
appender.file.layout.type = PatternLayout | ||
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | ||
|
||
# Root logger level | ||
rootLogger.level = info | ||
|
||
# Root logger referring to console and file appenders | ||
rootLogger.appenderRef.stdout.ref = consoleLogger | ||
rootLogger.appenderRef.file.ref = fileLogger |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
node.environment = docker | ||
node.data-dir = /data/trino | ||
plugin.dir = /usr/lib/trino/plugin |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,12 +82,30 @@ Run only test cases where tag is set `gravitino-docker-it`. [embbeded|deplo | |
--------------------------------------------------------------- | ||
``` | ||
|
||
If Docker is not installed or the `mac docker connector` is not running, the `./gradlew test -PtestMode=[embedded|deploy]` | ||
command will skip the test cases that depend on the `mac docker connector`. | ||
|
||
```text | ||
------------------- Check Docker environment ------------------ | ||
Docker server status .......................................... [running] | ||
Gravitino IT Docker container is already running ............... [no] | ||
Run only test cases where tag is set `gravitino-trino-it`. [embbeded|deploy test] | ||
--------------------------------------------------------------- | ||
``` | ||
|
||
> Gravitino will run all integration test cases in the GitHub Actions environment. | ||
|
||
### Running Gravitino CI Docker Environment | ||
|
||
Before running the tests, make sure Docker is installed. | ||
|
||
#### Mac Docker connector | ||
Because Docker Desktop for Mac does not provide access to container IP from host(macOS). | ||
The [mac-docker-connector](https://github.com/wenjunxiao/mac-docker-connector) provides the ability for the macOS host to directly access the docker container IP. | ||
This can result in host(macOS) and containers not being able to access each other's internal services directly over IPs. | ||
Before running the integration tests, make sure to execute the `dev/docker/tools/mac-docker-connector.sh` script. | ||
> Developing Gravitino in a linux environment does not have this limitation and does not require executing the `mac-docker-connector.sh` script ahead of time. | ||
|
||
#### Running Gravitino Hive CI Docker Environment | ||
|
||
1. Run a hive docker test environment container in the local using the `docker run --rm -d -p 8022:22 -p 8088:8088 -p 9000:9000 -p 9083:9083 -p 10000:10000 -p 10002:10002 -p 50010:50010 -p 50070:50070 -p 50075:50075 datastrato/gravitino-ci-hive` command. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add the doc about how to run trino integration test locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I updated you about how to run the Trino integration test in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you have to change the paragraph title. Here it only mentions the "Hive CI Docker". Another thing is that do we need to start a docker before running the integration test? I think you should reorganize the doc for others without background easy to run and hide details as much as you can. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that the gradle output doesn't match the description you mentioned here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested in these case:
Gravitino-hive-ci
docker container andmac-docker-connector
running.Gravitino-hive-ci
docker containerGravitino-hive-ci
docker container andmac-docker-connector
Other, I will reconstruction HiveCatalogIT code and document in the #639
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see, but there's a typo "tirno".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I fixed it.