-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsystem.go
39 lines (31 loc) · 1.18 KB
/
system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2019 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package diviner
import (
"github.com/grailbio/bigmachine"
"go.starlark.net/starlark"
)
// A System describes a configuration of a machine. It is part of SystemPool.
type System struct {
// System is the bigmachine system configured by this system.
bigmachine.System
// ID is a unique identifier for this system.
ID string
// Parallelism specifies the maximum level of job parallelism allowable for
// this system. If <= 0, the system allows unlimited parallelism.
Parallelism int
// Bash snippet to be prepended to the user script.
// If empty, runner.DefaultPreamble is used.
Preamble string
}
// String implements starlark.Value.
func (s *System) String() string { return s.System.Name() }
// Type implements starlark.Value.
func (*System) Type() string { return "system" }
// Freeze implements starlark.Value.
func (*System) Freeze() {}
// Truth implements starlark.Value.
func (*System) Truth() starlark.Bool { return true }
// Hash implements starlark.Value.
func (s *System) Hash() (uint32, error) { return 0, errNotHashable }