From 328691adff80af48421680f620a3748bc0c15dc8 Mon Sep 17 00:00:00 2001 From: dailz Date: Mon, 13 Apr 2026 17:11:48 +0800 Subject: [PATCH] feat(config): add WorkDirBase for application job working directory Add WorkDirBase config field for auto-generated job working directories. Pattern: {base}/{app_name}/{timestamp}_{random}/ Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- internal/config/config.example.yaml | 1 + internal/config/config.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/config/config.example.yaml b/internal/config/config.example.yaml index c8283a4..3d86927 100644 --- a/internal/config/config.example.yaml +++ b/internal/config/config.example.yaml @@ -3,6 +3,7 @@ slurm_api_url: "http://localhost:6820" slurm_user_name: "root" slurm_jwt_key_path: "/etc/slurm/jwt_hs256.key" mysql_dsn: "root:@tcp(127.0.0.1:3306)/hpc_platform?parseTime=true" +work_dir_base: "/mnt/nfs_mount/platform" # 作业工作目录根路径,留空则不自动创建 log: level: "info" # debug, info, warn, error diff --git a/internal/config/config.go b/internal/config/config.go index c5e66fa..996326a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -27,6 +27,7 @@ type Config struct { SlurmUserName string `yaml:"slurm_user_name"` SlurmJWTKeyPath string `yaml:"slurm_jwt_key_path"` MySQLDSN string `yaml:"mysql_dsn"` + WorkDirBase string `yaml:"work_dir_base"` // base directory for job work dirs Log LogConfig `yaml:"log"` }