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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ For quick start and single-machine deployments, we recommend **Vermeer**:
# Pull the image
docker pull hugegraph/vermeer:latest

# Change config path in docker-compose.yml
# Change config path in docker-compose.yaml
volumes:
- ~/:/go/bin/config # Change here to your actual config path, e.g., vermeer/config

Expand Down
22 changes: 19 additions & 3 deletions vermeer/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
*data*
*test*
*.git*
.git/
.gitignore
.gitattributes
test/
vermeer_test.go
vermeer_test.sh
vermeer_data/
asset/assets_vfsdata.go
ui/node_modules/
ui/package-lock.json
ui/ui/lib/bootstrap-4.3.1-dist/
ui/ui/lib/bootstrap4-glyphicons/
ui/ui/lib/jquery-3.5.1.min.js
ui/ui/lib/jquery-license
_tmp_extractor/
tools/supervisord/*/supervisord
tools/protoc/*/protoc
tools/protoc/*/bin/
tools/protoc/*/include/
8 changes: 8 additions & 0 deletions vermeer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ tools/protoc/*/include/
######################
asset/assets_vfsdata.go

# UI dependencies (downloaded via scripts/download_ui_assets.sh) #
######################
ui/node_modules/
ui/package-lock.json
ui/ui/lib/*
!ui/ui/lib/functions.js
!ui/ui/lib/vermeer.css

# AI assistant specific files (we only maintain AGENTS.md) #
######################
CLAUDE.md
Expand Down
4 changes: 3 additions & 1 deletion vermeer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
# limitations under the License.
#
FROM golang:1.23-alpine AS builder
RUN apk add --no-cache npm bash curl
COPY ./ /src/
WORKDIR /src/
ENV CGO_ENABLED="0"
RUN cd asset && go generate
RUN ./scripts/download_ui_assets.sh && ls -la ui/ui/lib/
RUN cd asset && go generate && wc -l assets_vfsdata.go
RUN go build -o /go/bin/app

FROM alpine
Expand Down
20 changes: 15 additions & 5 deletions vermeer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
# limitations under the License.
#

.PHONY: all init download-binaries generate-assets build clean help
.PHONY: all init download-binaries download-ui-assets generate-assets build clean help

# Default target
all: generate-assets build

# Initialize project (first time setup)
init: download-binaries
init: download-binaries download-ui-assets
@echo "Installing Go dependencies..."
go mod download
@echo "Project initialized successfully!"
Expand All @@ -31,8 +31,13 @@ download-binaries:
@echo "Downloading binary dependencies..."
@./scripts/download_binaries.sh || (echo "Failed to download binaries" && exit 1)

# Download UI assets (jQuery, Bootstrap, Glyphicons)
download-ui-assets:
@echo "Downloading UI assets..."
@./scripts/download_ui_assets.sh || (echo "Failed to download UI assets" && exit 1)

# Generate assets (vfsdata.go for web UI)
generate-assets:
generate-assets: download-ui-assets
@echo "Generating assets..."
@cd asset && go generate || (echo "Failed to generate assets" && exit 1)
@echo "Assets generated successfully!"
Expand Down Expand Up @@ -66,20 +71,25 @@ clean-all: clean
@rm -rf tools/protoc/*/protoc
@rm -rf tools/protoc/*/bin
@rm -rf tools/protoc/*/include
@echo "Cleaning downloaded UI assets..."
@rm -rf ui/node_modules ui/package-lock.json
@rm -rf ui/ui/lib/bootstrap-4.3.1-dist ui/ui/lib/bootstrap4-glyphicons
@rm -f ui/ui/lib/jquery-3.5.1.min.js ui/ui/lib/jquery-license
@echo "All clean completed!"

# Help
help:
@echo "Vermeer Build System"
@echo ""
@echo "Usage:"
@echo " make init - First time setup (download binaries + go mod download)"
@echo " make init - First time setup (download binaries + UI assets + go mod download)"
@echo " make download-binaries - Download supervisord and protoc binaries for your platform"
@echo " make download-ui-assets - Download jQuery, Bootstrap, Glyphicons to ui/ui/lib/"
@echo " make generate-assets - Generate assets_vfsdata.go from web UI (required before build)"
@echo " make build - Build vermeer for current platform (default: local architecture)"
@echo " make build-linux-amd64 - Build for Linux AMD64 (for deployment)"
@echo " make build-linux-arm64 - Build for Linux ARM64 (for ARM servers)"
@echo " make clean - Remove generated files and binaries (keep downloaded tools)"
@echo " make clean-all - Remove everything including downloaded tools"
@echo " make clean-all - Remove everything including downloaded tools and UI assets"
@echo " make all - Generate assets and build (default target)"
@echo " make help - Show this help message"
49 changes: 45 additions & 4 deletions vermeer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ vermeer/
│ ├── master.ini
│ └── worker.ini
├── tools/ # Binary dependencies (supervisord, protoc)
└── ui/ # Web dashboard
└── ui/ # Web dashboard source and dependencies
├── package.json # Frontend dependencies (jQuery, Bootstrap)
└── ui/
├── master.html # Master dashboard page
├── worker.html # Worker dashboard page
└── lib/ # Downloaded at build time (git-ignored)
```

## Quick Start
Expand All @@ -107,8 +112,8 @@ Create a dedicated config directory (e.g., `~/vermeer-config/`) with `master.ini
Run with Docker:

```bash
# Master node
docker run -v ~/vermeer-config:/go/bin/config hugegraph/vermeer --env=master
# Master node (with Web UI enabled)
docker run -v ~/vermeer-config:/go/bin/config hugegraph/vermeer --env=master -auth token -auth_token_factor 1234

# Worker node
docker run -v ~/vermeer-config:/go/bin/config hugegraph/vermeer --env=worker
Expand Down Expand Up @@ -158,6 +163,7 @@ Configure parameters in `vermeer.sh`, then:
#### Prerequisites

- Go 1.23 or later
- Node.js/npm (for downloading UI assets)
- `curl` and `unzip` utilities (for downloading dependencies)
- Internet connection (for first-time setup)

Expand Down Expand Up @@ -226,10 +232,41 @@ task_strategy = 1

# Number of parallel tasks
task_parallel_num = 1

# Authentication mode (none or token)
# Set to "token" to enable Web UI and API authentication
auth = none

# Token authentication factor (required when auth=token)
auth_token_factor = 1234
```

**Note**: HugeGraph connection details (`pd_peers`, `server`, `graph`) are provided in the graph load API request, not in the configuration file. See [HugeGraph Integration](#hugegraph-integration) section for details.

### Generating Auth Token

When `auth=token` is enabled, you need to generate a token for login. Use the built-in token generator:

```bash
# Run with Go
go run tools/token/token_generator.go -user admin -space default -factor 1234 -i

# Or run in Docker (no local Go required)
docker run --rm -v $(pwd):/src -v $(pwd)/config:/src/config golang:1.23-alpine sh -c "cd /src && go run tools/token/token_generator.go -user admin -space default -factor 1234 -i"
```

Parameters:
- `-user` — Username (default: `foo`)
- `-space` — Graph space name (default: `bar`)
- `-factor` — Must match `auth_token_factor` in `master.ini`
- `-client` — Client identifier (default: `hg`)
- `-i` — Generate immortal token (never expires)

The generated token can be used in two ways:

1. **HTTP Header**: `Authorization: Bearer <token>`
2. **Login API**: `POST /api/v1/login` with body `{"token": "<token>"}` (sets cookie)

### Worker Configuration (`worker.ini`)

```ini
Expand Down Expand Up @@ -278,6 +315,8 @@ worker_group = default

Vermeer exposes a REST API on port `6688` (configurable in `master.ini`).

> **Note**: The Web UI (`/ui/*`) is only available when `auth=token` is configured. Set `auth_token_factor` in `master.ini` or pass `-auth token -auth_token_factor <value>` via command line.

### Key Endpoints

| Endpoint | Method | Description |
Expand Down Expand Up @@ -502,7 +541,9 @@ vermeer/tools/protoc/linux64/protoc vermeer/apps/protos/*.proto --go-grpc_out=ve

## Monitoring

Access the Web UI dashboard at `http://master-ip:6688/ui/` for:
Access the Web UI dashboard at `http://master-ip:6688/ui/master.html` for:

> **Note**: The Web UI requires `auth=token` in `master.ini` (or `-auth token` via command line). Without token authentication, the UI routes are not registered.

- Worker status and resource usage
- Active and completed tasks
Expand Down
2 changes: 1 addition & 1 deletion vermeer/asset/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ import (
)

// Assets contains the project's assets.
var Assets http.FileSystem = http.Dir("../ui")
var Assets http.FileSystem = http.Dir("../ui/ui")
2 changes: 1 addition & 1 deletion vermeer/asset/asset_dev_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ import (

func init() {
// for ui development
Assets = http.Dir(common.AppRootPath() + "/ui/")
Assets = http.Dir(common.AppRootPath() + "/ui/ui/")
}
6 changes: 6 additions & 0 deletions vermeer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ go mod download
echo "Checking binary dependencies..."
./scripts/download_binaries.sh

# Download UI assets if not exist
echo "Checking UI assets..."
if [ ! -d "ui/ui/lib" ] || [ -z "$(ls -A ui/ui/lib 2>/dev/null)" ]; then
./scripts/download_ui_assets.sh
fi

# Generate assets if not exist
if [ ! -f "asset/assets_vfsdata.go" ]; then
echo "Generating assets..."
Expand Down
5 changes: 3 additions & 2 deletions vermeer/config/worker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
; 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.

[default]
log_level=info
debug_mode=release
http_peer=0.0.0.0:6788
grpc_peer=0.0.0.0:6789
master_peer=127.0.0.1:6689
run_mode=worker
worker_group=default
worker_group=default
auth=none
auth_token_factor=1234
Loading
Loading