-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't depend on firecracker in darwin builds (#790)
* Don't depend on firecracker in darwin builds * Make gazelle happy
- Loading branch information
1 parent
d85aa1d
commit 5166973
Showing
3 changed files
with
124 additions
and
21 deletions.
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
3 changes: 3 additions & 0 deletions
3
enterprise/server/remote_execution/containers/firecracker/firecracker.go
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// +build linux | ||
// +build !android | ||
|
||
package firecracker | ||
|
||
import ( | ||
|
88 changes: 88 additions & 0 deletions
88
enterprise/server/remote_execution/containers/firecracker/firecracker_darwin.go
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,88 @@ | ||
// +build darwin | ||
// +build !ios | ||
|
||
package firecracker | ||
|
||
import ( | ||
"context" | ||
"io" | ||
|
||
"github.com/buildbuddy-io/buildbuddy/enterprise/server/remote_execution/container" | ||
"github.com/buildbuddy-io/buildbuddy/server/interfaces" | ||
"github.com/buildbuddy-io/buildbuddy/server/util/status" | ||
|
||
repb "github.com/buildbuddy-io/buildbuddy/proto/remote_execution" | ||
) | ||
|
||
type ContainerOpts struct { | ||
// The OCI container image. ex "alpine:latest" | ||
ContainerImage string | ||
|
||
// The action directory with inputs / outputs | ||
ActionWorkingDirectory string | ||
|
||
// The number of CPUs to allocate to this VM. | ||
NumCPUs int64 | ||
|
||
// The amount of RAM, in MB, to allocate to this VM. | ||
MemSizeMB int64 | ||
|
||
// Whether or not to enable networking. | ||
EnableNetworking bool | ||
|
||
// Optional flags -- these will default to sane values. | ||
// They are here primarily for debugging and running | ||
// VMs outside of the normal action-execution framework. | ||
|
||
// DebugMode runs init in debugmode and enables stdin/stdout so | ||
// that machines can be logged into via the console. | ||
DebugMode bool | ||
|
||
// ForceVMIdx forces a machine to use a particular vm index, | ||
// allowing for multiple locally-started VMs to avoid using | ||
// conflicting network interfaces. | ||
ForceVMIdx int | ||
} | ||
|
||
type firecrackerContainer struct{} | ||
|
||
func NewContainer(ctx context.Context, opts interface{}) (*firecrackerContainer, error) { | ||
c := &firecrackerContainer{} | ||
return c, nil | ||
} | ||
|
||
func (c *firecrackerContainer) Run(ctx context.Context, command *repb.Command, actionWorkingDir string) *interfaces.CommandResult { | ||
return &interfaces.CommandResult{} | ||
} | ||
|
||
func (c *firecrackerContainer) Create(ctx context.Context, actionWorkingDir string) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Exec(ctx context.Context, cmd *repb.Command, stdin io.Reader, stdout io.Writer) *interfaces.CommandResult { | ||
return &interfaces.CommandResult{} | ||
} | ||
|
||
func (c *firecrackerContainer) PullImageIfNecessary(ctx context.Context) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Remove(ctx context.Context) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Pause(ctx context.Context) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Unpause(ctx context.Context) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Wait(ctx context.Context) error { | ||
return status.UnimplementedError("Not yet implemented.") | ||
} | ||
|
||
func (c *firecrackerContainer) Stats(ctx context.Context) (*container.Stats, error) { | ||
return nil, status.UnimplementedError("Not yet implemented.") | ||
} |