Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .codex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Toolchain local environment

Codex reads `.codex/environments/environment.toml` when it creates a worktree.
The setup is intentionally lightweight: it pins Node 18.20.8 and installs the
frontend dependencies without building or starting services.

## Runtime model

- Each worktree gets a stable frontend port in `3001-3099`.
- Up to three frontend dev servers are recommended; additional servers warn.
- One Hubble backend listens on `8088`. The first worktree owns it until the
`Hubble BE Switch` action explicitly replaces it.
- HStore uses the sibling server repository's Compose file plus the tracked
low-memory override. Images use the local `latest` tag and never pull during
startup. `Infrastructure Pull` is the explicit update operation.
- Low-memory Server tuning is best-effort across `latest` image layouts: known
properties are applied even when absent from the template, while unavailable
YAML settings produce a warning and keep the image default. It is a local
functional-test profile, not a memory or compatibility guarantee.
- HStore starts with Server access control enabled. Connect Hubble to
`http://127.0.0.1:8080` as `admin` with password `pa`, or set
`HUBBLE_SERVER_PASSWORD` before the first start to use a local alternative.
The password only initializes a new local data volume; stopping services
preserves the original password. Use `Infrastructure Reset` to initialize
fresh local data if that password is lost. This known credential is only for
local testing; never reuse it elsewhere.
- `Infrastructure Stop` preserves HStore data. `Infrastructure Reset` requires
typing `RESET` before it deletes the Compose volumes.
- Runtime ownership files live under `~/.codex/run/`, not in a worktree.

Set `HUGEGRAPH_SERVER_REPO` when the server repository is not next to
toolchain. Set `HUBBLE_LOADER_HOME` when no packaged Loader exists under the
source checkout. Set `HUBBLE_MVND_BIN` to override the Java 11-compatible mvnd
binary. Secrets must stay in local environment variables or an untracked local
file; do not add them to the environment TOML.

The low-memory HStore profile is intended only for local, small-data functional
testing. Use the balanced profile for larger Loader samples. Neither Docker
Desktop nor these constrained profiles are valid performance baselines.
90 changes: 90 additions & 0 deletions .codex/environments/environment.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#
# 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.
#

version = 1
name = "toolchain-hubble"

[setup]
script = "bash .codex/scripts/setup.sh"

[cleanup]
script = "bash .codex/scripts/hubble.sh cleanup"

[[actions]]
name = "Hubble FE Dev"
icon = "run"
command = "bash .codex/scripts/hubble.sh fe-start"

[[actions]]
name = "Hubble BE Dev"
icon = "run"
command = "bash .codex/scripts/hubble.sh be-start"

[[actions]]
name = "Hubble BE Switch"
icon = "debug"
command = "bash .codex/scripts/hubble.sh be-switch"

[[actions]]
name = "Hubble Status"
icon = "tool"
command = "bash .codex/scripts/hubble.sh status"

[[actions]]
name = "Hubble Stop"
icon = "tool"
command = "bash .codex/scripts/hubble.sh stop"

[[actions]]
name = "HStore Low Memory"
icon = "run"
command = "bash .codex/scripts/infra.sh hstore-start low"

[[actions]]
name = "HStore Balanced"
icon = "run"
command = "bash .codex/scripts/infra.sh hstore-start balanced"

[[actions]]
name = "Infrastructure Status"
icon = "tool"
command = "bash .codex/scripts/infra.sh status"

[[actions]]
name = "Infrastructure Stop"
icon = "tool"
command = "bash .codex/scripts/infra.sh stop"

[[actions]]
name = "Infrastructure Reset"
icon = "tool"
command = "bash .codex/scripts/infra.sh reset"

[[actions]]
name = "Infrastructure Pull"
icon = "tool"
command = "bash .codex/scripts/infra.sh pull"

[[actions]]
name = "Fast Verify"
icon = "test"
command = "bash .codex/scripts/verify.sh fast"

[[actions]]
name = "Full Verify"
icon = "test"
command = "bash .codex/scripts/verify.sh full"
92 changes: 92 additions & 0 deletions .codex/infra/compose.balanced.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#
# 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.
#

services:
pd:
mem_limit: 640m
environment:
JAVA_OPTS: >-
-Xms96m -Xmx128m
-XX:ActiveProcessorCount=2
-XX:MaxMetaspaceSize=128m
-XX:MaxDirectMemorySize=96m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=8192
-DAsyncLoggerConfig.RingBufferSize=8192
-Dthread.pool.grpc.core=8
-Dthread.pool.grpc.max=32
-Dthread.pool.grpc.queue=512
-Djob.interruptableThreadPool.core=1
-Djob.interruptableThreadPool.max=8
-Djob.interruptableThreadPool.queue=256
-Djob.uninterruptibleThreadPool.core=0
-Djob.uninterruptibleThreadPool.max=4
-Djob.uninterruptibleThreadPool.queue=128
-Dpartition.default-shard-count=1
-Dpartition.store-max-shard-count=12

store:
mem_limit: 768m
environment:
JAVA_OPTS: >-
-Xms96m -Xmx128m
-XX:ActiveProcessorCount=2
-XX:MaxMetaspaceSize=128m
-XX:MaxDirectMemorySize=128m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=8192
-DAsyncLoggerConfig.RingBufferSize=8192
-Drocksdb.total_memory_size=134217728
-Drocksdb.write_buffer_size=4194304
-Drocksdb.min_write_buffer_number_to_merge=2
-Dthread.pool.grpc.core=8
-Dthread.pool.grpc.max=32
-Dthread.pool.grpc.queue=512
-Dthread.pool.scan.core=4
-Dthread.pool.scan.max=16
-Dthread.pool.scan.queue=256
-Djob.interruptableThreadPool.core=2
-Djob.interruptableThreadPool.max=8
-Djob.interruptableThreadPool.queue=256
-Djob.uninterruptibleThreadPool.core=0
-Djob.uninterruptibleThreadPool.max=4
-Djob.uninterruptibleThreadPool.queue=128
-Dquery.push-down.threads=8
-Dquery.push-down.fetch_batch=1000
-Dquery.push-down.fetch_timeout=30000
-Dquery.push-down.memory_limit_count=10000
-Dquery.push-down.index_size_limit_count=10000
-Draft.disruptorBufferSize=512
-Draft.metrics=false
-Draft.maxReplicatorInflightMsgs=32
-Draft.maxEntriesSize=64
-Draft.maxBodySize=262144

server:
mem_limit: 1024m
environment:
JAVA_OPTS: >-
-Xms128m -Xmx384m
-XX:ActiveProcessorCount=4
-XX:MaxMetaspaceSize=192m
-XX:MaxDirectMemorySize=128m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=8192
-DAsyncLoggerConfig.RingBufferSize=8192
--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED
--add-modules=jdk.unsupported
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
108 changes: 108 additions & 0 deletions .codex/infra/compose.low-memory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#
# 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.
#

services:
pd:
pull_policy: never
mem_limit: 512m
cpus: 2.0
environment:
JAVA_OPTS: >-
-Xms64m -Xmx64m
-XX:ActiveProcessorCount=2
-XX:MaxMetaspaceSize=96m
-XX:MaxDirectMemorySize=64m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=4096
-DAsyncLoggerConfig.RingBufferSize=4096
-Dthread.pool.grpc.core=8
-Dthread.pool.grpc.max=32
-Dthread.pool.grpc.queue=256
-Djob.interruptableThreadPool.core=1
-Djob.interruptableThreadPool.max=8
-Djob.interruptableThreadPool.queue=128
-Djob.uninterruptibleThreadPool.core=0
-Djob.uninterruptibleThreadPool.max=4
-Djob.uninterruptibleThreadPool.queue=64
-Dpartition.default-shard-count=1
-Dpartition.store-max-shard-count=12

store:
pull_policy: never
mem_limit: 512m
cpus: 2.0
environment:
JAVA_OPTS: >-
-Xms64m -Xmx64m
-XX:ActiveProcessorCount=2
-XX:MaxMetaspaceSize=96m
-XX:MaxDirectMemorySize=64m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=4096
-DAsyncLoggerConfig.RingBufferSize=4096
-Drocksdb.total_memory_size=67108864
-Drocksdb.write_buffer_size=1048576
-Drocksdb.min_write_buffer_number_to_merge=2
-Dthread.pool.grpc.core=8
-Dthread.pool.grpc.max=32
-Dthread.pool.grpc.queue=256
-Dthread.pool.scan.core=4
-Dthread.pool.scan.max=16
-Dthread.pool.scan.queue=128
-Djob.interruptableThreadPool.core=2
-Djob.interruptableThreadPool.max=8
-Djob.interruptableThreadPool.queue=128
-Djob.uninterruptibleThreadPool.core=0
-Djob.uninterruptibleThreadPool.max=4
-Djob.uninterruptibleThreadPool.queue=64
-Dquery.push-down.threads=8
-Dquery.push-down.fetch_batch=1000
-Dquery.push-down.fetch_timeout=30000
-Dquery.push-down.memory_limit_count=5000
-Dquery.push-down.index_size_limit_count=5000
-Draft.disruptorBufferSize=256
-Draft.metrics=false
-Draft.maxReplicatorInflightMsgs=16
-Draft.maxEntriesSize=32
-Draft.maxBodySize=131072

server:
pull_policy: never
mem_limit: 768m
cpus: 4.0
entrypoint:
- /usr/bin/dumb-init
- "--"
- /opt/toolchain-low-memory/patch-server-config.sh
environment:
PASSWORD: ${HUBBLE_SERVER_PASSWORD:-pa}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This known default administrator password is combined with ports published on every host interface. The merged Compose config has no host_ip for 8080, 8520, or 8620, so the documented admin/pa Server and the Store/PD management endpoints are reachable from the developer's LAN. Please bind the necessary Server port to loopback, avoid publishing Store/PD to the host by default, and require or safely generate a local password.

JAVA_OPTS: >-
-Xms128m -Xmx192m
-XX:ActiveProcessorCount=4
-XX:MaxMetaspaceSize=128m
-XX:MaxDirectMemorySize=64m
-XX:+UseContainerSupport
-Dlog4j2.asyncLoggerConfigRingBufferSize=4096
-DAsyncLoggerConfig.RingBufferSize=4096
--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED
--add-modules=jdk.unsupported
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
volumes:
- type: bind
source: ${TOOLCHAIN_CODEX_DIR}/infra/patch-server-config.sh

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ The shared HStore service persists beyond worktree cleanup, but this bind mount points into the worktree that launched it. Once that temporary checkout is deleted, a container restart/recreation can no longer mount or execute the patch script. Please copy the script to a stable runtime location such as ~/.codex/run/..., or package it in a stable image/volume, before starting the persistent service.

target: /opt/toolchain-low-memory/patch-server-config.sh
read_only: true
Loading
Loading