Skip to content
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

Yingjianw/open port #615

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nebula-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# test against JDK 8
java: [ 8 ]
# test against JDK 17
java: [ 17 ]
name: CI with Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v1
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/nebula-pr-functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,33 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# test against JDK 8
java: [ 8 ]
# test against JDK 17
java: [17]
name: Functional tests with Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v1
- name: Setup jdk

- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- uses: actions/cache@v1
id: gradle-cache
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}
restore-keys: |
- ${{ runner.os }}-gradle-
${{ runner.os }}-gradle-

- uses: actions/cache@v1
id: gradle-wrapper-cache
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
restore-keys: |
- ${{ runner.os }}-gradlewrapper-
${{ runner.os }}-gradlewrapper-

- name: Build with Gradle
run: ./gradlew --info --stacktrace functionalTest
env:
Expand All @@ -38,7 +42,18 @@ jobs:
CI_BUILD_URL: 'https://github.com/${{ github.repository }}'
CI_BRANCH: ${{ github.ref }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ failure() }} |
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
- cat ./metacat-functional-tests/build/logs/metacat/spring.log

- name: Print Logs on Failure
if: failure()
run: |
name=$(date +"%Y-%m-%d")
cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
cat ./metacat-functional-tests/build/logs/metacat/spring.log

- name: Upload Test Report
if: failure()
uses: actions/upload-artifact@v4
with:
name: functional-test-report
path: metacat-functional-tests/build/reports/
4 changes: 2 additions & 2 deletions .github/workflows/nebula-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup jdk 8
- name: Setup jdk 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nebula-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# test against JDK 8
java: [ 8 ]
# test against JDK 17
java: [ 17 ]
name: CI with Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nebula-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 17
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ allprojects {

idea {
project {
jdkName = "8"
languageLevel = "8"
jdkName = "17"
languageLevel = "17"
vcs = "Git"
}
}
Expand All @@ -98,8 +98,8 @@ configure(javaProjects) {

group = "com.netflix.${githubProjectName}"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

dependencyManagement {
imports {
Expand Down Expand Up @@ -251,6 +251,7 @@ configure(javaProjects) {
exceptionFormat = "full"
events "PASSED", "FAILED", "SKIPPED"
}
jvmArgs('--add-opens=java.base/java.lang.invoke=ALL-UNNAMED')
}

javadoc {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Used in documentation and for including the Gradle plugin
spring_boot_version=2.7.11
spring_cloud_version=Hoxton.SR8
google_guice_version=4.1.0
google_guice_version=5.1.0
spock_version=2.1-groovy-3.0

## Override Spring Boot versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/**
* Hive base connector base service impl.
*
* @author zhenl
* @author zhenl]
* @since 1.0.0
*/
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public HiveMetastoreClientFactory(@Nullable final HostAndPort socksProxy,
}

private static Socket createSocksSocket(final HostAndPort proxy) {
final SocketAddress address = InetSocketAddress.createUnresolved(proxy.getHostText(), proxy.getPort());
final SocketAddress address = InetSocketAddress.createUnresolved(proxy.getHost(), proxy.getPort());
return new Socket(new Proxy(Proxy.Type.SOCKS, address));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.netflix.metacat.connector.polaris.configs.PolarisPersistenceConfig;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa;
Expand All @@ -23,6 +24,7 @@
/**
* Test PolarisConnectorTableService.
*/
@Disabled
@Slf4j
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {PolarisPersistenceConfig.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.netflix.metacat.connector.polaris.configs.PolarisPersistenceConfig;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa;
Expand All @@ -27,6 +28,7 @@
* Some of the tests cannot be run in unit test as it uses h2 database, which does not support all
* functionalities in crdb so include those tests here.
*/
@Disabled
@Slf4j
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {PolarisPersistenceConfig.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.netflix.metacat.connector.polaris.store.entities.PolarisDatabaseEntity;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa;
Expand All @@ -21,6 +22,7 @@
/**
* Test persistence operations on Database objects.
*/
@Disabled
@Slf4j
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {PolarisPersistenceConfig.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@
import lombok.Getter;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.data.auditing.AuditingHandler;
import org.springframework.data.auditing.DateTimeProvider;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Optional;
import java.util.Random;

import static org.mockito.Mockito.when;

/**
* Test persistence operations on Database objects.
*/
Expand All @@ -46,6 +55,20 @@ public class PolarisStoreConnectorTest {
@Autowired
private PolarisStoreConnector polarisConnector;

@MockBean
private DateTimeProvider dateTimeProvider;

@SpyBean
private AuditingHandler auditingHandler;

@BeforeEach
void beforeEach() {
// truncate audit time to micros to match DB so assertions will match
when(dateTimeProvider.getNow()).thenReturn(
Optional.of(Instant.now().truncatedTo(ChronoUnit.MILLIS)));
auditingHandler.setDateTimeProvider(dateTimeProvider);
}

public static String generateDatabaseName() {
return DB_NAME_FOO + "_" + random.nextLong();
}
Expand Down
1 change: 0 additions & 1 deletion metacat-connector-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
api("com.google.guava:guava")
api("com.google.inject:guice")
api("com.google.inject.extensions:guice-persist")
api("com.google.inject.extensions:guice-multibindings")
api("com.google.inject.extensions:guice-servlet")
api("joda-time:joda-time:2.10.10")
api("org.hibernate:hibernate-entitymanager")
Expand Down
18 changes: 13 additions & 5 deletions metacat-functional-tests/metacat-test-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
#
#

version: "2"

services:
metacat:
image: tomcat:8.0-jre8
image: tomcat:9.0-jre17
platform: linux/x86_64
depends_on:
- hive-metastore
- hive-metastore-db
Expand Down Expand Up @@ -85,6 +84,7 @@ services:
##TODO: We need to add them back with light images
hive-metastore-db:
image: mysql:5.7
platform: linux/x86_64
volumes:
- ./datastores/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
environment:
Expand All @@ -98,6 +98,7 @@ services:
- "com.netflix.metacat.oss.test"
postgresql:
image: postgres:9.6
platform: linux/x86_64
volumes:
- ./datastores/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
environment:
Expand All @@ -108,18 +109,20 @@ services:
- "com.netflix.metacat.oss.test"
hive-metastore:
image: danielbwatson/metacat-test-hive-metastore:1.0.0
platform: linux/x86_64
depends_on:
- hive-metastore-db
ports:
- '9083'
- '8005'
- '9083:9083'
- '8005:8005'
environment:
- HIVE_METASTORE_HADOOP_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8005 -Dhive.metastore.client.socket.timeout=60
labels:
- "com.netflix.metacat.oss.test"
- "com.netflix.metacat.oss.test.hive"
polaris-crdb:
image: cockroachdb/cockroach:v21.1.11
platform: linux/x86_64
ports:
- '26257:26257'
- '8081:8080'
Expand All @@ -129,6 +132,7 @@ services:
- "com.netflix.metacat.oss.polaris.crdb"
polaris-crdb-barrier:
image: martin/wait:latest
platform: linux/x86_64
depends_on:
- polaris-crdb
environment:
Expand All @@ -138,6 +142,7 @@ services:
- "com.netflix.metacat.oss.polaris.crdb-barrier"
polaris-crdb-init:
image: cockroachdb/cockroach:v21.1.11
platform: linux/x86_64
depends_on:
- polaris-crdb-barrier
volumes:
Expand All @@ -148,6 +153,7 @@ services:
- "com.netflix.metacat.oss.polaris.crdb-init"
storage-barrier:
image: martin/wait:latest
platform: linux/x86_64
depends_on:
- hive-metastore-db
- postgresql
Expand All @@ -158,6 +164,7 @@ services:
- "com.netflix.metacat.oss.test"
service-barrier:
image: martin/wait:latest
platform: linux/x86_64
depends_on:
- hive-metastore
environment:
Expand All @@ -166,6 +173,7 @@ services:
- "com.netflix.metacat.oss.test"
metacat-barrier:
image: martin/wait:latest
platform: linux/x86_64
depends_on:
- metacat
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ connector.name=hive
metacat.has-data-external=true

metacat.schema.whitelist=shard,shard1
hive.use.embedded.metastore=true
hive.use.embedded.metastore=false
hive.use.embedded.fastservice=true
hive.exec.compress.intermediate=true
hive.exec.max.dynamic.partitions.pernode=10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ metacat.thrift.port=12004
connector.name=hive
metacat.has-data-external=true

hive.use.embedded.metastore=true
hive.use.embedded.metastore=false
hive.use.embedded.fastservice=true
hive.exec.compress.intermediate=true
hive.exec.max.dynamic.partitions.pernode=10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ metacat.thrift.port=12003
connector.name=hive
metacat.has-data-external=true

hive.use.embedded.metastore=true
hive.use.embedded.metastore=false
hive.use.embedded.fastservice=true
hive.exec.compress.intermediate=true
hive.exec.max.dynamic.partitions.pernode=10000
Expand Down
Loading