Skip to content

Commit

Permalink
Merge branch 'master' into fix-binary
Browse files Browse the repository at this point in the history
  • Loading branch information
imbajin committed Mar 24, 2023

Verified

This commit was signed with the committer’s verified signature.
Kubuxu Jakub Sztandera
2 parents ff5c6d0 + 4c52401 commit 38993bd
Showing 8 changed files with 77 additions and 132 deletions.
11 changes: 7 additions & 4 deletions .asf.yaml
Original file line number Diff line number Diff line change
@@ -52,8 +52,11 @@ github:
required_approving_review_count: 2

notifications:
# use https://selfserve.apache.org to manage it
pullrequests_status: [email protected]
# Note: before use the config, we need ensure the "mail" address has set well (exist)
#pullrequests_comment: [email protected]
#issues: [email protected]
#discussions: [email protected]
pullrequests_comment: [email protected]
pullrequests_bot_dependabot: [email protected]
issues: [email protected]
issues_status: [email protected]
issues_comment: [email protected]
discussions: [email protected]
8 changes: 8 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -85,3 +85,11 @@ jobs:

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@
## Modules

- [hugegraph-loader](./hugegraph-loader): Loading datasets into the HugeGraph from multiple data sources.
- [hugegraph-hubble](./hugegraph-hubble): Online HugeGraph management and analysis dashboard (Include: data loading, schema management, graph traverser and display)
- [hugegraph-hubble](./hugegraph-hubble): Online HugeGraph management and analysis dashboard (Include: data loading, schema management, graph traverser and display). We can use `docker run -itd --name=hubble -p 8088:8088 hugegraph/hubble` to quickly start [hubble](https://hub.docker.com/r/hugegraph/hubble).
- [hugegraph-tools](./hugegraph-tools): Command line tool for deploying, managing and backing-up/restoring graphs from HugeGraph.
- [hugegraph-client](./hugegraph-client): A Java-written client for HugeGraph, providing `RESTful` APIs for accessing graph vertex/edge/schema/gremlin/variables and traversals etc.

## Maven Dependencies

You could use import the dependencies in maven like this
You could use import the dependencies in `maven` like this:

```xml
<dependency>
32 changes: 19 additions & 13 deletions hugegraph-hubble/Dockerfile
Original file line number Diff line number Diff line change
@@ -5,30 +5,36 @@
# 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
#
# 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.
#

FROM ubuntu:xenial
FROM maven:3.9.0-eclipse-temurin-11 AS build

RUN set -x \
&& apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
curl \
lsof \
g++ \
gcc \
openjdk-8-jdk \
&& apt-get install -y nodejs npm \
&& npm install --global yarn \
&& apt-get clean

ENV HUBBLE_HOME /opt/hugegraph-hubble
WORKDIR ${HUBBLE_HOME}
COPY . /pkg
WORKDIR /pkg

COPY ./hugegraph-hubble $HUBBLE_HOME
EXPOSE 8088
RUN set -x \
&& cd /pkg/hugegraph-hubble/ \
&& mvn package -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true

ENTRYPOINT ["./bin/start-hubble.sh"]

FROM openjdk:11-slim

COPY --from=build /pkg/hugegraph-hubble/apache-hugegraph-hubble-incubating-*/ /hubble
WORKDIR /hubble/

EXPOSE 8088
ENTRYPOINT ["./bin/start-hubble.sh", "-f true"]
10 changes: 7 additions & 3 deletions hugegraph-hubble/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# hugegraph-hubble
# Apache HugeGraph-Hubble

[![License](https://img.shields.io/badge/license-Apache%202-0E78BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://travis-ci.org/hugegraph/hugegraph-hubble.svg?branch=master)](https://travis-ci.org/hugegraph/hugegraph-hubble)
[![codecov](https://codecov.io/gh/hugegraph/hugegraph-hubble/branch/master/graph/badge.svg)](https://codecov.io/gh/hugegraph/hugegraph-hubble)
[![hugegraph-hubble-ci](https://github.com/apache/incubator-hugegraph-toolchain/actions/workflows/hubble-ci.yml/badge.svg?branch=master)](https://github.com/apache/incubator-hugegraph-toolchain/actions/workflows/hubble-ci.yml)
[![CodeQL](https://github.com/apache/incubator-hugegraph-toolchain/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/apache/incubator-hugegraph-toolchain/actions/workflows/codeql-analysis.yml)

hugegraph-hubble is a graph management and analysis platform that provides features: graph data load, schema management, graph relationship analysis and graphical display.

@@ -13,6 +13,10 @@ hugegraph-hubble is a graph management and analysis platform that provides featu
- Schema management, supporting to easily perform schema manipulation and display
- Graph analysis and graphical display, supporting to build query via the gremlin or algorithms with a little effort then will get cool graphical results

## Quick Start

We can use `docker run -itd --name=hubble -p 8088:8088 hugegraph/hubble` to quickly start [hubble](https://hub.docker.com/r/hugegraph/hubble).

## Doc

[The hubble homepage](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/) contains more information about it.
71 changes: 34 additions & 37 deletions hugegraph-hubble/hubble-dist/assembly/static/bin/start-hubble.sh
Original file line number Diff line number Diff line change
@@ -30,13 +30,6 @@ PID_FILE=${BIN_PATH}/pid

. "${BIN_PATH}"/common_functions

print_usage() {
echo " usage: start-hubble.sh [options]"
echo " options: "
echo " -d,--debug Start program in debug mode"
echo " -h,--help Display help information"
}

java_env_check

if [[ ! -d ${LOG_PATH} ]]; then
@@ -49,49 +42,53 @@ for jar in "${LIB_PATH}"/*.jar; do
class_path=${class_path}:${jar}
done

java_opts="-Xms512m"
java_debug_opts=""
while [[ $# -gt 0 ]]; do
case $1 in
--help|-help|-h)
print_usage
exit 0
;;
--debug|-d)
java_debug_opts=" -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
;;
JAVA_OPTS="-Xms512m"
JAVA_DEBUG_OPTS=""
FOREGROUND="false"

while getopts "f:d" arg; do
case ${arg} in
f) FOREGROUND="$OPTARG" ;;
d) JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" ;;
?) echo "USAGE: $0 [-f true|false] [-d] " && exit 1 ;;
esac
shift
done

if [[ -f ${PID_FILE} ]] ; then
pid=$(cat "${PID_FILE}")
if kill -0 "${pid}" > /dev/null 2>&1; then
echo "HugeGraphHubble is running as process ${pid}, please stop it first!"
PID=$(cat "${PID_FILE}")
if kill -0 "${PID}" > /dev/null 2>&1; then
echo "HugeGraphHubble is running as process ${PID}, please stop it first!"
exit 1
else
rm "${PID_FILE}"
fi
fi

main_class="org.apache.hugegraph.HugeGraphHubble"
args=${CONF_PATH}/hugegraph-hubble.properties
log=${LOG_PATH}/hugegraph-hubble.log
MAIN_CLASS="org.apache.hugegraph.HugeGraphHubble"
ARGS=${CONF_PATH}/hugegraph-hubble.properties
LOG=${LOG_PATH}/hugegraph-hubble.log

if [[ $FOREGROUND == "false" ]]; then
echo "Starting Hubble in daemon mode..."
nice -n 0 java -server ${JAVA_OPTS} ${JAVA_DEBUG_OPTS} -Dhubble.home.path="${HOME_PATH}" \
-cp ${class_path} ${MAIN_CLASS} ${ARGS} > ${LOG} 2>&1 < /dev/null &
else
echo "Starting Hubble in foreground mode..."
nice -n 0 java -server ${JAVA_OPTS} ${JAVA_DEBUG_OPTS} -Dhubble.home.path="${HOME_PATH}" \
-cp ${class_path} ${MAIN_CLASS} ${ARGS} > ${LOG} 2>&1 < /dev/null
fi

echo -n "starting HugeGraphHubble "
nohup nice -n 0 java -server ${java_opts} ${java_debug_opts} -Dhubble.home.path="${HOME_PATH}" \
-cp ${class_path} ${main_class} ${args} > ${log} 2>&1 < /dev/null &
pid=$!
echo ${pid} > "${PID_FILE}"
PID=$!
echo ${PID} > "${PID_FILE}"

# wait hubble start
timeout_s=30
server_host=$(read_property "${CONF_PATH}"/hugegraph-hubble.properties hubble.host)
server_port=$(read_property "${CONF_PATH}"/hugegraph-hubble.properties hubble.port)
server_url="http://${server_host}:${server_port}/actuator/health"
TIMEOUT_S=30
SERVER_HOST=$(read_property "${CONF_PATH}"/hugegraph-hubble.properties hubble.host)
SERVER_PORT=$(read_property "${CONF_PATH}"/hugegraph-hubble.properties hubble.port)
SERVER_URL="http://${SERVER_HOST}:${SERVER_PORT}/actuator/health"

wait_for_startup "${server_url}" ${timeout_s} || {
cat "${log}"
wait_for_startup "${SERVER_URL}" ${TIMEOUT_S} || {
cat "${LOG}"
exit 1
}
echo "logging to ${log}, please check it"
echo "logging to ${LOG}, please check it"
58 changes: 0 additions & 58 deletions hugegraph-hubble/hubble-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -120,64 +120,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${docker.build.skip}</skip>
<executable>docker</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>--no-cache</argument>
<argument>-t</argument>
<argument>${docker.hub}/${top.level.dir}:${docker.tag}</argument>
<argument>-t</argument>
<argument>${docker.hub}/${top.level.dir}:latest</argument>
<argument>${project.basedir}</argument>
<argument>--file=../Dockerfile</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>docker-push</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${docker.push.skip}</skip>
<environmentVariables>
<DOCKER_BUILDKIT>1</DOCKER_BUILDKIT>
</environmentVariables>
<executable>docker</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>--no-cache</argument>
<argument>--push</argument>
<argument>-t</argument>
<argument>${docker.hub}/${top.level.dir}:${docker.tag}</argument>
<argument>-t</argument>
<argument>${docker.hub}/${top.level.dir}:latest</argument>
<argument>${project.basedir}</argument>
<argument>--file=../Dockerfile</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
15 changes: 0 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -517,19 +517,4 @@
<!-- </testResource>-->
<!-- </testResources>-->
</build>

<repositories>
<repository>
<id>staged-releases</id>
<name>staged-releases</name>
<url>https://repository.apache.org/content/groups/staging/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>

0 comments on commit 38993bd

Please sign in to comment.