Port envd from e2b with internalized shared packages and Connect RPC
- Copy envd source from e2b-dev/infra, internalize shared dependencies
into envd/internal/shared/ (keys, filesystem, id, smap, utils)
- Switch from gRPC to Connect RPC for all envd services
- Update module paths to git.omukk.dev/wrenn/{sandbox,sandbox/envd}
- Add proto specs (process, filesystem) with buf-based code generation
- Implement full envd: process exec, filesystem ops, port forwarding,
cgroup management, MMDS integration, and HTTP API
- Update main module dependencies (firecracker SDK, pgx, goose, etc.)
- Remove placeholder .gitkeep files replaced by real implementations
This commit is contained in:
30
envd/internal/services/process/update.go
Normal file
30
envd/internal/services/process/update.go
Normal file
@ -0,0 +1,30 @@
|
||||
package process
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"connectrpc.com/connect"
|
||||
"github.com/creack/pty"
|
||||
|
||||
rpc "git.omukk.dev/wrenn/sandbox/envd/internal/services/spec/process"
|
||||
)
|
||||
|
||||
func (s *Service) Update(_ context.Context, req *connect.Request[rpc.UpdateRequest]) (*connect.Response[rpc.UpdateResponse], error) {
|
||||
proc, err := s.getProcess(req.Msg.GetProcess())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if req.Msg.GetPty() != nil {
|
||||
err := proc.ResizeTty(&pty.Winsize{
|
||||
Rows: uint16(req.Msg.GetPty().GetSize().GetRows()),
|
||||
Cols: uint16(req.Msg.GetPty().GetSize().GetCols()),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("error resizing tty: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
return connect.NewResponse(&rpc.UpdateResponse{}), nil
|
||||
}
|
||||
Reference in New Issue
Block a user