This is an automated email from the ASF dual-hosted git repository.
zhaocong pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git
The following commit(s) were added to refs/heads/master by this push:
new 313d7e1a feat(spark): install hugegraph from source (#552)
313d7e1a is described below
commit 313d7e1a7b342bc86aea73c7e3c2ac5fe2fc1581
Author: Liu Xiao <[email protected]>
AuthorDate: Tue Dec 12 15:51:58 2023 +0800
feat(spark): install hugegraph from source (#552)
---
.github/workflows/spark-connector-ci.yml | 6 ++-
hugegraph-loader/assembly/descriptor/assembly.xml | 3 --
hugegraph-spark-connector/README.md | 2 +-
.../travis/install-hugegraph-from-source.sh | 57 ++++++++++++++++++++++
hugegraph-spark-connector/pom.xml | 6 +++
5 files changed, 68 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/spark-connector-ci.yml
b/.github/workflows/spark-connector-ci.yml
index 072a7094..b3408070 100644
--- a/.github/workflows/spark-connector-ci.yml
+++ b/.github/workflows/spark-connector-ci.yml
@@ -1,6 +1,7 @@
name: "spark-connector-ci"
on:
+ workflow_dispatch:
push:
branches:
- master
@@ -25,9 +26,10 @@ jobs:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-spark-connector/assembly/travis
VERSION_ID: 1.0.0
+ COMMIT_ID: bfe9fae150446857412db23ada0dae9d05035837
steps:
- name: Install JDK 11
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
@@ -56,7 +58,7 @@ jobs:
- name: Prepare env and service
run: |
- $TRAVIS_DIR/install-hugegraph-from-tar.sh $VERSION_ID
+ $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
- name: Run test
run: |
diff --git a/hugegraph-loader/assembly/descriptor/assembly.xml
b/hugegraph-loader/assembly/descriptor/assembly.xml
index efac0b5c..62fe6793 100644
--- a/hugegraph-loader/assembly/descriptor/assembly.xml
+++ b/hugegraph-loader/assembly/descriptor/assembly.xml
@@ -48,9 +48,6 @@
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
- <excludes>
- <exclude>hugegraph-loader-1.0.0.jar</exclude>
- </excludes>
<includes>
<include>*.jar</include>
</includes>
diff --git a/hugegraph-spark-connector/README.md
b/hugegraph-spark-connector/README.md
index 4cfc3b2c..10b224aa 100644
--- a/hugegraph-spark-connector/README.md
+++ b/hugegraph-spark-connector/README.md
@@ -190,4 +190,4 @@ Common Configs contains some common configurations.
## Licence
-The same as HugeGraph, hugegraph-spark-connector is also licensed under Apache
2.0 License.
\ No newline at end of file
+The same as HugeGraph, hugegraph-spark-connector is also licensed under Apache
2.0 License.
diff --git
a/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh
b/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh
new file mode 100755
index 00000000..202f4569
--- /dev/null
+++ b/hugegraph-spark-connector/assembly/travis/install-hugegraph-from-source.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to You under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+set -ev
+
+if [[ $# -ne 1 ]]; then
+ echo "Must input an existing commit id of hugegraph server" && exit 1
+fi
+
+COMMIT_ID=$1
+HUGEGRAPH_GIT_URL="https://github.com/apache/hugegraph.git"
+
+git clone --depth 150 ${HUGEGRAPH_GIT_URL} hugegraph
+cd hugegraph
+git checkout "${COMMIT_ID}"
+mvn package -DskipTests -Dmaven.javadoc.skip=true -ntp
+# TODO: lack incubator after apache package release (update it later)
+mv apache-hugegraph-*.tar.gz ../
+cd ../
+rm -rf hugegraph
+tar zxf apache-hugegraph-*.tar.gz
+
+HTTPS_SERVER_DIR="hugegraph_https"
+mkdir ${HTTPS_SERVER_DIR}
+# TODO: lack incubator after apache package release (update it later)
+cp -r apache-hugegraph-*/. ${HTTPS_SERVER_DIR}
+cd "$(find apache-hugegraph-* | head -1)"
+# start HugeGraphServer with http protocol
+bin/init-store.sh || exit 1
+bin/start-hugegraph.sh || exit 1
+
+cd ../${HTTPS_SERVER_DIR}
+REST_SERVER_CONFIG="conf/rest-server.properties"
+GREMLIN_SERVER_CONFIG="conf/gremlin-server.yaml"
+sed -i "s?http://127.0.0.1:8080?https://127.0.0.1:8443?g" "$REST_SERVER_CONFIG"
+sed -i "s/rpc.server_port=8091/rpc.server_port=8092/g" "$REST_SERVER_CONFIG"
+sed -i "s/#port: 8182/port: 8282/g" "$GREMLIN_SERVER_CONFIG"
+echo "gremlinserver.url=http://127.0.0.1:8282" >> ${REST_SERVER_CONFIG}
+
+# start HugeGraphServer with https protocol
+bin/init-store.sh
+bin/start-hugegraph.sh
+cd ../
diff --git a/hugegraph-spark-connector/pom.xml
b/hugegraph-spark-connector/pom.xml
index b5e249b0..1ce5b6d2 100644
--- a/hugegraph-spark-connector/pom.xml
+++ b/hugegraph-spark-connector/pom.xml
@@ -28,7 +28,13 @@
<artifactId>hugegraph-spark-connector</artifactId>
<packaging>jar</packaging>
+
<name>${project.artifactId}</name>
+
<url>https://github.com/apache/hugegraph-toolchain/tree/master/hugegraph-spark-connector</url>
+ <description>
+ hugegraph-spark-connector is a Spark connector application for reading
and writing HugeGraph data in Spark
+ standard format.
+ </description>
<properties>
<maven.compiler.source>8</maven.compiler.source>