Skip to content

Commit

Permalink
smaller job defaults requirements (#4785)
Browse files Browse the repository at this point in the history
Smaller job resource requirements so that jobs can run on smaller EC2
instances by default.

This PR also introduce the following changes:
- Increase allocated capacity from 70% to 80%
- Unify the library used for printing human readable bytes

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced memory and disk capacity outputs with improved human-readable
formatting.
- Updated default configuration settings for resource allocation in
Bacalhau nodes.
- Introduced new API endpoints for orchestrator nodes and version
retrieval.

- **Bug Fixes**
- Adjusted memory allocation settings for batch, daemon, and service
jobs to optimize resource management.
- Improved error handling and response schemas for various API
endpoints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
wdbaruni authored Dec 18, 2024
1 parent 76836dd commit 0607cf3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
10 changes: 7 additions & 3 deletions cmd/cli/node/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/c2h5oh/datasize"
"github.com/dustin/go-humanize"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
"github.com/samber/lo"
Expand Down Expand Up @@ -100,13 +100,17 @@ var toggleColumns = map[string][]output.TableColumn[*models.NodeState]{
{
ColumnConfig: table.ColumnConfig{Name: "memory", WidthMax: len("10.0 GB / "), WidthMaxEnforcer: text.WrapSoft},
Value: ifComputeNode(func(cni models.ComputeNodeInfo) string {
return fmt.Sprintf("%s / %s", datasize.ByteSize(cni.AvailableCapacity.Memory).HR(), datasize.ByteSize(cni.MaxCapacity.Memory).HR())
return fmt.Sprintf("%s / %s",
humanize.Bytes(cni.AvailableCapacity.Memory),
humanize.Bytes(cni.MaxCapacity.Memory))
}),
},
{
ColumnConfig: table.ColumnConfig{Name: "disk", WidthMax: len("100.0 GB / "), WidthMaxEnforcer: text.WrapSoft},
Value: ifComputeNode(func(cni models.ComputeNodeInfo) string {
return fmt.Sprintf("%s / %s", datasize.ByteSize(cni.AvailableCapacity.Disk).HR(), datasize.ByteSize(cni.MaxCapacity.Disk).HR())
return fmt.Sprintf("%s / %s",
humanize.Bytes(cni.AvailableCapacity.Disk),
humanize.Bytes(cni.MaxCapacity.Disk))
}),
},
{
Expand Down
14 changes: 7 additions & 7 deletions pkg/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ var Default = types.Bacalhau{
Interval: 15 * types.Second,
},
AllocatedCapacity: types.ResourceScaler{
CPU: "70%",
Memory: "70%",
Disk: "70%",
CPU: "80%",
Memory: "80%",
Disk: "80%",
GPU: "100%",
},
},
Expand All @@ -63,7 +63,7 @@ var Default = types.Bacalhau{
Task: types.BatchTaskDefaultConfig{
Resources: types.ResourcesConfig{
CPU: "500m",
Memory: "1Gb",
Memory: "512Mb",
},
},
},
Expand All @@ -72,7 +72,7 @@ var Default = types.Bacalhau{
Task: types.BatchTaskDefaultConfig{
Resources: types.ResourcesConfig{
CPU: "500m",
Memory: "1Gb",
Memory: "512Mb",
},
},
},
Expand All @@ -81,7 +81,7 @@ var Default = types.Bacalhau{
Task: types.LongRunningTaskDefaultConfig{
Resources: types.ResourcesConfig{
CPU: "500m",
Memory: "1Gb",
Memory: "512Mb",
},
},
},
Expand All @@ -90,7 +90,7 @@ var Default = types.Bacalhau{
Task: types.LongRunningTaskDefaultConfig{
Resources: types.ResourcesConfig{
CPU: "500m",
Memory: "1Gb",
Memory: "512Mb",
},
},
},
Expand Down
1 change: 0 additions & 1 deletion pkg/swagger/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pkg/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,6 @@
}
},
"NodeID": {
"description": "TODO replace all access on this field with the `ID()` method",
"type": "string"
},
"NodeType": {
Expand Down
1 change: 0 additions & 1 deletion webui/lib/api/schema/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,6 @@
}
},
"NodeID": {
"description": "TODO replace all access on this field with the `ID()` method",
"type": "string"
},
"NodeType": {
Expand Down

0 comments on commit 0607cf3

Please sign in to comment.