Skip to content

Commit ce140e5

Browse files
committed
slurm: change to hostlist from cc-lib
The old archive hostlist resolution does not cover all the necessary host name schemes requires by Slurm. Neither should we pull packages directly from cc-backend.
1 parent 585db85 commit ce140e5

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ go 1.24.0
55
toolchain go1.24.4
66

77
require (
8-
github.com/ClusterCockpit/cc-lib v1.0.2
8+
github.com/ClusterCockpit/cc-lib/v2 v2.4.0
99
github.com/nats-io/nats.go v1.48.0
1010
)
1111

1212
require (
13-
github.com/ClusterCockpit/cc-backend v1.4.4 // indirect
1413
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
1514
github.com/fsnotify/fsnotify v1.9.0 // indirect
1615
github.com/google/uuid v1.6.0 // indirect

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
github.com/ClusterCockpit/cc-backend v1.4.4 h1:Xk87C/2dXRWlQOc7RARtfdiukDAZj+8+k0zFO4AFcvc=
2-
github.com/ClusterCockpit/cc-backend v1.4.4/go.mod h1:F8O4xSsXk+Ys5XoyQAGQ8noLUGneqNsw7QcClNaa5uo=
3-
github.com/ClusterCockpit/cc-lib v1.0.2 h1:ZWn3oZkXgxrr3zSigBdlOOfayZ4Om4xL20DhmritPPg=
4-
github.com/ClusterCockpit/cc-lib v1.0.2/go.mod h1:UGdOvXEnjFqlnPSxtvtFwO6BtXYW6NnXFoud9FtN93k=
1+
github.com/ClusterCockpit/cc-lib/v2 v2.4.0 h1:OnZlvqSatg7yCQ2NtSR7AddpUVSiuSMZ8scF1a7nfOk=
2+
github.com/ClusterCockpit/cc-lib/v2 v2.4.0/go.mod h1:JuxMAuEOaLLNEnnL9U3ejha8kMvsSatLdKPZEgJw6iw=
53
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
64
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
75
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=

internal/cc/interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020

2121
"github.com/nats-io/nats.go"
2222

23-
"github.com/ClusterCockpit/cc-lib/ccMessage"
24-
"github.com/ClusterCockpit/cc-lib/schema"
23+
"github.com/ClusterCockpit/cc-lib/v2/ccMessage"
24+
"github.com/ClusterCockpit/cc-lib/v2/schema"
2525
)
2626

2727
type CacheJobState struct {

internal/slurm/common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/ClusterCockpit/cc-slurm-adapter/internal/types"
77

8-
"github.com/ClusterCockpit/cc-lib/schema"
8+
"github.com/ClusterCockpit/cc-lib/v2/schema"
99
)
1010

1111
type Job interface {

internal/slurm/v24xx/slurm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"github.com/ClusterCockpit/cc-slurm-adapter/internal/trace"
1919
"github.com/ClusterCockpit/cc-slurm-adapter/internal/types"
2020

21-
"github.com/ClusterCockpit/cc-backend/pkg/archive"
22-
"github.com/ClusterCockpit/cc-lib/schema"
21+
"github.com/ClusterCockpit/cc-lib/v2/hostlist"
22+
"github.com/ClusterCockpit/cc-lib/v2/schema"
2323
)
2424

2525
// SlurmInt supports these two JSON layouts:
@@ -556,12 +556,12 @@ func GetNodes(job *SacctJob) ([]string, error) {
556556
return make([]string, 0), nil
557557
}
558558

559-
nodeList, err := archive.ParseNodeList(*job.Nodes)
559+
nodeList, err := hostlist.Expand(*job.Nodes)
560560
if err != nil {
561561
return nil, fmt.Errorf("Unable to resolve hostname list '%s': %w", *job.Nodes, err)
562562
}
563563

564-
return nodeList.PrintList(), nil
564+
return nodeList, nil
565565
}
566566

567567
func CheckPerms() {

internal/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package types
22

33
import (
4-
"github.com/ClusterCockpit/cc-lib/schema"
4+
"github.com/ClusterCockpit/cc-lib/v2/schema"
55
)
66

77
type CCStartJobRequest schema.Job

0 commit comments

Comments
 (0)