完善 Full PBF 跨机器重建配置

This commit is contained in:
OpenAI Codex
2026-08-06 15:42:15 +08:00
parent d0ef394eac
commit ed5de0752f
3 changed files with 27 additions and 16 deletions

View File

@@ -73,13 +73,13 @@ tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles
### 2.4 固定代码版本 ### 2.4 固定代码版本
2026-04-18 全国分片重建时,固定使用的是当时的 HEAD 版本。对应可追溯节点: 当前可重建分支已经包含全国 Full 生成器、规则包、semantic 后处理和审计代码。当前分支节点
```text ```text
6d72340 guard high-extent tile reencoding full-semantic-extentfix-baseline @ d0ef394
``` ```
当前工作区的 `navsea_tile_builder.py` 已经包含后续修改,不能用于严格复建该历史基线。应使用独立 Git worktree同时固定 历史上用于 2026-04-18 重建的源节点仍记录为 `6d72340`。如果需要严格复现历史代码,可额外 fetch 该节点;如果目标是重建当前 Full 基线,直接使用当前分支即可。当前分支固定包含
- `navsea_tile_builder.py` - `navsea_tile_builder.py`
- `navsea_mapping_registry.py` - `navsea_mapping_registry.py`
@@ -94,7 +94,7 @@ MySQL pbf_analysis 语义表
+ +
navsea-core 映射规则 navsea-core 映射规则
固定 6d72340 代码节点 当前 `full-semantic-extentfix-baseline` 代码节点
按 z0-8 / z9-10 / z11 / z12 分片重建 按 z0-8 / z9-10 / z11 / z12 分片重建
@@ -125,28 +125,36 @@ navsea-core 映射规则
/home/wwwroot/pbf-delivery-full-rebuild-candidate /home/wwwroot/pbf-delivery-full-rebuild-candidate
``` ```
### 4.2 建立固定代码 worktree ### 4.2 使用当前分支代码
```bash ```bash
cd /root/sourceserver/pbf cd /root/sourceserver/pbf
git worktree add --detach /tmp/navsea-full-rebuild-code 6d72340 git switch --detach full-semantic-extentfix-baseline
``` ```
检查固定版本: 检查固定版本:
```bash ```bash
git -C /tmp/navsea-full-rebuild-code rev-parse HEAD git rev-parse HEAD
``` ```
期望 `6d72340` 开头 期望 `d0ef394` 或该分支后续更新后的提交
### 4.3 设置路径变量 ### 4.3 设置路径变量
```bash ```bash
export REPO=/root/sourceserver/pbf export REPO=/root/sourceserver/pbf
export CODE=/tmp/navsea-full-rebuild-code export CODE=$REPO
export PY=/root/sourceserver/pbf/.venv/bin/python export PY=$REPO/.venv/bin/python
# 按目标机器实际情况设置NAVSEA_DB_SOCKET 为空时使用 TCP。
export NAVSEA_DB_HOST=127.0.0.1
export NAVSEA_DB_PORT=3306
export NAVSEA_DB_USER=root
export NAVSEA_DB_PASSWORD='请填入数据库密码'
export NAVSEA_DB_NAME=pbf_analysis
export NAVSEA_DB_SOCKET=/tmp/mysql.sock
export SOURCE=/home/wwwroot/newpec/exported_auto/tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles export SOURCE=/home/wwwroot/newpec/exported_auto/tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles
export REFERENCE=/home/wwwroot/pbf-delivery-full-20260415 export REFERENCE=/home/wwwroot/pbf-delivery-full-20260415

View File

@@ -4,6 +4,7 @@ import argparse
import hashlib import hashlib
import json import json
import math import math
import os
import re import re
import struct import struct
from collections import defaultdict from collections import defaultdict
@@ -221,12 +222,12 @@ def normalize_release_canonical_object_type(source_layer: str, canonical_object_
@dataclass(frozen=True) @dataclass(frozen=True)
class DbConfig: class DbConfig:
host: str = "localhost" host: str = os.getenv("NAVSEA_DB_HOST", "localhost")
port: int = 3306 port: int = int(os.getenv("NAVSEA_DB_PORT", "3306"))
user: str = "root" user: str = os.getenv("NAVSEA_DB_USER", "root")
password: str = "2chi9ks2" password: str = os.getenv("NAVSEA_DB_PASSWORD", "")
database: str = "pbf_analysis" database: str = os.getenv("NAVSEA_DB_NAME", "pbf_analysis")
unix_socket: str | None = "/tmp/mysql.sock" unix_socket: str | None = os.getenv("NAVSEA_DB_SOCKET", "/tmp/mysql.sock") or None
@dataclass(frozen=True) @dataclass(frozen=True)

View File

@@ -6,3 +6,5 @@ eccodes>=1.7
mercantile>=1.2 mercantile>=1.2
mapbox-vector-tile>=2.1 mapbox-vector-tile>=2.1
PyMySQL>=1.1 PyMySQL>=1.1
Pillow>=10.0
cryptography>=42.0