Skip to content
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
5 changes: 5 additions & 0 deletions pkg/app/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ var CommandUp = &cli.Command{
Usage: "Specify the target platform for the build output, (for example, windows/amd64, linux/amd64, or darwin/arm64)",
DefaultText: runtimeutil.GetRuntimePlatform(),
},
&cli.StringSliceFlag{
Name: "cap",
Usage: "Add capabilities to the environment (e.g. `SYS_PTRACE`)",
},
},

Action: up,
Expand Down Expand Up @@ -275,6 +279,7 @@ func up(clicontext *cli.Context) error {
NumCPU: clicontext.String("cpus"),
NumMem: clicontext.String("memory"),
CPUSet: clicontext.String("cpu-set"),
Capabilities: clicontext.StringSlice("cap"),
Comment thread
kemingy marked this conversation as resolved.
}
if len(startOptions.NumCPU) > 0 && len(startOptions.CPUSet) > 0 {
return errors.New("`--cpus` and `--cpu-set` are mutually exclusive")
Expand Down
5 changes: 5 additions & 0 deletions pkg/envd/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ func (e dockerEngine) StartEnvd(ctx context.Context, so StartOptions) (*StartRes
"cpu-set": so.CPUSet,
"memory": so.NumMem,
"build-context": so.BuildContext,
"cap": so.Capabilities,
})
logger.Debug("starting the envd docker environment")

bar := InitProgressBar(5)
defer bar.Finish()
Expand Down Expand Up @@ -498,6 +500,9 @@ func (e dockerEngine) StartEnvd(ctx context.Context, so StartOptions) (*StartRes
if so.ShmSize > 0 {
hostConfig.ShmSize = int64(so.ShmSize) * 1024 * 1024
}
if len(so.Capabilities) > 0 {
hostConfig.CapAdd = so.Capabilities
}
// resource
if len(so.NumCPU) > 0 {
cpu, err := strconv.ParseFloat(so.NumCPU, 64)
Expand Down
1 change: 1 addition & 0 deletions pkg/envd/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type StartOptions struct {
Timeout time.Duration
ShmSize int
Forced bool
Capabilities []string
Comment thread
kemingy marked this conversation as resolved.
SshdHost string

EngineSource
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/ir/v1/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

// https://github.com/openai/codex
const (
codexDefaultVersion = "0.79.0"
codexDefaultVersion = "0.92.0"
Comment thread
kemingy marked this conversation as resolved.
)

func (g generalGraph) installAgentCodex(root llb.State, agent ir.CodeAgent) llb.State {
Expand Down
Loading