Skip to content

Commit

Permalink
Clean up and fix Java dependency problems (#2384)
Browse files Browse the repository at this point in the history
- Make dependencies and plugins in sub module use version defined in
parent pom.
- Resolve a lot of problems detected by `mvn dependency: analyze`
- Get rid of `org.json` and `fastjson`, unify json libraries to Jackson.
- Bump up protoc versions in order to download aarch binaries.
- Scope of odps related jars set to `provided`
- Make some test-only dependencies use scope `test`
- Remove some unused files.

Fixes #2378
  • Loading branch information
siyuan0322 committed Jan 18, 2023
1 parent da15649 commit 7836d85
Show file tree
Hide file tree
Showing 70 changed files with 928 additions and 1,590 deletions.
1 change: 0 additions & 1 deletion .github/workflows/gss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
cd interactive_engine/groot-server
mvn test -P gremlin-test
- name: Build GraphScope Store
run: |
source ${HOME}/.bashrc
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/k8s-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ jobs:
export GS_ADDR=${NODE_IP}:${NODE_PORT}
cd ${GITHUB_WORKSPACE}/python
python3 -m pytest -s -vvv ./graphscope/tests/kubernetes/test_demo_script.py -k test_helm_installation
helm delete graphscope
- name: Kubernetes Test
env:
Expand Down Expand Up @@ -590,10 +591,6 @@ jobs:
name: gie-experimental
path: artifacts

- name: Display structure of downloaded files
run: ls -R
working-directory: artifacts

- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
Expand Down
6 changes: 0 additions & 6 deletions interactive_engine/benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-driver</artifactId>
<version>3.4.2</version>
</dependency>
</dependencies>

Expand All @@ -37,11 +36,6 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.alibaba.graphscope.gaia.utils.PropertyUtil;
import com.alibaba.graphscope.gaia.utils.QueryUtil;

import org.apache.commons.lang3.StringUtils;
import org.apache.tinkerpop.gremlin.driver.Client;
import org.apache.tinkerpop.gremlin.driver.Cluster;
import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
Expand Down Expand Up @@ -67,7 +66,8 @@ public MyRunnable(String endpoint, String username, String password) {
.addContactPoint(address[0])
.port(Integer.parseInt(address[1]))
.serializer(initializeSerialize());
if (StringUtils.isNotEmpty(username) && StringUtils.isNotEmpty(password)) {
if (!(username == null || username.isEmpty())
&& !(password == null || password.isEmpty())) {
cluster.credentials(username, password);
}
client = cluster.create().connect();
Expand Down
52 changes: 8 additions & 44 deletions interactive_engine/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,24 @@

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>com.alibaba.graphscope</groupId>
<artifactId>sdk-common</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-paranamer</artifactId>
</dependency>

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<scope>test</scope>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-shaded</artifactId>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</dependency>
<dependency>
<groupId>de.javakaffee</groupId>
<artifactId>kryo-serializers</artifactId>
</dependency>

<dependency>
<groupId>com.alibaba.graphscope</groupId>
<artifactId>sdk-common</artifactId>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@
import com.alibaba.graphscope.sdkcommon.util.JSON;
import com.google.common.collect.ImmutableMap;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;

// singleton to parse ir schema in json format from GraphSchema
public class IrSchemaParser {
private static final Logger logger = LoggerFactory.getLogger(IrSchemaParser.class);

private static IrSchemaParser instance = new IrSchemaParser();
private static final IrSchemaParser instance = new IrSchemaParser();

public static IrSchemaParser getInstance() {
return instance;
Expand All @@ -47,24 +43,13 @@ public String parse(GraphSchema graphSchema) {
List<GraphEdge> edges = graphSchema.getEdgeList();
List entities = new ArrayList();
List relations = new ArrayList();
vertices.forEach(
v -> {
entities.add(getVertex(graphSchema, v));
});
edges.forEach(
e -> {
relations.add(getEdge(graphSchema, e));
});
Map<String, Object> schemaMap =
ImmutableMap.of(
"entities",
entities,
"relations",
relations,
"is_table_id",
true,
"is_column_id",
true);
vertices.forEach(v -> entities.add(getVertex(graphSchema, v)));
edges.forEach(e -> relations.add(getEdge(graphSchema, e)));
Map<String, Object> schemaMap = new HashMap<>();
schemaMap.put("entities", entities);
schemaMap.put("relations", relations);
schemaMap.put("is_table_id", true);
schemaMap.put("is_column_id", true);
return JSON.toJson(schemaMap);
}

Expand Down Expand Up @@ -127,7 +112,7 @@ private boolean isPrimaryKey(
boolean isPrimaryKey = false;
if (primaryKeys != null && !primaryKeys.isEmpty()) {
for (GraphProperty key : primaryKeys) {
if (StringUtils.equals(propertyName, key.getName())) {
if (propertyName.equals(key.getName())) {
isPrimaryKey = true;
break;
}
Expand Down
15 changes: 4 additions & 11 deletions interactive_engine/compiler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ else
java:=$(JAVA_HOME)/bin/java
endif

OSFLAG :=
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)

Expand All @@ -18,15 +17,9 @@ rpc.target:=start_rpc_server

target.revision:=0.0.1-SNAPSHOT

ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_M),arm64)
OSFLAG += -Dos.detected.classifier=osx-x86_64
endif
endif

build:
cd $(CUR_DIR)/.. && \
mvn clean install -DskipTests -Drevision=${target.revision} -Pexperimental --quiet $(OSFLAG) && \
mvn clean install -DskipTests -Drevision=${target.revision} -Pexperimental --quiet && \
cd $(CUR_DIR)/../executor/ir/integrated && cargo build --release --bin $(rpc.target)

clean:
Expand All @@ -42,7 +35,7 @@ test:
# start rpc server
# make run
gremlin_test:
mvn test -Dtest=com.alibaba.graphscope.integration.IrGremlinTest $(OSFLAG)
mvn test -Dtest=com.alibaba.graphscope.integration.IrGremlinTest

submit:
cd $(CUR_DIR) && $(java) \
Expand All @@ -62,11 +55,11 @@ run:
# start rpc server
# make run graph.schema:=../executor/ir/core/resource/ldbc_schema.json
ldbc_test:
mvn test -Dtest=com.alibaba.graphscope.integration.ldbc.IrLdbcTest $(OSFLAG)
mvn test -Dtest=com.alibaba.graphscope.integration.ldbc.IrLdbcTest

# start rpc server
# make run graph.schema:=../executor/ir/core/resource/ldbc_schema.json
pattern_test:
mvn test -Dtest=com.alibaba.graphscope.integration.pattern.IrPatternTest $(OSFLAG)
mvn test -Dtest=com.alibaba.graphscope.integration.pattern.IrPatternTest

.PHONY: build run
Loading

0 comments on commit 7836d85

Please sign in to comment.