You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by vg...@apache.org on 2024/04/21 11:01:57 UTC
(incubator-hugegraph) 02/02: intro docker for pd & store
This is an automated email from the ASF dual-hosted git repository.
vgalaxies pushed a commit to branch pd-store-docker
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git
commit c715ff0ef9fe937808d7726813df7eb1f2bb4ed9
Author: VGalaxies <vg...@apache.org>
AuthorDate: Sun Apr 21 19:01:44 2024 +0800
intro docker for pd & store
---
hugegraph-pd/Dockerfile | 58 ++++++++++++++++++++++
.../hg-pd-dist/docker/docker-entrypoint.sh | 22 ++++++++
hugegraph-store/Dockerfile | 58 ++++++++++++++++++++++
.../hg-store-dist/docker/docker-entrypoint.sh | 22 ++++++++
4 files changed, 160 insertions(+)
diff --git a/hugegraph-pd/Dockerfile b/hugegraph-pd/Dockerfile
new file mode 100644
index 000000000..e1b2b1282
--- /dev/null
+++ b/hugegraph-pd/Dockerfile
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+# Dockerfile for HugeGraph PD
+# 1st stage: build source code (refer to hugegraph-server/Dockerfile)
+
+# 2nd stage: runtime env
+# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
+FROM openjdk:11-slim
+
+COPY --from=build /pkg/hugegraph-pd/dist/hugegraph-pd-*/ /hugegraph-pd/
+LABEL maintainer="HugeGraph Docker Maintainers <de...@hugegraph.apache.org>"
+
+# TODO: use g1gc or zgc as default
+ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=50 -XshowSettings:vm" \
+ HUGEGRAPH_HOME="hugegraph-pd"
+
+#COPY . /hugegraph/hugegraph-pd
+WORKDIR /hugegraph-pd/
+
+# 1. Install environment and init HugeGraph Sever
+RUN set -x \
+ && apt-get -q update \
+ && apt-get -q install -y --no-install-recommends --no-install-suggests \
+ dumb-init \
+ procps \
+ curl \
+ lsof \
+ vim \
+ cron \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/* \
+ && service cron start \
+ && pwd && cd /hugegraph-pd/
+
+# 2. Init docker script
+COPY hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh .
+RUN chmod 755 ./docker-entrypoint.sh
+
+EXPOSE 8620
+VOLUME /hugegraph-server
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+CMD ["./docker-entrypoint.sh"]
diff --git a/hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh b/hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh
new file mode 100644
index 000000000..fd894d551
--- /dev/null
+++ b/hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh
@@ -0,0 +1,22 @@
+#!/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.
+#
+
+# start hugegraph pd
+./bin/start-hugegraph-pd.sh -j "$JAVA_OPTS"
+
+tail -f /dev/null
diff --git a/hugegraph-store/Dockerfile b/hugegraph-store/Dockerfile
new file mode 100644
index 000000000..0e7a33396
--- /dev/null
+++ b/hugegraph-store/Dockerfile
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+# Dockerfile for HugeGraph Store
+# 1st stage: build source code (refer to hugegraph-server/Dockerfile)
+
+# 2nd stage: runtime env
+# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
+FROM openjdk:11-slim
+
+COPY --from=build /pkg/hugegraph-store/dist/hugegraph-store-*/ /hugegraph-store/
+LABEL maintainer="HugeGraph Docker Maintainers <de...@hugegraph.apache.org>"
+
+# TODO: use g1gc or zgc as default
+ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=50 -XshowSettings:vm" \
+ HUGEGRAPH_HOME="hugegraph-store"
+
+#COPY . /hugegraph/hugegraph-store
+WORKDIR /hugegraph-store/
+
+# 1. Install environment and init HugeGraph Sever
+RUN set -x \
+ && apt-get -q update \
+ && apt-get -q install -y --no-install-recommends --no-install-suggests \
+ dumb-init \
+ procps \
+ curl \
+ lsof \
+ vim \
+ cron \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/* \
+ && service cron start \
+ && pwd && cd /hugegraph-store/
+
+# 2. Init docker script
+COPY hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh .
+RUN chmod 755 ./docker-entrypoint.sh
+
+EXPOSE 8620
+VOLUME /hugegraph-server
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+CMD ["./docker-entrypoint.sh"]
diff --git a/hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh b/hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh
new file mode 100644
index 000000000..5aa77621d
--- /dev/null
+++ b/hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh
@@ -0,0 +1,22 @@
+#!/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.
+#
+
+# start hugegraph store
+./bin/start-hugegraph-store.sh -j "$JAVA_OPTS"
+
+tail -f /dev/null