Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slurm adapter 监听地址支持可配 #26

Merged
merged 1 commit into from
Nov 5, 2024
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
4 changes: 2 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ mysql:
clustername: cluster
databaseencode: latin1

# 服务端口设置
# 服务地址设置
service:
port: 8972
addr: 0.0.0.0:8972

# slurm 默认Qos设置
slurm:
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import (
func main() {
os.Setenv("SLURM_TIME_FORMAT", "standard") // 新加slurm环境变量
// 启动服务
portString := fmt.Sprintf(":%d", caller.ConfigValue.Service.Port)
lis, err := net.Listen("tcp", portString)
lis, err := net.Listen("tcp", caller.ConfigValue.Service.Addr)
if err != nil {
fmt.Printf("failed to listen: %v", err)
return
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type MySQLConfig struct {
}

type Service struct {
Port int `yaml:"port"`
Addr string `yaml:"addr"`
}

type Slurm struct {
Expand Down
Loading