-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Scheduler enhancements #7703
Merged
Merged
Scheduler enhancements #7703
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e2a1ca7
Use cgroup limits in worker memory calculations
clinta c4f4617
Report memory used and swap used in worker res
clinta 93e4656
Use a float to represent GPU utilization
clinta 4ef8543
Permit workers to override resource table
clinta 36868a8
sched: C2 is not all-core load
magik6k b961e1a
sched resources: Separate Parallelism defaults depending on GPU presence
magik6k c9a2ff4
cleanup worker resource overrides
magik6k 6d52d85
Fix docsgen
magik6k f25efec
worker: Test resource table overrides
magik6k a597b07
fix sched tests
magik6k 001ecbb
fix lint
magik6k cf20b0b
worker: Command to print resource-table env vars
magik6k 330cfc3
worker: Typo in resources cmd usage
magik6k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ func main() { | |
storageCmd, | ||
setCmd, | ||
waitQuietCmd, | ||
resourcesCmd, | ||
tasksCmd, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"sort" | ||
|
||
"github.com/urfave/cli/v2" | ||
|
||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||
) | ||
|
||
var resourcesCmd = &cli.Command{ | ||
Name: "resources", | ||
Usage: "Manage resource table overrides", | ||
Flags: []cli.Flag{ | ||
&cli.BoolFlag{ | ||
Name: "all", | ||
Usage: "print all resource envvars", | ||
}, | ||
&cli.BoolFlag{ | ||
Name: "default", | ||
Usage: "print default resource envvars", | ||
}, | ||
}, | ||
Action: func(cctx *cli.Context) error { | ||
def := map[string]string{} | ||
set := map[string]string{} | ||
all := map[string]string{} | ||
|
||
_, err := storiface.ParseResourceEnv(func(key, d string) (string, bool) { | ||
if d != "" { | ||
all[key] = d | ||
def[key] = d | ||
} | ||
|
||
s, ok := os.LookupEnv(key) | ||
if ok { | ||
all[key] = s | ||
set[key] = s | ||
} | ||
|
||
return s, ok | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
printMap := func(m map[string]string) { | ||
var arr []string | ||
for k, v := range m { | ||
arr = append(arr, fmt.Sprintf("%s=%s", k, v)) | ||
} | ||
sort.Strings(arr) | ||
for _, s := range arr { | ||
fmt.Println(s) | ||
} | ||
} | ||
|
||
if cctx.Bool("default") { | ||
printMap(def) | ||
} else { | ||
if cctx.Bool("all") { | ||
printMap(all) | ||
} else { | ||
printMap(set) | ||
} | ||
} | ||
|
||
return nil | ||
}, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why jump so big
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with existing miners. Should be ok to keep like this.