-
Notifications
You must be signed in to change notification settings - Fork 596
refactor(docker): migrate single-node compose from host to bridge networking #2952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6ef1089
3c2ba6e
afa63f0
64a9aab
6e024d2
a18bbb3
c607dbd
6a4c567
55e227a
735a7dd
2a45f82
86a2780
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
bitflicker64 marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,68 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| set -euo pipefail | ||
|
|
||
| # start hugegraph store | ||
| ./bin/start-hugegraph-store.sh -j "$JAVA_OPTS" | ||
| log() { echo "[hugegraph-store-entrypoint] $*"; } | ||
|
|
||
| fail_on_deprecated() { | ||
| local old_name="$1" new_name="$2" | ||
| if [[ -n "${!old_name:-}" ]]; then | ||
| echo "ERROR: deprecated env '${old_name}' detected. Use '${new_name}' instead." >&2 | ||
| exit 2 | ||
| fi | ||
| } | ||
|
|
||
| require_env() { | ||
| local name="$1" | ||
| if [[ -z "${!name:-}" ]]; then | ||
| echo "ERROR: missing required env '${name}'" >&2; exit 2 | ||
| fi | ||
| } | ||
|
|
||
| json_escape() { | ||
| local s="$1" | ||
| s=${s//\\/\\\\}; s=${s//\"/\\\"}; s=${s//$'\n'/} | ||
| printf "%s" "$s" | ||
| } | ||
|
|
||
| # ── Guard deprecated vars ───────────────────────────────────────────── | ||
| fail_on_deprecated "PD_ADDRESS" "HG_STORE_PD_ADDRESS" | ||
| fail_on_deprecated "GRPC_HOST" "HG_STORE_GRPC_HOST" | ||
| fail_on_deprecated "RAFT_ADDRESS" "HG_STORE_RAFT_ADDRESS" | ||
| fail_on_deprecated "RAFT_PEERS" "HG_PD_RAFT_PEERS_LIST" | ||
|
bitflicker64 marked this conversation as resolved.
Outdated
|
||
|
|
||
| # ── Required vars ───────────────────────────────────────────────────── | ||
| require_env "HG_STORE_PD_ADDRESS" | ||
| require_env "HG_STORE_GRPC_HOST" | ||
| require_env "HG_STORE_RAFT_ADDRESS" | ||
|
Comment on lines
+48
to
+51
|
||
|
|
||
| # ── Defaults ────────────────────────────────────────────────────────── | ||
| : "${HG_STORE_GRPC_PORT:=8500}" | ||
| : "${HG_STORE_REST_PORT:=8520}" | ||
| : "${HG_STORE_DATA_PATH:=/hugegraph-store/storage}" | ||
|
|
||
| # ── Build SPRING_APPLICATION_JSON ───────────────────────────────────── | ||
| SPRING_APPLICATION_JSON="$(cat <<JSON | ||
| { | ||
| "pdserver": { "address": "$(json_escape "${HG_STORE_PD_ADDRESS}")" }, | ||
| "grpc": { "host": "$(json_escape "${HG_STORE_GRPC_HOST}")", | ||
| "port": "$(json_escape "${HG_STORE_GRPC_PORT}")" }, | ||
| "raft": { "address": "$(json_escape "${HG_STORE_RAFT_ADDRESS}")" }, | ||
| "server": { "port": "$(json_escape "${HG_STORE_REST_PORT}")" }, | ||
| "app": { "data-path": "$(json_escape "${HG_STORE_DATA_PATH}")" } | ||
| } | ||
| JSON | ||
| )" | ||
| export SPRING_APPLICATION_JSON | ||
|
|
||
| log "effective config:" | ||
| log " pdserver.address=${HG_STORE_PD_ADDRESS}" | ||
| log " grpc.host=${HG_STORE_GRPC_HOST}" | ||
| log " grpc.port=${HG_STORE_GRPC_PORT}" | ||
| log " raft.address=${HG_STORE_RAFT_ADDRESS}" | ||
| log " server.port=${HG_STORE_REST_PORT}" | ||
| log " app.data-path=${HG_STORE_DATA_PATH}" | ||
|
|
||
| ./bin/start-hugegraph-store.sh -j "${JAVA_OPTS:-}" | ||
| tail -f /dev/null | ||
|
bitflicker64 marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.