imbajin commented on code in PR #530: URL: https://github.com/apache/incubator-hugegraph-toolchain/pull/530#discussion_r1384273482
########## hugegraph-loader/Dockerfile: ########## @@ -0,0 +1,51 @@ +# +# 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. +# + +FROM maven:3.9.0-eclipse-temurin-11 AS build + +COPY . /pkg +WORKDIR /pkg + +RUN set -x \ + && mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp + + +RUN set -x \ + && cd /pkg/hugegraph-loader/ \ + && echo "$(ls)" \ + && mvn clean package -DskipTests + + +FROM openjdk:11-slim + +COPY --from=build /pkg/hugegraph-loader/apache-hugegraph-loader-incubating-*/ /loader +WORKDIR /loader/ + +RUN set -x \ + && apt-get -q update \ + && apt-get -q install -y --no-install-recommends --no-install-suggests \ + dumb-init \ + procps \ + curl \ + lsof \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +VOLUME /loader + +ENTRYPOINT ["/usr/bin/dumb-init", "--"] +CMD [ "/bin/bash" ] Review Comment: maybe check other usage way for `dumb-init` ? ########## hugegraph-loader/README.md: ########## @@ -7,15 +7,121 @@ hugegraph-loader is a customizable command line utility for loading small to medium size graph datasets into the HugeGraph database from multiple data sources with various input formats. -## Features +## 1. Features - Multiple data sources, such as local file(path), HDFS file(path), MySQL - Various input formats, such as json, csv, and text with any delimiters. - Diverse options, with which users can manage the data loading intuitively. - Detecting schema from data automatically, reduce the complex work of schema management. - Advanced customized operations with groovy script, users can configure how to construct vertices and edges by themselves. -## Building +## 2. Usage for Docker(Recommand) + +- deploy `loader` with Docker Review Comment: ```suggestion - run `loader` with Docker ``` ########## hugegraph-loader/Dockerfile: ########## @@ -0,0 +1,51 @@ +# +# 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. +# + +FROM maven:3.9.0-eclipse-temurin-11 AS build + +COPY . /pkg +WORKDIR /pkg + +RUN set -x \ + && mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp Review Comment: > It seems that in the center maven repo, the client-1.0.0 does not have some methods like `istext()`. Hence, we should install the jar locally. seems we don't rely on fixed version? we use `$revision` in the project, so install client first is necessary (if we want build the latest image) ########## hugegraph-loader/README.md: ########## Review Comment: consider also add a new section (run with docker) in root (README) https://github.com/apache/incubator-hugegraph-toolchain/blob/master/README.md#modules and keep the `module` section clear <img width="967" alt="image" src="https://github.com/apache/incubator-hugegraph-toolchain/assets/17706099/0ac8d5a7-025a-4c55-9f38-4a5158cc6185"> ########## hugegraph-loader/README.md: ########## @@ -7,15 +7,121 @@ hugegraph-loader is a customizable command line utility for loading small to medium size graph datasets into the HugeGraph database from multiple data sources with various input formats. -## Features +## 1. Features - Multiple data sources, such as local file(path), HDFS file(path), MySQL - Various input formats, such as json, csv, and text with any delimiters. - Diverse options, with which users can manage the data loading intuitively. - Detecting schema from data automatically, reduce the complex work of schema management. - Advanced customized operations with groovy script, users can configure how to construct vertices and edges by themselves. -## Building +## 2. Usage for Docker(Recommand) + +- deploy `loader` with Docker + - Docker run + - Docker-compose +- Load data in docker container `loader` + +### 2.1 Start with Docker + +#### 2.1.1 Docker run + +Use the command `docker run -itd --name loader hugegraph/loader` to start loader. + +If you want to load your data, you can mount the data folder like `-v /path/to/data/file:/loader/file` + + +#### 2.1.2 Docker-compose + +The example `docker-compose.yml` is [here](./docker/example/docker-compose.yml) + +If you want to load your data, you can mount the data folder like: +```yaml +volumes: + - /path/to/data/file:/loader/file +``` + +Use the command `docker-compose up -d` to deploy `loader` with `server` and `hubble`. + +### 2.2 Load data with docker container + +#### 2.2.1 enter the docker container + +```bash +docker exec -it loader bash Review Comment: remember update here when doc update https://github.com/apache/incubator-hugegraph-doc/pull/299#discussion_r1383507535 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
