-
Notifications
You must be signed in to change notification settings - Fork 387
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
[#198] test: Add Catalog-hive e2e integration test #308
Changes from 6 commits
da87b55
a2dbed7
dfb5151
bb3365d
7dbd22d
b60f530
922cc96
bcbe6c9
3095733
8431104
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,90 @@ | ||
name: Integration Test | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main", "branch-*" ] | ||
pull_request: | ||
branches: [ "main", "branch-*" ] | ||
|
||
env: | ||
HIVE2_IMAGE_NAME: datastrato/hive2 | ||
HIVE2_IMAGE_VERSION: 0.1.0 | ||
HIVE2_IMAGE_LATEST: latest | ||
|
||
concurrency: | ||
group: ${{ github.worklfow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_requests' }} | ||
|
||
jobs: | ||
# Integration test for AMD64 architecture | ||
test-amd64-arch: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
architecture: [linux/amd64] | ||
env: | ||
DOCKER_RUN_NAME: hive2-amd64 | ||
PLATFORM: ${{ matrix.architecture }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build the hive2 Docker image for AMD64 | ||
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. AMD64? 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. Most of the Docker Official Images on Docker Hub provide a variety of architecturesopen_in_new. For example, the busybox image supports amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, ppc64le, and s390x. When running this image on an x86_64 / amd64 machine, the amd64 variant is pulled and run. |
||
if: ${{ contains(github.event.pull_request.labels.*.name, 'build docker image') }} | ||
run: ./dev/docker/hive2/build-docker.sh --platform ${PLATFORM} --image ${HIVE2_IMAGE_NAME}:${HIVE2_IMAGE_LATEST} | ||
|
||
- name: Run AMD64 container | ||
run: | | ||
docker run --rm --name ${DOCKER_RUN_NAME} --platform ${PLATFORM} -d -p 8088:8088 -p 50070:50070 -p 50075:50075 -p 10000:10000 -p 10002:10002 -p 8888:8888 -p 9083:9083 -p 8022:22 ${HIVE2_IMAGE_NAME}:${HIVE2_IMAGE_LATEST} | ||
docker ps -a | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: '8.1.1' | ||
|
||
- name: Show gradle version | ||
run: gradle --version | ||
|
||
- name: Package Graviton | ||
run: | | ||
gradle build | ||
gradle compileDistribution | ||
|
||
- name: Setup Debug Action | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'debug action') }} | ||
xunliu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: csexton/debugger-action@master | ||
|
||
- name: Integration Test | ||
run: | | ||
gradle integrationTest | ||
|
||
- name: Print logs when Graviton integration tests failure | ||
if: ${{ failure() }} | ||
run: | | ||
if [ -f "distribution/package/logs/graviton-server.out" ]; then | ||
cat distribution/package/logs/graviton-server.out | ||
fi | ||
if [ -f "distribution/package/logs/graviton-server.log" ]; then | ||
cat distribution/package/logs/graviton-server.log | ||
fi | ||
|
||
- name: Stop and remove container | ||
run: | | ||
docker stop ${DOCKER_RUN_NAME} | ||
sleep 3 | ||
docker ps -a | ||
docker rmi ${HIVE2_IMAGE_NAME}:${HIVE2_IMAGE_LATEST} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2023 Datastrato. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.graviton.catalog.hive; | ||
|
||
import com.datastrato.graviton.Config; | ||
import com.datastrato.graviton.config.ConfigBuilder; | ||
import com.datastrato.graviton.config.ConfigEntry; | ||
|
||
public class HiveCatalogConfig extends Config { | ||
public static final ConfigEntry<String> HADOOP_USER_NAME = | ||
new ConfigBuilder("graviton.hadoop.user.name") | ||
.doc( | ||
"The specify Hadoop user name that will be used when accessing Hadoop Distributed File System (HDFS).") | ||
.version("0.1.0") | ||
.stringConf() | ||
.createWithDefault("hive"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,13 @@ public void initialize(Map<String, String> conf) throws RuntimeException { | |
conf.forEach(hadoopConf::set); | ||
hiveConf = new HiveConf(hadoopConf, HiveCatalogOperations.class); | ||
|
||
// TODO(xun): Wait add Graviton User Account System to manage user and group | ||
// The specify Hadoop user name that will be used when accessing Hadoop | ||
// Distributed File System (HDFS). | ||
if (conf.containsKey(HiveCatalogConfig.HADOOP_USER_NAME.getKey())) { | ||
System.setProperty("HADOOP_USER_NAME", conf.get(HiveCatalogConfig.HADOOP_USER_NAME.getKey())); | ||
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. Why do we need this? 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. The specific Hadoop user name that will be used when accessing Hadoop Distributed File System (HDFS). 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. Is it possible that we remove this configuration and use some other ways to bypass this issue? I don't think using configuration here is a good idea? 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. Is it possible that we set this property in the test? 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. Modify to set |
||
} | ||
|
||
// todo(xun): add hive client pool size in config | ||
this.clientPool = new HiveClientPool(1, hiveConf); | ||
} | ||
|
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.
What's usage of "HIVE_IMAGE_VERSION" and "HIVE_IMAGE_LATEST"
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.
Many places needs to use it.
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.
My question is that "HIVE2_IMAGE_VERSION" seemed not used in this script. Also seems "HIVE_IMAGE_VERSION" and "HIVE_IMAGE_LATEST" they all point to the version things, do we need to unify them?
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.
Just a reminder that with ASF projects you can only publish releases to Docker and can't refer to the latest. If we go with publishing the latest we'll need to change that when we enter the ASF incubator.
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 modify this code.