Skip to content
Merged
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
15 changes: 12 additions & 3 deletions .agents/skills/dev-deploy/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ context: fork
- `SERVER_HOST` / `SERVER_LISTEN_HOST`:对外 / 监听地址
- `SERVER_START_PORT`:起始端口;第 `i` 个实例为 `SERVER_START_PORT + i`,即首实例 `7801`
- `CLUSTER_ID`、`MDS_INSTANCE_START_ID`、`COORDINATOR_ADDR`
- `STORAGE_ENGINE` / `STORAGE_URL`:由 `deploy_mds.sh` 写进 `mds.conf`
- `STORAGE_ENGINE` / `STORAGE_URL`:由 `operate_mds.sh` 写进 `mds.conf`
- `S3_ENDPOINT` / `S3_AK` / `S3_SK` / `S3_BUCKETNAME`、`LOCAL_DATASTORE_PATH`:仅 `create_fs.sh` 使用

## 步骤
Expand All @@ -45,7 +45,7 @@ context: fork
3. **部署并启动 MDS**

```bash
bash clean_start.sh --server_num=$SERVER_NUM
bash operate_mds.sh restart --server_num=$SERVER_NUM
```

判据:`pgrep -c dingo-mds` 输出等于 `SERVER_NUM`。(不要用 `ps -ef | grep`,它会匹配到自己,也不校验数量。)
Expand Down Expand Up @@ -95,4 +95,13 @@ bash create_fs.sh --fs_name=$FS_NAME --mds_addr=$SERVER_HOST:$(($SERVER_START_PO

## 其他脚本

`deploy_mds.sh` / `start_mds.sh` / `stop_mds.sh` 是 `clean_start.sh` 的拆分,只重启 MDS 时单独用。参数以 `bash <脚本> --help` 为准。
`operate_mds.sh` 一个脚本管全部 MDS 生命周期,子命令选动作,flag 两种写法都行(`--server_num=2 restart` 同 `restart --server_num=2`):

```bash
bash operate_mds.sh restart --server_num=1 # = stop + deploy + start,等价于原 clean_start.sh
bash operate_mds.sh stop --server_num=1 # 停;--force 用 kill -9,--use_pgrep 按进程名而非 pid 文件
bash operate_mds.sh deploy --server_num=1 # 只重新部署(软链二进制 + 渲染 conf)
bash operate_mds.sh start --server_num=1 # 只启动
```

参数以 `bash operate_mds.sh --help` 为准。`restart` 中 stop / deploy 失败会直接中止,不会带着半坏状态继续起服务。
4 changes: 4 additions & 0 deletions .github/scripts/deploy-mds-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ CLUSTER_ID=101
MDS_PORT=8821
MDS_INSTANCE_ID=1001
VFS_DUMMY_PORT=10001
MDS_LOG_LEVEL=DEBUG
MDS_LOG_V=20

BUILD_DIR="${GITHUB_WORKSPACE}/build/bin"
TEMPLATE="${GITHUB_WORKSPACE}/scripts/dev-mds/mds.template.conf"
Expand Down Expand Up @@ -54,6 +56,8 @@ sed -i "s|\\\$SERVER_PORT|${MDS_PORT}|g" "${DIST_CONF}"
sed -i "s|\\\$BASE_PATH|${MDS_DIST}|g" "${DIST_CONF}"
sed -i "s|\\\$STORAGE_ENGINE|dingo-store|g" "${DIST_CONF}"
sed -i "s|\\\$STORAGE_URL|list://${COORDINATOR_ADDR}|g" "${DIST_CONF}"
sed -i "s|\\\$LOG_LEVEL|${MDS_LOG_LEVEL}|g" "${DIST_CONF}"
sed -i "s|\\\$LOG_V|${MDS_LOG_V}|g" "${DIST_CONF}"

echo "${COORDINATOR_ADDR}" > "${MDS_DIST}/conf/coor_list"

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ bench_results/

CONTEXT.md
.pi-subagents/

# Local dev config (contains secrets)
scripts/dev-mds/env.local
2 changes: 2 additions & 0 deletions scripts/deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function deploy_server() {
sed -i 's,\$BASE_PATH,'"$dstpath"',g' $dist_conf
sed -i 's,\$STORAGE_ENGINE,dingo-store,g' $dist_conf
sed -i 's,\$STORAGE_URL,file://./conf/coor_list,g' $dist_conf
sed -i 's,\$LOG_LEVEL,INFO,g' $dist_conf
sed -i 's,\$LOG_V,0,g' $dist_conf

# coor_list file
coor_file="${dstpath}/conf/coor_list"
Expand Down
26 changes: 0 additions & 26 deletions scripts/dev-mds/clean_start.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/dev-mds/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [[ ! -d "$mydir" ]]; then mydir="$PWD"; fi
. $mydir/shflags

DEFINE_integer cluster_id 0 'cluster id'
DEFINE_string parameters 'mds_deploy_parameters.local' 'deploy parameters file'
DEFINE_string env 'env.local' 'deploy env file'


# parse the command-line
Expand All @@ -14,7 +14,7 @@ eval set -- "${FLAGS_ARGV}"

echo "cluster_id: ${FLAGS_cluster_id}"

source $mydir/${FLAGS_parameters}
source $mydir/${FLAGS_env}


#check cluster id is valid
Expand Down
10 changes: 7 additions & 3 deletions scripts/dev-mds/create_fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ if [[ ! -d "$mydir" ]]; then mydir="$PWD"; fi

DEFINE_string fs_name '' 'fs name'
DEFINE_string mds_addr '' 'mds address'
DEFINE_string parameters 'mds_deploy_parameters.local' 'deploy parameters file'
DEFINE_string env 'env.local' 'deploy env file'
DEFINE_boolean use_local_datastore false 'use local datastore'

# parse the command-line
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"

source $mydir/${FLAGS_env}

if [ -z "${FLAGS_mds_addr}" ]; then
FLAGS_mds_addr="${SERVER_HOST}:$((SERVER_START_PORT + 1))"
fi

echo "fs_name: ${FLAGS_fs_name}"
echo "mds_addr: ${FLAGS_mds_addr}"

Expand All @@ -27,8 +33,6 @@ if [ -z "${FLAGS_mds_addr}" ]; then
exit -1
fi

source $mydir/${FLAGS_parameters}

BASE_DIR=$(dirname $(dirname $(cd $(dirname $0); pwd)))
BUILD_DIR=$BASE_DIR/build
MDS_CLIENT_BIN_PATH=$BUILD_DIR/bin/dingo-mds-client
Expand Down
105 changes: 0 additions & 105 deletions scripts/dev-mds/deploy_mds.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ STORAGE_URL=list://127.0.0.1:2379
S3_ENDPOINT=
S3_AK=
S3_SK=
S3_BUCKETNAME=
S3_BUCKETNAME=


LOCAL_DATASTORE_PATH=

LOG_LEVEL=DEBUG
LOG_V=0
4 changes: 2 additions & 2 deletions scripts/dev-mds/mds.template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# log
--log_dir=$BASE_PATH/log
--log_level=DEBUG
--log_v=0
--log_level=$LOG_LEVEL
--log_v=$LOG_V


# dingo-sdk
Expand Down
Loading