diff --git a/go/deploy/builderd/README.md b/go/deploy/builderd/README.md index a2c99f0d0d..8fb43888bb 100644 --- a/go/deploy/builderd/README.md +++ b/go/deploy/builderd/README.md @@ -70,7 +70,7 @@ curl -X POST http://localhost:8082/builder.v1.BuilderService/CreateBuild \ -d '{ "config": { "tenant": { - "tenant_id": "test-tenant", + "tenant_id": "example-tenant", "tier": "TENANT_TIER_FREE" }, "source": { @@ -220,8 +220,8 @@ import ( req := &builderv1.CreateBuildRequest{ Config: &builderv1.BuildConfig{ Tenant: &builderv1.TenantContext{ - TenantId: "tenant-123", - CustomerId: "customer-456", + TenantId: "example-tenant", + CustomerId: "example-customer", Tier: builderv1.TenantTier_TENANT_TIER_PRO, }, Source: &builderv1.BuildSource{ diff --git a/go/deploy/builderd/client/client.go b/go/deploy/builderd/client/client.go index df27b56aa0..ae8c74bc9b 100644 --- a/go/deploy/builderd/client/client.go +++ b/go/deploy/builderd/client/client.go @@ -3,7 +3,6 @@ package client import ( "context" "fmt" - "net/http" "time" "connectrpc.com/connect" @@ -20,12 +19,10 @@ type Config struct { // ServerAddress is the builderd server endpoint (e.g., "https://builderd:8082") ServerAddress string - // UserID is the user identifier for authentication + // I do not understand what this userID is. + // Is it an unkey user? or is it a linux user on the metal host? UserID string - // TenantID is the tenant identifier for data scoping - TenantID string - // TLS configuration TLSMode string // "disabled", "file", or "spiffe" SPIFFESocketPath string // Path to SPIFFE agent socket @@ -39,12 +36,9 @@ type Config struct { Timeout time.Duration } -// Client provides a high-level interface to builderd services type Client struct { builderService builderdv1connect.BuilderServiceClient tlsProvider tls.Provider - userID string - tenantID string serverAddr string } @@ -84,13 +78,6 @@ func New(ctx context.Context, config Config) (*Client, error) { httpClient := tlsProvider.HTTPClient() httpClient.Timeout = config.Timeout - // Add authentication and tenant isolation transport - httpClient.Transport = &tenantTransport{ - Base: httpClient.Transport, - UserID: config.UserID, - TenantID: config.TenantID, - } - // Create ConnectRPC client builderService := builderdv1connect.NewBuilderServiceClient( httpClient, @@ -100,8 +87,6 @@ func New(ctx context.Context, config Config) (*Client, error) { return &Client{ builderService: builderService, tlsProvider: tlsProvider, - userID: config.UserID, - tenantID: config.TenantID, serverAddr: config.ServerAddress, }, nil } @@ -136,8 +121,7 @@ func (c *Client) CreateBuild(ctx context.Context, req *CreateBuildRequest) (*Cre // GetBuild retrieves build status and progress func (c *Client) GetBuild(ctx context.Context, req *GetBuildRequest) (*GetBuildResponse, error) { pbReq := &builderv1.GetBuildRequest{ - BuildId: req.BuildID, - TenantId: req.TenantID, + BuildId: req.BuildID, } resp, err := c.builderService.GetBuild(ctx, connect.NewRequest(pbReq)) @@ -150,10 +134,9 @@ func (c *Client) GetBuild(ctx context.Context, req *GetBuildRequest) (*GetBuildR }, nil } -// ListBuilds lists builds with filtering (tenant-scoped) +// ListBuilds lists builds with filtering func (c *Client) ListBuilds(ctx context.Context, req *ListBuildsRequest) (*ListBuildsResponse, error) { pbReq := &builderv1.ListBuildsRequest{ - TenantId: req.TenantID, StateFilter: req.State, PageSize: req.PageSize, PageToken: req.PageToken, @@ -174,8 +157,7 @@ func (c *Client) ListBuilds(ctx context.Context, req *ListBuildsRequest) (*ListB // CancelBuild cancels a running build func (c *Client) CancelBuild(ctx context.Context, req *CancelBuildRequest) (*CancelBuildResponse, error) { pbReq := &builderv1.CancelBuildRequest{ - BuildId: req.BuildID, - TenantId: req.TenantID, + BuildId: req.BuildID, } resp, err := c.builderService.CancelBuild(ctx, connect.NewRequest(pbReq)) @@ -192,9 +174,8 @@ func (c *Client) CancelBuild(ctx context.Context, req *CancelBuildRequest) (*Can // DeleteBuild deletes a build and its artifacts func (c *Client) DeleteBuild(ctx context.Context, req *DeleteBuildRequest) (*DeleteBuildResponse, error) { pbReq := &builderv1.DeleteBuildRequest{ - BuildId: req.BuildID, - TenantId: req.TenantID, - Force: req.Force, + BuildId: req.BuildID, + Force: req.Force, } resp, err := c.builderService.DeleteBuild(ctx, connect.NewRequest(pbReq)) @@ -210,9 +191,8 @@ func (c *Client) DeleteBuild(ctx context.Context, req *DeleteBuildRequest) (*Del // StreamBuildLogs streams build logs in real-time func (c *Client) StreamBuildLogs(ctx context.Context, req *StreamBuildLogsRequest) (*connect.ServerStreamForClient[builderv1.StreamBuildLogsResponse], error) { pbReq := &builderv1.StreamBuildLogsRequest{ - BuildId: req.BuildID, - TenantId: req.TenantID, - Follow: req.Follow, + BuildId: req.BuildID, + Follow: req.Follow, } stream, err := c.builderService.StreamBuildLogs(ctx, connect.NewRequest(pbReq)) @@ -223,28 +203,9 @@ func (c *Client) StreamBuildLogs(ctx context.Context, req *StreamBuildLogsReques return stream, nil } -// GetTenantQuotas retrieves tenant quotas and usage -func (c *Client) GetTenantQuotas(ctx context.Context, req *GetTenantQuotasRequest) (*GetTenantQuotasResponse, error) { - pbReq := &builderv1.GetTenantQuotasRequest{ - TenantId: req.TenantID, - } - - resp, err := c.builderService.GetTenantQuotas(ctx, connect.NewRequest(pbReq)) - if err != nil { - return nil, fmt.Errorf("failed to get tenant quotas: %w", err) - } - - return &GetTenantQuotasResponse{ - Quotas: resp.Msg.CurrentLimits, - Usage: resp.Msg.CurrentUsage, - Violations: resp.Msg.Violations, - }, nil -} - // GetBuildStats retrieves build statistics func (c *Client) GetBuildStats(ctx context.Context, req *GetBuildStatsRequest) (*GetBuildStatsResponse, error) { pbReq := &builderv1.GetBuildStatsRequest{ - TenantId: req.TenantID, StartTime: req.StartTime, EndTime: req.EndTime, } @@ -259,42 +220,7 @@ func (c *Client) GetBuildStats(ctx context.Context, req *GetBuildStatsRequest) ( }, nil } -// GetTenantID returns the tenant ID associated with this client -func (c *Client) GetTenantID() string { - return c.tenantID -} - // GetServerAddress returns the server address this client is connected to func (c *Client) GetServerAddress() string { return c.serverAddr } - -// tenantTransport adds authentication and tenant isolation headers to all requests -type tenantTransport struct { - Base http.RoundTripper - UserID string - TenantID string -} - -func (t *tenantTransport) RoundTrip(req *http.Request) (*http.Response, error) { - // Clone the request to avoid modifying the original - req2 := req.Clone(req.Context()) - if req2.Header == nil { - req2.Header = make(http.Header) - } - - // Set Authorization header with development token format - // AIDEV-BUSINESS_RULE: In development, use "dev_user_" format - // TODO: Update to proper JWT tokens in production - req2.Header.Set("Authorization", fmt.Sprintf("Bearer dev_user_%s", t.UserID)) - - // Also set X-Tenant-ID header for tenant identification - req2.Header.Set("X-Tenant-ID", t.TenantID) - - // Use the base transport, or default if nil - base := t.Base - if base == nil { - base = http.DefaultTransport - } - return base.RoundTrip(req2) -} diff --git a/go/deploy/builderd/client/types.go b/go/deploy/builderd/client/types.go index 0fe8f4da33..294393b467 100644 --- a/go/deploy/builderd/client/types.go +++ b/go/deploy/builderd/client/types.go @@ -23,8 +23,7 @@ type CreateBuildResponse struct { // GetBuildRequest wraps builderv1.GetBuildRequest type GetBuildRequest struct { - BuildID string - TenantID string + BuildID string } // GetBuildResponse wraps builderv1.GetBuildResponse @@ -34,7 +33,6 @@ type GetBuildResponse struct { // ListBuildsRequest wraps builderv1.ListBuildsRequest type ListBuildsRequest struct { - TenantID string State []builderv1.BuildState PageSize int32 PageToken string @@ -49,8 +47,7 @@ type ListBuildsResponse struct { // CancelBuildRequest wraps builderv1.CancelBuildRequest type CancelBuildRequest struct { - BuildID string - TenantID string + BuildID string } // CancelBuildResponse wraps builderv1.CancelBuildResponse @@ -61,9 +58,8 @@ type CancelBuildResponse struct { // DeleteBuildRequest wraps builderv1.DeleteBuildRequest type DeleteBuildRequest struct { - BuildID string - TenantID string - Force bool + BuildID string + Force bool } // DeleteBuildResponse wraps builderv1.DeleteBuildResponse @@ -73,26 +69,12 @@ type DeleteBuildResponse struct { // StreamBuildLogsRequest wraps builderv1.StreamBuildLogsRequest type StreamBuildLogsRequest struct { - BuildID string - TenantID string - Follow bool -} - -// GetTenantQuotasRequest wraps builderv1.GetTenantQuotasRequest -type GetTenantQuotasRequest struct { - TenantID string -} - -// GetTenantQuotasResponse wraps builderv1.GetTenantQuotasResponse -type GetTenantQuotasResponse struct { - Quotas *builderv1.TenantResourceLimits - Usage *builderv1.TenantUsageStats - Violations []*builderv1.QuotaViolation + BuildID string + Follow bool } // GetBuildStatsRequest wraps builderv1.GetBuildStatsRequest type GetBuildStatsRequest struct { - TenantID string StartTime *timestamppb.Timestamp EndTime *timestamppb.Timestamp } diff --git a/go/deploy/builderd/cmd/builderd-cli/main.go b/go/deploy/builderd/cmd/builderd-cli/main.go index 016ed7767c..dde49112e1 100644 --- a/go/deploy/builderd/cmd/builderd-cli/main.go +++ b/go/deploy/builderd/cmd/builderd-cli/main.go @@ -21,8 +21,6 @@ import ( func main() { var ( serverAddr = flag.String("server", getEnvOrDefault("UNKEY_BUILDERD_SERVER_ADDRESS", "https://localhost:8082"), "builderd server address") - userID = flag.String("user", getEnvOrDefault("UNKEY_BUILDERD_USER_ID", "cli-user"), "user ID for authentication") - tenantID = flag.String("tenant", getEnvOrDefault("UNKEY_BUILDERD_TENANT_ID", "cli-tenant"), "tenant ID for data scoping") tlsMode = flag.String("tls-mode", getEnvOrDefault("UNKEY_BUILDERD_TLS_MODE", "spiffe"), "TLS mode: disabled, file, or spiffe") spiffeSocket = flag.String("spiffe-socket", getEnvOrDefault("UNKEY_BUILDERD_SPIFFE_SOCKET", "/var/lib/spire/agent/agent.sock"), "SPIFFE agent socket path") tlsCert = flag.String("tls-cert", "", "TLS certificate file (for file mode)") @@ -43,8 +41,6 @@ func main() { // Create builderd client config := client.Config{ ServerAddress: *serverAddr, - UserID: *userID, - TenantID: *tenantID, TLSMode: *tlsMode, SPIFFESocketPath: *spiffeSocket, TLSCertFile: *tlsCert, @@ -74,8 +70,6 @@ func main() { handleDeleteBuild(ctx, builderClient, *jsonOutput) case "stream-logs": handleStreamLogs(ctx, builderClient, *jsonOutput) - case "get-quotas": - handleGetQuotas(ctx, builderClient, *jsonOutput) case "get-stats": handleGetStats(ctx, builderClient, *jsonOutput) default: @@ -93,23 +87,20 @@ Usage: %s [flags] [args...] Commands: create-build Create a new build from Docker image get-build Get build status and details - list-builds List builds for tenant + list-builds List builds cancel-build Cancel a running build delete-build Delete a build and its artifacts stream-logs Stream build logs in real-time - get-quotas Get tenant quotas and usage get-stats Get build statistics Environment Variables: UNKEY_BUILDERD_SERVER_ADDRESS Server address (default: https://localhost:8082) - UNKEY_BUILDERD_USER_ID User ID for authentication (default: cli-user) - UNKEY_BUILDERD_TENANT_ID Tenant ID for data scoping (default: cli-tenant) UNKEY_BUILDERD_TLS_MODE TLS mode (default: spiffe) UNKEY_BUILDERD_SPIFFE_SOCKET SPIFFE socket path (default: /var/lib/spire/agent/agent.sock) Examples: # Create build from Docker image with SPIFFE authentication - %s -user=prod-user-123 -tenant=prod-tenant-456 create-build ubuntu:latest + %s create-build ubuntu:latest # Get build status %s get-build build-12345 @@ -120,8 +111,6 @@ Examples: # Stream build logs %s stream-logs build-12345 - # Get tenant quotas - %s get-quotas # Get build statistics %s get-stats @@ -129,7 +118,7 @@ Examples: # Get response with JSON output %s get-build build-12345 -json -`, os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0]) +`, os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0], os.Args[0]) } func handleCreateBuild(ctx context.Context, builderClient *client.Client, jsonOutput bool) { @@ -140,10 +129,6 @@ func handleCreateBuild(ctx context.Context, builderClient *client.Client, jsonOu // Create a basic Docker image build configuration config := &builderv1.BuildConfig{ - Tenant: &builderv1.TenantContext{ - TenantId: builderClient.GetTenantID(), - CustomerId: builderClient.GetTenantID(), - }, Source: &builderv1.BuildSource{ SourceType: &builderv1.BuildSource_DockerImage{ DockerImage: &builderv1.DockerImageSource{ @@ -195,8 +180,7 @@ func handleGetBuild(ctx context.Context, builderClient *client.Client, jsonOutpu buildID := flag.Arg(1) req := &client.GetBuildRequest{ - BuildID: buildID, - TenantID: builderClient.GetTenantID(), + BuildID: buildID, } resp, err := builderClient.GetBuild(ctx, req) @@ -223,7 +207,6 @@ func handleGetBuild(ctx context.Context, builderClient *client.Client, jsonOutpu func handleListBuilds(ctx context.Context, builderClient *client.Client, jsonOutput bool) { req := &client.ListBuildsRequest{ - TenantID: builderClient.GetTenantID(), PageSize: 50, } @@ -252,8 +235,7 @@ func handleCancelBuild(ctx context.Context, builderClient *client.Client, jsonOu buildID := flag.Arg(1) req := &client.CancelBuildRequest{ - BuildID: buildID, - TenantID: builderClient.GetTenantID(), + BuildID: buildID, } resp, err := builderClient.CancelBuild(ctx, req) @@ -284,9 +266,8 @@ func handleDeleteBuild(ctx context.Context, builderClient *client.Client, jsonOu } req := &client.DeleteBuildRequest{ - BuildID: buildID, - TenantID: builderClient.GetTenantID(), - Force: force, + BuildID: buildID, + Force: force, } resp, err := builderClient.DeleteBuild(ctx, req) @@ -311,9 +292,8 @@ func handleStreamLogs(ctx context.Context, builderClient *client.Client, jsonOut buildID := flag.Arg(1) req := &client.StreamBuildLogsRequest{ - BuildID: buildID, - TenantID: builderClient.GetTenantID(), - Follow: true, + BuildID: buildID, + Follow: true, } stream, err := builderClient.StreamBuildLogs(ctx, req) @@ -340,38 +320,6 @@ func handleStreamLogs(ctx context.Context, builderClient *client.Client, jsonOut } } -func handleGetQuotas(ctx context.Context, builderClient *client.Client, jsonOutput bool) { - req := &client.GetTenantQuotasRequest{ - TenantID: builderClient.GetTenantID(), - } - - resp, err := builderClient.GetTenantQuotas(ctx, req) - if err != nil { - log.Fatalf("Failed to get tenant quotas: %v", err) - } - - if jsonOutput { - outputJSON(resp) - } else { - fmt.Printf("Tenant quotas and usage:\n") - if resp.Quotas != nil { - fmt.Printf(" Limits:\n") - fmt.Printf(" Max concurrent builds: %d\n", resp.Quotas.MaxConcurrentBuilds) - fmt.Printf(" Max daily builds: %d\n", resp.Quotas.MaxDailyBuilds) - fmt.Printf(" Max storage bytes: %d\n", resp.Quotas.MaxStorageBytes) - } - if resp.Usage != nil { - fmt.Printf(" Current usage:\n") - fmt.Printf(" Active builds: %d\n", resp.Usage.ActiveBuilds) - fmt.Printf(" Daily builds used: %d\n", resp.Usage.DailyBuildsUsed) - fmt.Printf(" Storage used: %d bytes\n", resp.Usage.StorageBytesUsed) - } - if len(resp.Violations) > 0 { - fmt.Printf(" Quota violations: %d\n", len(resp.Violations)) - } - } -} - func handleGetStats(ctx context.Context, builderClient *client.Client, jsonOutput bool) { // Default to last 24 hours endTime := time.Now() @@ -385,7 +333,6 @@ func handleGetStats(ctx context.Context, builderClient *client.Client, jsonOutpu } req := &client.GetBuildStatsRequest{ - TenantID: builderClient.GetTenantID(), StartTime: timestamppb.New(startTime), EndTime: timestamppb.New(endTime), } diff --git a/go/deploy/builderd/cmd/builderd/main.go b/go/deploy/builderd/cmd/builderd/main.go index 8ff9d4c448..94c978fa00 100644 --- a/go/deploy/builderd/cmd/builderd/main.go +++ b/go/deploy/builderd/cmd/builderd/main.go @@ -129,7 +129,6 @@ func main() { slog.String("port", cfg.Server.Port), slog.String("storage_backend", cfg.Storage.Backend), slog.Bool("otel_enabled", cfg.OpenTelemetry.Enabled), - slog.Bool("tenant_isolation", cfg.Tenant.IsolationEnabled), slog.Int("max_concurrent_builds", cfg.Builder.MaxConcurrentBuilds), ) @@ -196,7 +195,6 @@ func main() { // TODO: Initialize database // TODO: Initialize storage backend // TODO: Initialize Docker client - // TODO: Initialize tenant manager // TODO: Initialize build executor registry // Initialize assetmanagerd client @@ -242,12 +240,6 @@ func main() { interceptors.WithRequestDurationMetric(false), // Match existing behavior interceptors.WithErrorResampling(true), interceptors.WithPanicStackTrace(true), - interceptors.WithTenantAuth(true, - // Exempt health check endpoints from tenant auth - "/health.v1.HealthService/Check", - // Exempt admin/stats endpoints from tenant auth - "/builder.v1.BuilderService/GetBuildStats", - ), } // Add meter if OpenTelemetry is enabled @@ -255,7 +247,7 @@ func main() { interceptorOpts = append(interceptorOpts, interceptors.WithMeter(otel.Meter("builderd"))) } - // Get default interceptors (tenant auth, metrics, logging) + // Get default interceptors (metrics, logging) sharedInterceptors := interceptors.NewDefaultInterceptors("builderd", interceptorOpts...) // Convert UnaryInterceptorFunc to Interceptor diff --git a/go/deploy/builderd/go.mod b/go/deploy/builderd/go.mod index 8ff9300fa8..df3170711f 100644 --- a/go/deploy/builderd/go.mod +++ b/go/deploy/builderd/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/otel/sdk v1.37.0 go.opentelemetry.io/otel/sdk/metric v1.37.0 go.opentelemetry.io/otel/trace v1.37.0 - golang.org/x/net v0.42.0 + golang.org/x/net v0.43.0 golang.org/x/sync v0.16.0 golang.org/x/time v0.12.0 google.golang.org/protobuf v1.36.8 @@ -45,13 +45,13 @@ require ( github.com/unkeyed/unkey/go/deploy/pkg/tracing v0.0.0-00010101000000-000000000000 // indirect github.com/zeebo/errs v1.4.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.0 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/grpc v1.73.0 // indirect + go.opentelemetry.io/proto/otlp v1.7.1 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect + google.golang.org/grpc v1.74.2 // indirect ) replace github.com/unkeyed/unkey/go/deploy/pkg/tls => ../pkg/tls diff --git a/go/deploy/builderd/go.sum b/go/deploy/builderd/go.sum index ca414c06a0..6cd39cc88c 100644 --- a/go/deploy/builderd/go.sum +++ b/go/deploy/builderd/go.sum @@ -45,8 +45,8 @@ github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzM github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= +github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM= github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= @@ -71,28 +71,28 @@ go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFh go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= -go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os= -go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo= +go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= +go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= +google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 h1:APHvLLYBhtZvsbnpkfknDZ7NyH4z5+ub/I0u8L3Oz6g= +google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1/go.mod h1:xUjFWUnWDpZ/C0Gu0qloASKFb6f8/QXiiXhSPFsD668= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 h1:pmJpJEvT846VzausCQ5d7KreSROcDqmO388w5YbnltA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1/go.mod h1:GmFNa4BdJZ2a8G+wCe9Bg3wwThLrJun751XstdJt5Og= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/go/deploy/builderd/internal/assetmanager/client.go b/go/deploy/builderd/internal/assetmanager/client.go index c574713af7..6abf1da52a 100644 --- a/go/deploy/builderd/internal/assetmanager/client.go +++ b/go/deploy/builderd/internal/assetmanager/client.go @@ -102,18 +102,6 @@ func (c *Client) RegisterBuildArtifactWithID(ctx context.Context, buildID, artif // AIDEV-NOTE: This properly uploads the file to assetmanagerd's storage and registers it stream := c.client.UploadAsset(ctx) - // Try to extract tenant info from labels for headers - tenantID := labels["tenant_id"] - customerID := labels["customer_id"] - - // Set tenant headers on the stream if available - if tenantID != "" { - stream.RequestHeader().Set("X-Tenant-ID", tenantID) - } - if customerID != "" { - stream.RequestHeader().Set("X-Customer-ID", customerID) - } - // Send metadata first metadataReq := &assetv1.UploadAssetRequest{ Data: &assetv1.UploadAssetRequest_Metadata{ diff --git a/go/deploy/builderd/internal/assets/base.go b/go/deploy/builderd/internal/assets/base.go index d18f8fc76e..03ef405f86 100644 --- a/go/deploy/builderd/internal/assets/base.go +++ b/go/deploy/builderd/internal/assets/base.go @@ -283,8 +283,6 @@ func (m *BaseAssetManager) registerAsset(ctx context.Context, asset BaseAsset, l maps.Copy(labels, asset.Labels) labels["created_by"] = "builderd" - labels["customer_id"] = "system" - labels["tenant_id"] = "system" // Get relative path within storage directory relPath, err := filepath.Rel(m.storageDir, localPath) diff --git a/go/deploy/builderd/internal/config/config.go b/go/deploy/builderd/internal/config/config.go index ecbec4540f..89189e56f1 100644 --- a/go/deploy/builderd/internal/config/config.go +++ b/go/deploy/builderd/internal/config/config.go @@ -14,7 +14,6 @@ type Config struct { Builder BuilderConfig `yaml:"builder"` Storage StorageConfig `yaml:"storage"` Docker DockerConfig `yaml:"docker"` - Tenant TenantConfig `yaml:"tenant"` Database DatabaseConfig `yaml:"database"` OpenTelemetry OpenTelemetryConfig `yaml:"opentelemetry"` TLS *TLSConfig `yaml:"tls,omitempty"` @@ -77,15 +76,7 @@ type DockerConfig struct { InsecureRegistries []string `yaml:"insecure_registries,omitempty"` } -// TenantConfig holds multi-tenancy configuration -type TenantConfig struct { - DefaultTier string `yaml:"default_tier"` - IsolationEnabled bool `yaml:"isolation_enabled"` - QuotaCheckInterval time.Duration `yaml:"quota_check_interval"` - DefaultResourceLimits ResourceLimits `yaml:"default_resource_limits"` -} - -// ResourceLimits defines default resource limits per tenant tier +// ResourceLimits defines default resource limits type ResourceLimits struct { MaxMemoryBytes int64 `yaml:"max_memory_bytes"` MaxCPUCores int32 `yaml:"max_cpu_cores"` @@ -183,21 +174,6 @@ func LoadConfigWithLogger(logger *slog.Logger) (*Config, error) { RegistryMirror: getEnvOrDefault("UNKEY_BUILDERD_DOCKER_REGISTRY_MIRROR", ""), InsecureRegistries: getEnvSliceOrDefault("UNKEY_BUILDERD_DOCKER_INSECURE_REGISTRIES", []string{}), }, - Tenant: TenantConfig{ - DefaultTier: getEnvOrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_TIER", "free"), - IsolationEnabled: getEnvBoolOrDefault("UNKEY_BUILDERD_TENANT_ISOLATION_ENABLED", true), - QuotaCheckInterval: getEnvDurationOrDefault("UNKEY_BUILDERD_TENANT_QUOTA_CHECK_INTERVAL", 5*time.Minute), - DefaultResourceLimits: ResourceLimits{ - MaxMemoryBytes: getEnvInt64OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_MEMORY_BYTES", 2<<30), // 2GB - MaxCPUCores: getEnvInt32OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_CPU_CORES", 2), - MaxDiskBytes: getEnvInt64OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_DISK_BYTES", 10<<30), // 10GB - TimeoutSeconds: getEnvInt32OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_TIMEOUT_SECONDS", 900), // 15min - MaxConcurrentBuilds: getEnvInt32OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_CONCURRENT_BUILDS", 3), - MaxDailyBuilds: getEnvInt32OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_DAILY_BUILDS", 100), - MaxStorageBytes: getEnvInt64OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_STORAGE_BYTES", 50<<30), // 50GB - MaxBuildTimeMinutes: getEnvInt32OrDefault("UNKEY_BUILDERD_TENANT_DEFAULT_MAX_BUILD_TIME_MINUTES", 30), - }, - }, Database: DatabaseConfig{ DataDir: getEnvOrDefault("UNKEY_BUILDERD_DATABASE_DATA_DIR", "/opt/builderd/data"), Type: getEnvOrDefault("UNKEY_BUILDERD_DATABASE_TYPE", "sqlite"), @@ -242,7 +218,6 @@ func LoadConfigWithLogger(logger *slog.Logger) (*Config, error) { slog.String("server_port", config.Server.Port), slog.String("storage_backend", config.Storage.Backend), slog.Bool("otel_enabled", config.OpenTelemetry.Enabled), - slog.Bool("tenant_isolation", config.Tenant.IsolationEnabled), slog.Int("max_concurrent_builds", config.Builder.MaxConcurrentBuilds), ) diff --git a/go/deploy/builderd/internal/executor/docker.go b/go/deploy/builderd/internal/executor/docker.go index 43057da626..06cf383383 100644 --- a/go/deploy/builderd/internal/executor/docker.go +++ b/go/deploy/builderd/internal/executor/docker.go @@ -58,7 +58,7 @@ func (d *DockerExecutor) ExtractDockerImageWithID(ctx context.Context, request * // Record build start metrics if d.buildMetrics != nil { - d.buildMetrics.RecordBuildStart(ctx, "docker", "docker", "") + d.buildMetrics.RecordBuildStart(ctx, "docker", "docker") } defer func() { @@ -913,18 +913,12 @@ func (d *DockerExecutor) extractContainerMetadata(ctx context.Context, logger *s } } - // Extract user - if user, ok := config["User"].(string); ok { - metadata.User = user - } - logger.InfoContext(ctx, "extracted container metadata", slog.Int("entrypoint_len", len(metadata.Entrypoint)), slog.Int("cmd_len", len(metadata.Command)), slog.String("working_dir", metadata.WorkingDir), slog.Int("env_vars", len(metadata.Env)), slog.Int("exposed_ports", len(metadata.ExposedPorts)), - slog.String("user", metadata.User), ) return metadata, nil @@ -1074,12 +1068,10 @@ func (d *DockerExecutor) createContainerEnv(ctx context.Context, logger *slog.Lo envConfig := struct { WorkingDir string `json:"working_dir,omitempty"` Env map[string]string `json:"env,omitempty"` - User string `json:"user,omitempty"` ExposedPorts []string `json:"exposed_ports,omitempty"` }{ WorkingDir: metadata.WorkingDir, Env: metadata.Env, - User: metadata.User, ExposedPorts: metadata.ExposedPorts, } diff --git a/go/deploy/builderd/internal/executor/docker_pipeline.go b/go/deploy/builderd/internal/executor/docker_pipeline.go index 3a6ce631a0..90f6487650 100644 --- a/go/deploy/builderd/internal/executor/docker_pipeline.go +++ b/go/deploy/builderd/internal/executor/docker_pipeline.go @@ -10,7 +10,6 @@ import ( "github.com/unkeyed/unkey/go/deploy/builderd/internal/config" "github.com/unkeyed/unkey/go/deploy/builderd/internal/observability" - "github.com/unkeyed/unkey/go/deploy/pkg/observability/interceptors" builderv1 "github.com/unkeyed/unkey/go/gen/proto/deploy/builderd/v1" ) @@ -41,14 +40,7 @@ func NewDockerPipelineExecutor(logger *slog.Logger, cfg *config.Config, metrics func (d *DockerPipelineExecutor) ExtractDockerImageWithID(ctx context.Context, request *builderv1.CreateBuildRequest, buildID string) (*BuildResult, error) { start := time.Now() - // Get tenant context for logging and metrics - tenantID := "unknown" - if auth, ok := interceptors.TenantFromContext(ctx); ok { - tenantID = auth.TenantID - } - logger := d.logger.With( - slog.String("tenant_id", tenantID), slog.String("build_id", buildID), slog.String("image_uri", request.GetConfig().GetSource().GetDockerImage().GetImageUri()), ) @@ -57,7 +49,7 @@ func (d *DockerPipelineExecutor) ExtractDockerImageWithID(ctx context.Context, r // Record build start metrics if d.buildMetrics != nil { - d.buildMetrics.RecordBuildStart(ctx, "docker", "docker", tenantID) + d.buildMetrics.RecordBuildStart(ctx, "docker", "docker") } defer func() { @@ -121,14 +113,7 @@ func (d *DockerPipelineExecutor) ExtractDockerImageWithID(ctx context.Context, r func (d *DockerPipelineExecutor) ResumeBuild(ctx context.Context, request *builderv1.CreateBuildRequest, buildID string, lastCompletedStep int) (*BuildResult, error) { start := time.Now() - // Get tenant context for logging and metrics - tenantID := "unknown" - if auth, ok := interceptors.TenantFromContext(ctx); ok { - tenantID = auth.TenantID - } - logger := d.logger.With( - slog.String("tenant_id", tenantID), slog.String("build_id", buildID), slog.String("image_uri", request.GetConfig().GetSource().GetDockerImage().GetImageUri()), slog.Int("resume_from_step", lastCompletedStep+1), diff --git a/go/deploy/builderd/internal/executor/types.go b/go/deploy/builderd/internal/executor/types.go index ba02bc813a..df792a2254 100644 --- a/go/deploy/builderd/internal/executor/types.go +++ b/go/deploy/builderd/internal/executor/types.go @@ -39,9 +39,6 @@ type BuildResult struct { // WorkspaceDir is the temporary workspace directory WorkspaceDir string - // TenantID is the tenant this build belongs to - TenantID string - // StartTime when the build began StartTime time.Time diff --git a/go/deploy/builderd/internal/observability/metrics.go b/go/deploy/builderd/internal/observability/metrics.go index 859ce3e616..b0048172ef 100644 --- a/go/deploy/builderd/internal/observability/metrics.go +++ b/go/deploy/builderd/internal/observability/metrics.go @@ -293,11 +293,11 @@ func NewBuildMetrics(logger *slog.Logger, highCardinalityEnabled bool) (*BuildMe } // RecordBuildStart records the start of a build -func (m *BuildMetrics) RecordBuildStart(ctx context.Context, buildType, sourceType, tenantTier string) { +func (m *BuildMetrics) RecordBuildStart(ctx context.Context, buildType, sourceType string) { + attrs := []attribute.KeyValue{ attribute.String("build_type", buildType), attribute.String("source_type", sourceType), - attribute.String("tenant_tier", tenantTier), } m.buildsTotal.Add(ctx, 1, metric.WithAttributes(attrs...)) diff --git a/go/deploy/builderd/internal/service/builder.go b/go/deploy/builderd/internal/service/builder.go index 665fe0efb4..5bec227ce6 100644 --- a/go/deploy/builderd/internal/service/builder.go +++ b/go/deploy/builderd/internal/service/builder.go @@ -124,29 +124,17 @@ func (s *BuilderService) CreateBuild( ctx context.Context, req *connect.Request[builderv1.CreateBuildRequest], ) (*connect.Response[builderv1.CreateBuildResponse], error) { - // Extract tenant info safely - var tenantID, customerID string - if req.Msg != nil && req.Msg.GetConfig() != nil && req.Msg.GetConfig().GetTenant() != nil { - tenantID = req.Msg.GetConfig().GetTenant().GetTenantId() - customerID = req.Msg.GetConfig().GetTenant().GetCustomerId() - } - s.logger.InfoContext(ctx, "create build request received", - slog.String("tenant_id", tenantID), - slog.String("customer_id", customerID), - ) + s.logger.InfoContext(ctx, "create build request received") // Validate build configuration first to prevent nil pointer dereference if err := s.validateBuildConfig(req.Msg.GetConfig()); err != nil { s.logger.WarnContext(ctx, "invalid build configuration", slog.String("error", err.Error()), - slog.String("tenant_id", tenantID), ) return nil, connect.NewError(connect.CodeInvalidArgument, err) } - // TODO: Check tenant quotas - // Create build job record buildJob := &builderv1.BuildJob{ BuildId: generateBuildID(), @@ -172,13 +160,8 @@ func (s *BuilderService) CreateBuild( // This prevents builds from running indefinitely during shutdown buildCtx := s.shutdownCtx - // AIDEV-NOTE: Preserve tenant context for asset registration - tenantID := req.Msg.GetConfig().GetTenant().GetTenantId() - customerID := req.Msg.GetConfig().GetTenant().GetCustomerId() - s.logger.InfoContext(buildCtx, "starting async build execution", slog.String("build_id", buildJob.BuildId), - slog.String("tenant_id", req.Msg.GetConfig().GetTenant().GetTenantId()), ) // AIDEV-NOTE: Check for shutdown signal before starting expensive build operation @@ -209,14 +192,12 @@ func (s *BuilderService) CreateBuild( s.logger.ErrorContext(buildCtx, "build execution failed", slog.String("error", err.Error()), slog.String("build_id", buildJob.BuildId), - slog.String("tenant_id", req.Msg.GetConfig().GetTenant().GetTenantId()), ) return } s.logger.InfoContext(buildCtx, "build job completed successfully", slog.String("build_id", buildJob.BuildId), - slog.String("tenant_id", req.Msg.GetConfig().GetTenant().GetTenantId()), slog.String("source_type", buildResult.SourceType), slog.String("rootfs_path", buildResult.RootfsPath), slog.Duration("duration", buildResult.EndTime.Sub(buildResult.StartTime)), @@ -242,8 +223,6 @@ func (s *BuilderService) CreateBuild( if buildState == builderv1.BuildState_BUILD_STATE_COMPLETED && s.assetClient.IsEnabled() { labels := map[string]string{ "source_type": buildResult.SourceType, - "tenant_id": tenantID, // AIDEV-NOTE: Include tenant info for asset registration - "customer_id": customerID, // AIDEV-NOTE: Include customer info for asset registration } // Add docker image label if it's a Docker source @@ -303,19 +282,12 @@ func (s *BuilderService) CreateBuild( ) } else { // Create kernel labels - var tenantID, customerID string - if buildJob.Config != nil && buildJob.Config.Tenant != nil { - tenantID = buildJob.Config.Tenant.TenantId - customerID = buildJob.Config.Tenant.CustomerId - } kernelLabels := map[string]string{ "kernel_type": "bundled", "compatible_os": extractOSFromImage(sourceImage), "build_id": buildJob.BuildId, "created_by": "builderd", - "tenant_id": tenantID, - "customer_id": customerID, } kernelAssetID, err := s.assetClient.RegisterBuildArtifactWithID( @@ -363,11 +335,8 @@ func (s *BuilderService) GetBuild( ) (*connect.Response[builderv1.GetBuildResponse], error) { s.logger.InfoContext(ctx, "get build request received", slog.String("build_id", req.Msg.GetBuildId()), - slog.String("tenant_id", req.Msg.GetTenantId()), ) - // TODO: Validate tenant has access to this build - // Retrieve build from memory storage s.buildsMutex.RLock() build, exists := s.builds[req.Msg.GetBuildId()] @@ -385,17 +354,16 @@ func (s *BuilderService) GetBuild( return connect.NewResponse(resp), nil } -// ListBuilds lists builds for a tenant +// ListBuilds lists builds func (s *BuilderService) ListBuilds( ctx context.Context, req *connect.Request[builderv1.ListBuildsRequest], ) (*connect.Response[builderv1.ListBuildsResponse], error) { s.logger.InfoContext(ctx, "list builds request received", - slog.String("tenant_id", req.Msg.GetTenantId()), slog.Int("page_size", int(req.Msg.GetPageSize())), ) - // TODO: Retrieve builds from database with tenant filtering + // TODO: Retrieve builds from database // TODO: Apply state filters // TODO: Implement pagination @@ -416,10 +384,8 @@ func (s *BuilderService) CancelBuild( ) (*connect.Response[builderv1.CancelBuildResponse], error) { s.logger.InfoContext(ctx, "cancel build request received", slog.String("build_id", req.Msg.GetBuildId()), - slog.String("tenant_id", req.Msg.GetTenantId()), ) - // TODO: Validate tenant has access to this build // TODO: Cancel the running build process // TODO: Update build state in database @@ -443,11 +409,9 @@ func (s *BuilderService) DeleteBuild( ) (*connect.Response[builderv1.DeleteBuildResponse], error) { s.logger.InfoContext(ctx, "delete build request received", slog.String("build_id", req.Msg.GetBuildId()), - slog.String("tenant_id", req.Msg.GetTenantId()), slog.Bool("force", req.Msg.GetForce()), ) - // TODO: Validate tenant has access to this build // TODO: Check if build is running (and force flag) // TODO: Delete build from database // TODO: Delete build artifacts from storage @@ -467,11 +431,9 @@ func (s *BuilderService) StreamBuildLogs( ) error { s.logger.InfoContext(ctx, "stream build logs request received", slog.String("build_id", req.Msg.GetBuildId()), - slog.String("tenant_id", req.Msg.GetTenantId()), slog.Bool("follow", req.Msg.GetFollow()), ) - // TODO: Validate tenant has access to this build // TODO: Stream existing logs // TODO: If follow=true, stream new logs as they arrive @@ -491,55 +453,12 @@ func (s *BuilderService) StreamBuildLogs( return nil } -// GetTenantQuotas retrieves tenant quota information -func (s *BuilderService) GetTenantQuotas( - ctx context.Context, - req *connect.Request[builderv1.GetTenantQuotasRequest], -) (*connect.Response[builderv1.GetTenantQuotasResponse], error) { - s.logger.InfoContext(ctx, "get tenant quotas request received", - slog.String("tenant_id", req.Msg.GetTenantId()), - ) - - // TODO: Retrieve tenant configuration - // TODO: Calculate current usage - // TODO: Check for quota violations - - // Return default quotas for now - resp := &builderv1.GetTenantQuotasResponse{ - CurrentLimits: &builderv1.TenantResourceLimits{ //nolint:exhaustruct // AllowedRegistries, AllowedGitHosts, AllowPrivilegedBuilds, BlockedCommands, SandboxLevel are tenant-specific overrides not set in defaults - MaxMemoryBytes: s.config.Tenant.DefaultResourceLimits.MaxMemoryBytes, - MaxCpuCores: s.config.Tenant.DefaultResourceLimits.MaxCPUCores, - MaxDiskBytes: s.config.Tenant.DefaultResourceLimits.MaxDiskBytes, - TimeoutSeconds: s.config.Tenant.DefaultResourceLimits.TimeoutSeconds, - MaxConcurrentBuilds: s.config.Tenant.DefaultResourceLimits.MaxConcurrentBuilds, - MaxDailyBuilds: s.config.Tenant.DefaultResourceLimits.MaxDailyBuilds, - MaxStorageBytes: s.config.Tenant.DefaultResourceLimits.MaxStorageBytes, - MaxBuildTimeMinutes: s.config.Tenant.DefaultResourceLimits.MaxBuildTimeMinutes, - AllowExternalNetwork: true, - }, - CurrentUsage: &builderv1.TenantUsageStats{ - ActiveBuilds: 0, - DailyBuildsUsed: 0, - StorageBytesUsed: 0, - ComputeMinutesUsed: 0, - BuildsQueued: 0, - BuildsCompletedToday: 0, - BuildsFailedToday: 0, - }, - Violations: []*builderv1.QuotaViolation{}, - } - - return connect.NewResponse(resp), nil -} - // GetBuildStats retrieves build statistics func (s *BuilderService) GetBuildStats( ctx context.Context, req *connect.Request[builderv1.GetBuildStatsRequest], ) (*connect.Response[builderv1.GetBuildStatsResponse], error) { - s.logger.InfoContext(ctx, "get build stats request received", - slog.String("tenant_id", req.Msg.GetTenantId()), - ) + s.logger.InfoContext(ctx, "get build stats request received") // TODO: Calculate actual statistics from database @@ -562,14 +481,6 @@ func (s *BuilderService) validateBuildConfig(config *builderv1.BuildConfig) erro return fmt.Errorf("build config is required") } - if config.GetTenant() == nil { - return fmt.Errorf("tenant context is required") - } - - if config.GetTenant().GetTenantId() == "" { - return fmt.Errorf("tenant ID is required") - } - if config.GetSource() == nil { return fmt.Errorf("build source is required") } diff --git a/go/deploy/builderd/internal/tenant/isolation.go b/go/deploy/builderd/internal/tenant/isolation.go deleted file mode 100644 index 4a349939fc..0000000000 --- a/go/deploy/builderd/internal/tenant/isolation.go +++ /dev/null @@ -1,518 +0,0 @@ -package tenant - -import ( - "context" - "fmt" - "log/slog" - "os" - "os/exec" - "path/filepath" - "strconv" - "strings" - "syscall" - "time" - - builderv1 "github.com/unkeyed/unkey/go/gen/proto/deploy/builderd/v1" -) - -const ( - // NetworkModeNone disables all network access - NetworkModeNone = "none" -) - -// ProcessIsolator handles process-level isolation for builds -type ProcessIsolator struct { - logger *slog.Logger - tenantMgr *Manager - enableCgroups bool - enableSeccomp bool -} - -// NewProcessIsolator creates a new process isolator -func NewProcessIsolator(logger *slog.Logger, tenantMgr *Manager) *ProcessIsolator { - isolator := &ProcessIsolator{ - logger: logger, - tenantMgr: tenantMgr, - enableCgroups: true, - enableSeccomp: true, - } - - // Check if cgroups v2 is available - if _, err := os.Stat("/sys/fs/cgroup/cgroup.controllers"); err != nil { - isolator.enableCgroups = false - logger.WarnContext(context.Background(), "cgroups v2 not available, disabling cgroup isolation") - } - - return isolator -} - -// CreateIsolatedCommand creates a command with isolation constraints -func (p *ProcessIsolator) CreateIsolatedCommand( - ctx context.Context, - tenantID string, - tier builderv1.TenantTier, - buildID string, - command string, - args ...string, -) (*exec.Cmd, error) { - config, err := p.tenantMgr.GetTenantConfig(ctx, tenantID, tier) - if err != nil { - return nil, fmt.Errorf("failed to get tenant config: %w", err) - } - - constraints := p.buildConstraints(config, buildID) - - // Create the base command - cmd := exec.CommandContext(ctx, command, args...) - - // Apply process isolation - if err := p.applyProcessIsolation(cmd, constraints); err != nil { - return nil, fmt.Errorf("failed to apply process isolation: %w", err) - } - - // Apply resource limits - if err := p.applyResourceLimits(cmd, constraints, buildID); err != nil { - return nil, fmt.Errorf("failed to apply resource limits: %w", err) - } - - p.logger.InfoContext(ctx, "created isolated command", - slog.String("tenant_id", tenantID), - slog.String("build_id", buildID), - slog.String("command", command), - slog.Int64("memory_limit", constraints.MaxMemoryBytes), - slog.Int64("cpu_limit", int64(constraints.MaxCPUCores)), - ) - - return cmd, nil -} - -// CreateIsolatedDockerCommand creates a Docker command with tenant isolation -func (p *ProcessIsolator) CreateIsolatedDockerCommand( - ctx context.Context, - tenantID string, - tier builderv1.TenantTier, - buildID string, - dockerArgs []string, -) (*exec.Cmd, error) { - config, err := p.tenantMgr.GetTenantConfig(ctx, tenantID, tier) - if err != nil { - return nil, fmt.Errorf("failed to get tenant config: %w", err) - } - - constraints := p.buildConstraints(config, buildID) - - // Build Docker command with isolation flags - args := []string{"run", "--rm"} - - // Resource limits - args = append(args, "--memory", fmt.Sprintf("%d", constraints.MaxMemoryBytes)) - args = append(args, "--cpus", fmt.Sprintf("%d", constraints.MaxCPUCores)) - args = append(args, "--disk-quota", fmt.Sprintf("%d", constraints.MaxDiskBytes)) - - // Security settings - args = append(args, "--user", fmt.Sprintf("%d:%d", constraints.RunAsUser, constraints.RunAsGroup)) - args = append(args, "--read-only") - args = append(args, "--tmpfs", fmt.Sprintf("/tmp:size=%d", constraints.MaxTempSizeBytes)) - args = append(args, "--security-opt", "no-new-privileges:true") - - // Drop capabilities - for _, cap := range constraints.DroppedCapabilities { - args = append(args, "--cap-drop", cap) - } - - // Network isolation - switch constraints.NetworkMode { - case NetworkModeNone: - args = append(args, "--network", NetworkModeNone) - case "isolated": - args = append(args, "--network", fmt.Sprintf("builderd-tenant-%s", tenantID)) - default: - args = append(args, "--network", "bridge") - } - - // Add working directory - args = append(args, "--workdir", "/workspace") - args = append(args, "-v", fmt.Sprintf("%s:/workspace", constraints.WorkspaceDir)) - - // Environment variables for isolation - args = append(args, "-e", fmt.Sprintf("BUILDERD_TENANT_ID=%s", tenantID)) - args = append(args, "-e", fmt.Sprintf("BUILDERD_BUILD_ID=%s", buildID)) - args = append(args, "-e", "HOME=/tmp") - - // Add timeout - args = append(args, "--stop-timeout", fmt.Sprintf("%d", constraints.TimeoutSeconds)) - - // Append user-provided Docker args - args = append(args, dockerArgs...) - - cmd := exec.CommandContext(ctx, "docker", args...) - - // Set resource limits on the Docker process itself - if err := p.applyProcessIsolation(cmd, constraints); err != nil { - return nil, fmt.Errorf("failed to apply process isolation to docker command: %w", err) - } - - p.logger.InfoContext(ctx, "created isolated docker command", - slog.String("tenant_id", tenantID), - slog.String("build_id", buildID), - slog.Any("docker_args", args), - ) - - return cmd, nil -} - -// buildConstraints creates build constraints from tenant config -func (p *ProcessIsolator) buildConstraints(config *TenantConfig, buildID string) BuildConstraints { - // Default security settings - droppedCaps := []string{ - "AUDIT_CONTROL", "AUDIT_READ", "AUDIT_WRITE", - "BLOCK_SUSPEND", "DAC_READ_SEARCH", "FSETID", - "IPC_LOCK", "MAC_ADMIN", "MAC_OVERRIDE", - "MKNOD", "SETFCAP", "SYSLOG", "SYS_ADMIN", - "SYS_BOOT", "SYS_MODULE", "SYS_NICE", - "SYS_RAWIO", "SYS_RESOURCE", "SYS_TIME", - "WAKE_ALARM", - } - - // Determine network mode based on tier - networkMode := NetworkModeNone - if config.Limits.AllowExternalNetwork { - networkMode = "isolated" - } - - // Calculate temp directory size (10% of disk limit) - maxTempSize := config.Limits.MaxDiskBytes / 10 - if maxTempSize < 100*1024*1024 { // Minimum 100MB - maxTempSize = 100 * 1024 * 1024 - } - - return BuildConstraints{ //nolint:exhaustruct // BlockedDomains is optional and not configured via environment defaults - MaxMemoryBytes: config.Limits.MaxMemoryBytes, - MaxCPUCores: config.Limits.MaxCPUCores, - MaxDiskBytes: config.Limits.MaxDiskBytes, - TimeoutSeconds: config.Limits.TimeoutSeconds, - RunAsUser: 1000, // builderd user - RunAsGroup: 1000, // builderd group - ReadOnlyRootfs: true, - NoPrivileged: true, - DroppedCapabilities: droppedCaps, - NetworkMode: networkMode, - AllowedRegistries: config.Limits.AllowedRegistries, - AllowedGitHosts: config.Limits.AllowedGitHosts, - WorkspaceDir: filepath.Join("/tmp/builderd/workspace", config.TenantID, buildID), - RootfsDir: filepath.Join("/tmp/builderd/rootfs", config.TenantID, buildID), - TempDir: filepath.Join("/tmp/builderd/temp", config.TenantID, buildID), - MaxTempSizeBytes: maxTempSize, - } -} - -// applyProcessIsolation applies process-level isolation -// -//nolint:unparam // error return reserved for future enhancements -func (p *ProcessIsolator) applyProcessIsolation(cmd *exec.Cmd, constraints BuildConstraints) error { - // Set process credentials with safe conversion - uid, err := safeInt32ToUint32(constraints.RunAsUser) - if err != nil { - return fmt.Errorf("invalid RunAsUser value %d: %w", constraints.RunAsUser, err) - } - gid, err := safeInt32ToUint32(constraints.RunAsGroup) - if err != nil { - return fmt.Errorf("invalid RunAsGroup value %d: %w", constraints.RunAsGroup, err) - } - - cmd.SysProcAttr = &syscall.SysProcAttr{ //nolint:exhaustruct // Only setting necessary fields for process isolation - Credential: &syscall.Credential{ //nolint:exhaustruct // Groups and NoSetGroups are not needed for basic user/group isolation - Uid: uid, - Gid: gid, - }, - // Create new process group - Setpgid: true, - Pgid: 0, - } - - // Set environment for isolation - cmd.Env = []string{ - "HOME=/tmp", - "PATH=/usr/local/bin:/usr/bin:/bin", - "SHELL=/bin/sh", - "USER=builderd", - fmt.Sprintf("BUILDERD_WORKSPACE=%s", constraints.WorkspaceDir), - fmt.Sprintf("BUILDERD_ROOTFS=%s", constraints.RootfsDir), - fmt.Sprintf("BUILDERD_TEMP=%s", constraints.TempDir), - } - - return nil -} - -// applyResourceLimits applies resource limits using cgroups -// -//nolint:unparam // error return reserved for future cgroup v2 implementation -func (p *ProcessIsolator) applyResourceLimits(cmd *exec.Cmd, constraints BuildConstraints, buildID string) error { - if !p.enableCgroups { - p.logger.Debug("cgroups disabled, skipping resource limits") - return nil - } - - cgroupPath := fmt.Sprintf("/sys/fs/cgroup/builderd/%s", buildID) - - // Create cgroup directory - if err := os.MkdirAll(cgroupPath, 0755); err != nil { - p.logger.Warn("failed to create cgroup directory", slog.String("error", err.Error())) - return nil // Don't fail the build for cgroup issues - } - - // Set memory limit - memoryMax := filepath.Join(cgroupPath, "memory.max") - if err := os.WriteFile(memoryMax, []byte(strconv.FormatInt(constraints.MaxMemoryBytes, 10)), 0600); err != nil { - p.logger.Warn("failed to set memory limit", slog.String("error", err.Error())) - } - - // Set CPU limit (cgroups v2) - cpuMax := filepath.Join(cgroupPath, "cpu.max") - cpuQuota := fmt.Sprintf("%d 100000", constraints.MaxCPUCores*100000) // 100ms period - if err := os.WriteFile(cpuMax, []byte(cpuQuota), 0600); err != nil { - p.logger.Warn("failed to set CPU limit", slog.String("error", err.Error())) - } - - // Set IO limit (simplified) - ioMax := filepath.Join(cgroupPath, "io.max") - // Format: major:minor rbps=X wbps=Y riops=A wiops=B - // We'll set a conservative limit for now - maxBps := constraints.MaxDiskBytes / 300 // Spread over 5 minutes - ioLimit := fmt.Sprintf("8:0 rbps=%d wbps=%d", maxBps, maxBps) - if err := os.WriteFile(ioMax, []byte(ioLimit), 0600); err != nil { - p.logger.Debug("failed to set IO limit", slog.String("error", err.Error())) - } - - // Schedule cleanup of cgroup after build with proper process monitoring - go func() { - defer func() { - // Always cleanup cgroup regardless of how we exit - if err := os.RemoveAll(cgroupPath); err != nil { - p.logger.Warn("failed to cleanup cgroup", - slog.String("error", err.Error()), - slog.String("cgroup_path", cgroupPath), - slog.String("build_id", buildID), - ) - } else { - p.logger.Debug("cleaned up cgroup", - slog.String("cgroup_path", cgroupPath), - slog.String("build_id", buildID), - ) - } - }() - - // AIDEV-NOTE: Fixed memory leak - proper process monitoring instead of sleep - // This ensures the cleanup goroutine terminates when the process actually exits - // Wait for the actual process to complete (if it exists) - if cmd.Process != nil { - // Monitor process completion - state, err := cmd.Process.Wait() - if err != nil { - p.logger.Debug("error waiting for process completion", - slog.String("error", err.Error()), - slog.String("build_id", buildID), - ) - } else { - p.logger.Debug("process completed", - slog.String("build_id", buildID), - slog.Int("exit_code", state.ExitCode()), - ) - } - } else { - // Fallback timeout if process never started or was already completed - p.logger.Debug("no process handle available, using timeout fallback", - slog.String("build_id", buildID), - ) - timeout := time.Duration(constraints.TimeoutSeconds+60) * time.Second - time.Sleep(timeout) - } - }() - - p.logger.Debug("applied resource limits via cgroups", - slog.String("build_id", buildID), - slog.String("cgroup_path", cgroupPath), - slog.Int64("memory_bytes", constraints.MaxMemoryBytes), - slog.Int64("cpu_cores", int64(constraints.MaxCPUCores)), - ) - - return nil -} - -// MonitorProcess monitors a process for resource usage and violations -func (p *ProcessIsolator) MonitorProcess( - ctx context.Context, - cmd *exec.Cmd, - tenantID string, - buildID string, - constraints BuildConstraints, -) *ResourceUsage { - usage := &ResourceUsage{ //nolint:exhaustruct // Other fields are populated during monitoring or represent peak/final values - BuildID: buildID, - TenantID: tenantID, - StartTime: time.Now(), - } - - // Start monitoring in background - go func() { - ticker := time.NewTicker(1 * time.Second) - defer ticker.Stop() - - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if cmd.Process == nil { - continue - } - - // Monitor process resource usage - if err := p.updateResourceUsage(cmd.Process.Pid, usage, constraints); err != nil { - p.logger.Debug("failed to update resource usage", slog.String("error", err.Error())) - } - } - } - }() - - return usage -} - -// updateResourceUsage updates resource usage statistics -func (p *ProcessIsolator) updateResourceUsage(pid int, usage *ResourceUsage, constraints BuildConstraints) error { - // Read from /proc/PID/stat for CPU and memory info - statPath := fmt.Sprintf("/proc/%d/stat", pid) - statData, err := os.ReadFile(statPath) - if err != nil { - return err - } - - fields := strings.Fields(string(statData)) - if len(fields) < 24 { - return fmt.Errorf("invalid stat file format") - } - - // Parse memory usage (RSS in pages) - if rss, err := strconv.ParseInt(fields[23], 10, 64); err == nil { - pageSize := int64(os.Getpagesize()) - usage.MemoryUsedBytes = rss * pageSize - usage.MemoryLimitBytes = constraints.MaxMemoryBytes - } - - // Read memory info from /proc/PID/status - statusPath := fmt.Sprintf("/proc/%d/status", pid) - //nolint:nestif // Complex but logical flow for resource monitoring - if statusData, err := os.ReadFile(statusPath); err == nil { - lines := strings.Split(string(statusData), "\n") - for _, line := range lines { - if strings.HasPrefix(line, "VmHWM:") { - // Peak memory usage - fields := strings.Fields(line) - if len(fields) >= 2 { - if peak, err := strconv.ParseInt(fields[1], 10, 64); err == nil { - usage.MemoryMaxBytes = peak * 1024 // Convert from KB - } - } - } - } - } - - // Check for quota violations - if usage.MemoryUsedBytes > constraints.MaxMemoryBytes { - p.logger.Warn("memory quota violation detected", - slog.String("tenant_id", usage.TenantID), - slog.String("build_id", usage.BuildID), - slog.Int64("used_bytes", usage.MemoryUsedBytes), - slog.Int64("limit_bytes", constraints.MaxMemoryBytes), - ) - } - - return nil -} - -// TerminateProcess forcefully terminates a process group -func (p *ProcessIsolator) TerminateProcess(cmd *exec.Cmd, reason string) error { - if cmd.Process == nil { - return nil - } - - pid := cmd.Process.Pid - - p.logger.Info("terminating process", - slog.Int("pid", pid), - slog.String("reason", reason), - ) - - // Try graceful termination first - if err := syscall.Kill(-pid, syscall.SIGTERM); err != nil { - p.logger.Debug("failed to send SIGTERM", slog.String("error", err.Error())) - } - - // Wait a bit for graceful shutdown - time.Sleep(5 * time.Second) - - // Force kill if still running - if err := syscall.Kill(-pid, syscall.SIGKILL); err != nil { - p.logger.Debug("failed to send SIGKILL", slog.String("error", err.Error())) - } - - return nil -} - -// ValidateNetworkAccess validates if a network request is allowed for a tenant -func (p *ProcessIsolator) ValidateNetworkAccess( - ctx context.Context, - tenantID string, - tier builderv1.TenantTier, - targetHost string, - targetType string, // "registry", "git", "generic" -) error { - config, err := p.tenantMgr.GetTenantConfig(ctx, tenantID, tier) - if err != nil { - return fmt.Errorf("failed to get tenant config: %w", err) - } - - // Check if external network is allowed - if !config.Limits.AllowExternalNetwork { - return fmt.Errorf("external network access not allowed for tenant %s", tenantID) - } - - // Check specific host allowlists - switch targetType { - case "registry": - if !p.isHostAllowed(targetHost, config.Limits.AllowedRegistries) { - return fmt.Errorf("registry %s not allowed for tenant %s", targetHost, tenantID) - } - case "git": - if !p.isHostAllowed(targetHost, config.Limits.AllowedGitHosts) { - return fmt.Errorf("git host %s not allowed for tenant %s", targetHost, tenantID) - } - } - - return nil -} - -// isHostAllowed checks if a host is in the allowed list -func (p *ProcessIsolator) isHostAllowed(host string, allowedHosts []string) bool { - for _, allowed := range allowedHosts { - if allowed == "*" || allowed == host { - return true - } - // Support wildcard subdomains - if strings.HasPrefix(allowed, "*.") { - domain := strings.TrimPrefix(allowed, "*.") - if strings.HasSuffix(host, "."+domain) || host == domain { - return true - } - } - } - return false -} - -// safeInt32ToUint32 safely converts int32 to uint32, checking for negative values -func safeInt32ToUint32(value int32) (uint32, error) { - if value < 0 { - return 0, fmt.Errorf("negative value %d cannot be converted to uint32", value) - } - return uint32(value), nil -} diff --git a/go/deploy/builderd/internal/tenant/manager.go b/go/deploy/builderd/internal/tenant/manager.go deleted file mode 100644 index 3ed13a7e0e..0000000000 --- a/go/deploy/builderd/internal/tenant/manager.go +++ /dev/null @@ -1,468 +0,0 @@ -package tenant - -import ( - "context" - "fmt" - "log/slog" - "sync" - "time" - - "github.com/unkeyed/unkey/go/deploy/builderd/internal/config" - builderv1 "github.com/unkeyed/unkey/go/gen/proto/deploy/builderd/v1" -) - -// Manager handles tenant isolation, quotas, and resource management -type Manager struct { - logger *slog.Logger - config *config.Config - - // Active resource tracking - activeBuilds map[string]int32 // tenant_id -> active count - dailyBuilds map[string]map[string]int32 // tenant_id -> date -> count - storageUsage map[string]int64 // tenant_id -> bytes used - computeMinutes map[string]map[string]int64 // tenant_id -> date -> minutes - - // Tenant configurations cache (using sync.Map for optimized reads) - tenantConfigs sync.Map // map[string]*TenantConfig - - // Thread safety for other data structures - mutex sync.RWMutex - - // Cleanup ticker - cleanupTicker *time.Ticker - stopCleanup chan struct{} -} - -// TenantConfig holds per-tenant configuration and limits -type TenantConfig struct { - TenantID string - CustomerID string - Tier builderv1.TenantTier - - // Resource limits based on tier - Limits TenantLimits - - // Network policies - Network NetworkPolicy - - // Storage configuration - Storage StorageConfig - - // Last updated timestamp - UpdatedAt time.Time -} - -// TenantLimits defines resource limits for a tenant -type TenantLimits struct { - // Build limits - MaxConcurrentBuilds int32 - MaxDailyBuilds int32 - MaxBuildTimeMinutes int32 - - // Resource limits per build - MaxMemoryBytes int64 - MaxCPUCores int32 - MaxDiskBytes int64 - TimeoutSeconds int32 - - // Storage limits - MaxStorageBytes int64 - - // Network limits - AllowExternalNetwork bool - AllowedRegistries []string - AllowedGitHosts []string -} - -// NetworkPolicy defines network access controls -type NetworkPolicy struct { - AllowExternalNetwork bool - AllowedRegistries []string - AllowedGitHosts []string - BlockedDomains []string - RequireVPN bool -} - -// StorageConfig defines storage isolation settings -type StorageConfig struct { - IsolationEnabled bool - EncryptionEnabled bool - CompressionEnabled bool - RetentionDays int32 -} - -// NewManager creates a new tenant manager -func NewManager(logger *slog.Logger, cfg *config.Config) *Manager { - manager := &Manager{ //nolint:exhaustruct // tenantConfigs is sync.Map (zero-value), mutex is sync.RWMutex (zero-value), cleanupTicker set below - logger: logger, - config: cfg, - activeBuilds: make(map[string]int32), - dailyBuilds: make(map[string]map[string]int32), - storageUsage: make(map[string]int64), - computeMinutes: make(map[string]map[string]int64), - // tenantConfigs is a sync.Map, no initialization needed - stopCleanup: make(chan struct{}), - } - - // Start cleanup ticker for daily counters - manager.cleanupTicker = time.NewTicker(1 * time.Hour) - go manager.startCleanup() - - logger.InfoContext(context.Background(), "tenant manager initialized") - return manager -} - -// GetTenantConfig retrieves or creates tenant configuration -func (m *Manager) GetTenantConfig(ctx context.Context, tenantID string, tier builderv1.TenantTier) (*TenantConfig, error) { - // Fast path: check if tenant config exists (lock-free read) - if value, exists := m.tenantConfigs.Load(tenantID); exists { - config, _ := value.(*TenantConfig) - return config, nil - } - - // Create new tenant config - no manual locking needed with sync.Map - - config := &TenantConfig{ //nolint:exhaustruct // CustomerID is optional and not required for basic tenant configuration - TenantID: tenantID, - Tier: tier, - Limits: m.getTierLimits(tier), - Network: m.getNetworkPolicy(tier), - Storage: m.getStorageConfig(tier), - UpdatedAt: time.Now(), - } - - // Use LoadOrStore to handle race conditions atomically - if actual, loaded := m.tenantConfigs.LoadOrStore(tenantID, config); loaded { - // Another goroutine created the config first, use that one - actualConfig, _ := actual.(*TenantConfig) - return actualConfig, nil - } - - m.logger.InfoContext(ctx, "created tenant configuration", - slog.String("tenant_id", tenantID), - slog.String("tier", tier.String()), - slog.Int64("max_concurrent_builds", int64(config.Limits.MaxConcurrentBuilds)), - slog.Int64("max_daily_builds", int64(config.Limits.MaxDailyBuilds)), - ) - - return config, nil -} - -// CheckBuildQuotas validates if a tenant can start a new build -func (m *Manager) CheckBuildQuotas(ctx context.Context, tenantID string, tier builderv1.TenantTier) error { - config, err := m.GetTenantConfig(ctx, tenantID, tier) - if err != nil { - return fmt.Errorf("failed to get tenant config: %w", err) - } - - m.mutex.RLock() - defer m.mutex.RUnlock() - - // Check concurrent builds limit - activeBuildCount := m.activeBuilds[tenantID] - if activeBuildCount >= config.Limits.MaxConcurrentBuilds { - return &QuotaError{ - Type: QuotaTypeConcurrentBuilds, - TenantID: tenantID, - Current: int64(activeBuildCount), - Limit: int64(config.Limits.MaxConcurrentBuilds), - Message: fmt.Sprintf("concurrent build limit exceeded: %d/%d", activeBuildCount, config.Limits.MaxConcurrentBuilds), - } - } - - // Check daily builds limit - today := time.Now().Format("2006-01-02") - dailyCount := int32(0) - if tenantDaily, exists := m.dailyBuilds[tenantID]; exists { - dailyCount = tenantDaily[today] - } - - if dailyCount >= config.Limits.MaxDailyBuilds { - return &QuotaError{ - Type: QuotaTypeDailyBuilds, - TenantID: tenantID, - Current: int64(dailyCount), - Limit: int64(config.Limits.MaxDailyBuilds), - Message: fmt.Sprintf("daily build limit exceeded: %d/%d", dailyCount, config.Limits.MaxDailyBuilds), - } - } - - // Check storage quota - storageUsed := m.storageUsage[tenantID] - if storageUsed >= config.Limits.MaxStorageBytes { - return &QuotaError{ - Type: QuotaTypeStorage, - TenantID: tenantID, - Current: storageUsed, - Limit: config.Limits.MaxStorageBytes, - Message: fmt.Sprintf("storage quota exceeded: %d/%d bytes", storageUsed, config.Limits.MaxStorageBytes), - } - } - - return nil -} - -// ReserveBuildSlot reserves a build slot for a tenant -func (m *Manager) ReserveBuildSlot(ctx context.Context, tenantID string) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - // Increment active builds - m.activeBuilds[tenantID]++ - - // Increment daily builds - today := time.Now().Format("2006-01-02") - if m.dailyBuilds[tenantID] == nil { - m.dailyBuilds[tenantID] = make(map[string]int32) - } - m.dailyBuilds[tenantID][today]++ - - m.logger.DebugContext(ctx, "reserved build slot", - slog.String("tenant_id", tenantID), - slog.Int64("active_builds", int64(m.activeBuilds[tenantID])), - slog.Int64("daily_builds", int64(m.dailyBuilds[tenantID][today])), - ) - - return nil -} - -// ReleaseBuildSlot releases a build slot for a tenant -func (m *Manager) ReleaseBuildSlot(ctx context.Context, tenantID string, buildDurationMinutes int64) { - m.mutex.Lock() - defer m.mutex.Unlock() - - // Decrement active builds - if m.activeBuilds[tenantID] > 0 { - m.activeBuilds[tenantID]-- - } - - // Track compute minutes - today := time.Now().Format("2006-01-02") - if m.computeMinutes[tenantID] == nil { - m.computeMinutes[tenantID] = make(map[string]int64) - } - m.computeMinutes[tenantID][today] += buildDurationMinutes - - m.logger.DebugContext(ctx, "released build slot", - slog.String("tenant_id", tenantID), - slog.Int64("active_builds", int64(m.activeBuilds[tenantID])), - slog.Int64("build_duration_minutes", buildDurationMinutes), - ) -} - -// UpdateStorageUsage updates storage usage for a tenant -func (m *Manager) UpdateStorageUsage(ctx context.Context, tenantID string, deltaBytes int64) { - m.mutex.Lock() - defer m.mutex.Unlock() - - m.storageUsage[tenantID] += deltaBytes - if m.storageUsage[tenantID] < 0 { - m.storageUsage[tenantID] = 0 - } - - m.logger.DebugContext(ctx, "updated storage usage", - slog.String("tenant_id", tenantID), - slog.Int64("delta_bytes", deltaBytes), - slog.Int64("total_bytes", m.storageUsage[tenantID]), - ) -} - -// GetUsageStats returns current usage statistics for a tenant -func (m *Manager) GetUsageStats(ctx context.Context, tenantID string) *UsageStats { - m.mutex.RLock() - defer m.mutex.RUnlock() - - today := time.Now().Format("2006-01-02") - - stats := &UsageStats{ //nolint:exhaustruct // DailyBuildsUsed and ComputeMinutesUsed are populated conditionally below based on existence - TenantID: tenantID, - ActiveBuilds: m.activeBuilds[tenantID], - StorageBytesUsed: m.storageUsage[tenantID], - Timestamp: time.Now(), - } - - if tenantDaily, exists := m.dailyBuilds[tenantID]; exists { - stats.DailyBuildsUsed = tenantDaily[today] - } - - if tenantCompute, exists := m.computeMinutes[tenantID]; exists { - stats.ComputeMinutesUsed = tenantCompute[today] - } - - return stats -} - -// getTierLimits returns resource limits based on tenant tier -func (m *Manager) getTierLimits(tier builderv1.TenantTier) TenantLimits { - switch tier { - case builderv1.TenantTier_TENANT_TIER_UNSPECIFIED: - // Default to free tier limits for unspecified - return m.getTierLimits(builderv1.TenantTier_TENANT_TIER_FREE) - case builderv1.TenantTier_TENANT_TIER_FREE: - return TenantLimits{ - MaxConcurrentBuilds: 1, - MaxDailyBuilds: 5, - MaxBuildTimeMinutes: 5, - MaxMemoryBytes: 512 * 1024 * 1024, // 512MB - MaxCPUCores: 1, - MaxDiskBytes: 1024 * 1024 * 1024, // 1GB - TimeoutSeconds: 300, // 5 min - MaxStorageBytes: 1024 * 1024 * 1024, // 1GB - AllowExternalNetwork: false, - AllowedRegistries: []string{"docker.io", "ghcr.io"}, - AllowedGitHosts: []string{"github.com"}, - } - case builderv1.TenantTier_TENANT_TIER_PRO: - return TenantLimits{ - MaxConcurrentBuilds: 3, - MaxDailyBuilds: 100, - MaxBuildTimeMinutes: 15, - MaxMemoryBytes: 2 * 1024 * 1024 * 1024, // 2GB - MaxCPUCores: 2, - MaxDiskBytes: 10 * 1024 * 1024 * 1024, // 10GB - TimeoutSeconds: 900, // 15 min - MaxStorageBytes: 10 * 1024 * 1024 * 1024, // 10GB - AllowExternalNetwork: true, - AllowedRegistries: []string{"*"}, - AllowedGitHosts: []string{"*"}, - } - case builderv1.TenantTier_TENANT_TIER_ENTERPRISE: - return TenantLimits{ - MaxConcurrentBuilds: 10, - MaxDailyBuilds: 1000, - MaxBuildTimeMinutes: 30, - MaxMemoryBytes: 8 * 1024 * 1024 * 1024, // 8GB - MaxCPUCores: 4, - MaxDiskBytes: 100 * 1024 * 1024 * 1024, // 100GB - TimeoutSeconds: 1800, // 30 min - MaxStorageBytes: 100 * 1024 * 1024 * 1024, // 100GB - AllowExternalNetwork: true, - AllowedRegistries: []string{"*"}, - AllowedGitHosts: []string{"*"}, - } - case builderv1.TenantTier_TENANT_TIER_DEDICATED: - return TenantLimits{ - MaxConcurrentBuilds: 50, - MaxDailyBuilds: 10000, - MaxBuildTimeMinutes: 60, - MaxMemoryBytes: 32 * 1024 * 1024 * 1024, // 32GB - MaxCPUCores: 16, - MaxDiskBytes: 1024 * 1024 * 1024 * 1024, // 1TB - TimeoutSeconds: 3600, // 60 min - MaxStorageBytes: 1024 * 1024 * 1024 * 1024, // 1TB - AllowExternalNetwork: true, - AllowedRegistries: []string{"*"}, - AllowedGitHosts: []string{"*"}, - } - default: - // Default to free tier limits - return m.getTierLimits(builderv1.TenantTier_TENANT_TIER_FREE) - } -} - -// getNetworkPolicy returns network policy based on tenant tier -func (m *Manager) getNetworkPolicy(tier builderv1.TenantTier) NetworkPolicy { - switch tier { - case builderv1.TenantTier_TENANT_TIER_UNSPECIFIED: - // Default to free tier policy for unspecified - return m.getNetworkPolicy(builderv1.TenantTier_TENANT_TIER_FREE) - case builderv1.TenantTier_TENANT_TIER_FREE: - return NetworkPolicy{ - AllowExternalNetwork: false, - AllowedRegistries: []string{"docker.io", "ghcr.io"}, - AllowedGitHosts: []string{"github.com", "gitlab.com"}, - BlockedDomains: []string{}, - RequireVPN: false, - } - case builderv1.TenantTier_TENANT_TIER_PRO, builderv1.TenantTier_TENANT_TIER_ENTERPRISE, builderv1.TenantTier_TENANT_TIER_DEDICATED: - return NetworkPolicy{ - AllowExternalNetwork: true, - AllowedRegistries: []string{"*"}, // All registries - AllowedGitHosts: []string{"*"}, // All git hosts - BlockedDomains: []string{}, - RequireVPN: false, - } - default: - return m.getNetworkPolicy(builderv1.TenantTier_TENANT_TIER_FREE) - } -} - -// getStorageConfig returns storage configuration based on tenant tier -func (m *Manager) getStorageConfig(tier builderv1.TenantTier) StorageConfig { - switch tier { - case builderv1.TenantTier_TENANT_TIER_UNSPECIFIED: - // Default to free tier storage config for unspecified - return m.getStorageConfig(builderv1.TenantTier_TENANT_TIER_FREE) - case builderv1.TenantTier_TENANT_TIER_FREE, builderv1.TenantTier_TENANT_TIER_PRO: - return StorageConfig{ - IsolationEnabled: true, - EncryptionEnabled: false, - CompressionEnabled: true, - RetentionDays: 30, - } - case builderv1.TenantTier_TENANT_TIER_ENTERPRISE, builderv1.TenantTier_TENANT_TIER_DEDICATED: - return StorageConfig{ - IsolationEnabled: true, - EncryptionEnabled: true, - CompressionEnabled: true, - RetentionDays: 90, - } - default: - return m.getStorageConfig(builderv1.TenantTier_TENANT_TIER_FREE) - } -} - -// startCleanup runs periodic cleanup of old data -func (m *Manager) startCleanup() { - for { - select { - case <-m.cleanupTicker.C: - m.cleanupOldData() - case <-m.stopCleanup: - return - } - } -} - -// cleanupOldData removes old daily counters and unused tenant configs -func (m *Manager) cleanupOldData() { - m.mutex.Lock() - defer m.mutex.Unlock() - - cutoff := time.Now().AddDate(0, 0, -7).Format("2006-01-02") // Keep 7 days - - // Cleanup old daily build counters - for tenantID, dailyMap := range m.dailyBuilds { - for date := range dailyMap { - if date < cutoff { - delete(dailyMap, date) - } - } - if len(dailyMap) == 0 { - delete(m.dailyBuilds, tenantID) - } - } - - // Cleanup old compute minute counters - for tenantID, computeMap := range m.computeMinutes { - for date := range computeMap { - if date < cutoff { - delete(computeMap, date) - } - } - if len(computeMap) == 0 { - delete(m.computeMinutes, tenantID) - } - } - - m.logger.DebugContext(context.Background(), "cleaned up old tenant data") -} - -// Shutdown gracefully shuts down the tenant manager -func (m *Manager) Shutdown() { - if m.cleanupTicker != nil { - m.cleanupTicker.Stop() - } - close(m.stopCleanup) - m.logger.InfoContext(context.Background(), "tenant manager shutdown") -} diff --git a/go/deploy/builderd/internal/tenant/storage.go b/go/deploy/builderd/internal/tenant/storage.go deleted file mode 100644 index d228686f85..0000000000 --- a/go/deploy/builderd/internal/tenant/storage.go +++ /dev/null @@ -1,540 +0,0 @@ -package tenant - -import ( - "context" - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "crypto/sha256" - "fmt" - "io" - "log/slog" - "math" - "os" - "path/filepath" - "strings" - "time" - - builderv1 "github.com/unkeyed/unkey/go/gen/proto/deploy/builderd/v1" -) - -// StorageIsolator handles storage isolation and encryption for tenants -type StorageIsolator struct { - logger *slog.Logger - tenantMgr *Manager - baseDir string - encryptionKey []byte -} - -// NewStorageIsolator creates a new storage isolator -func NewStorageIsolator(logger *slog.Logger, tenantMgr *Manager, baseDir string) *StorageIsolator { - // Generate or load encryption key (in production, this should be from secure key management) - encKey := make([]byte, 32) // 256-bit key - if _, err := rand.Read(encKey); err != nil { - logger.Warn("failed to generate encryption key, using deterministic key", slog.String("error", err.Error())) - // Fallback to deterministic key (NOT recommended for production) - hash := sha256.Sum256([]byte("builderd-storage-key")) - copy(encKey, hash[:]) - } - - return &StorageIsolator{ - logger: logger, - tenantMgr: tenantMgr, - baseDir: baseDir, - encryptionKey: encKey, - } -} - -// CreateTenantDirectories creates isolated directories for a tenant build -func (s *StorageIsolator) CreateTenantDirectories( - ctx context.Context, - tenantID string, - tier builderv1.TenantTier, - buildID string, -) (*TenantDirectories, error) { - config, err := s.tenantMgr.GetTenantConfig(ctx, tenantID, tier) - if err != nil { - return nil, fmt.Errorf("failed to get tenant config: %w", err) - } - - // Create tenant-specific directory structure - tenantBaseDir := filepath.Join(s.baseDir, "tenants", tenantID) - buildBaseDir := filepath.Join(tenantBaseDir, "builds", buildID) - - dirs := &TenantDirectories{ - TenantID: tenantID, - BuildID: buildID, - BaseDir: buildBaseDir, - WorkspaceDir: filepath.Join(buildBaseDir, "workspace"), - RootfsDir: filepath.Join(buildBaseDir, "rootfs"), - TempDir: filepath.Join(buildBaseDir, "temp"), - LogsDir: filepath.Join(buildBaseDir, "logs"), - MetadataDir: filepath.Join(buildBaseDir, "metadata"), - CacheDir: filepath.Join(tenantBaseDir, "cache"), - - // Permissions and ownership - DirMode: 0750, // rwxr-x--- - FileMode: 0640, // rw-r----- - UID: 1000, // builderd user - GID: 1000, // builderd group - - // Security settings - EncryptionEnabled: config.Storage.EncryptionEnabled, - CompressionEnabled: config.Storage.CompressionEnabled, - IsolationEnabled: config.Storage.IsolationEnabled, - } - - // Create all directories - if err := s.createDirectories(dirs); err != nil { - return nil, fmt.Errorf("failed to create directories: %w", err) - } - - // Apply security settings - if err := s.applySecuritySettings(dirs, config); err != nil { - return nil, fmt.Errorf("failed to apply security settings: %w", err) - } - - // Set up quota monitoring - if err := s.setupQuotaMonitoring(dirs, config); err != nil { - s.logger.WarnContext(ctx, "failed to setup quota monitoring", slog.String("error", err.Error())) - } - - s.logger.InfoContext(ctx, "created tenant directories", - slog.String("tenant_id", tenantID), - slog.String("build_id", buildID), - slog.String("base_dir", dirs.BaseDir), - slog.Bool("encryption_enabled", dirs.EncryptionEnabled), - ) - - return dirs, nil -} - -// TenantDirectories represents the directory structure for a tenant build -type TenantDirectories struct { - TenantID string - BuildID string - BaseDir string - WorkspaceDir string - RootfsDir string - TempDir string - LogsDir string - MetadataDir string - CacheDir string - - // Permissions - DirMode os.FileMode - FileMode os.FileMode - UID int - GID int - - // Security settings - EncryptionEnabled bool - CompressionEnabled bool - IsolationEnabled bool -} - -// createDirectories creates all required directories with proper permissions -func (s *StorageIsolator) createDirectories(dirs *TenantDirectories) error { - directoriesToCreate := []string{ - dirs.BaseDir, - dirs.WorkspaceDir, - dirs.RootfsDir, - dirs.TempDir, - dirs.LogsDir, - dirs.MetadataDir, - dirs.CacheDir, - } - - for _, dir := range directoriesToCreate { - if err := os.MkdirAll(dir, dirs.DirMode); err != nil { - return fmt.Errorf("failed to create directory %s: %w", dir, err) - } - - // Set ownership - if err := os.Chown(dir, dirs.UID, dirs.GID); err != nil { - s.logger.Warn("failed to set directory ownership", - slog.String("dir", dir), - slog.String("error", err.Error()), - ) - } - } - - return nil -} - -// applySecuritySettings applies security configurations to directories -// -//nolint:unparam // config parameter reserved for future security enhancements -func (s *StorageIsolator) applySecuritySettings(dirs *TenantDirectories, config *TenantConfig) error { - // Set extended attributes for isolation - if dirs.IsolationEnabled { - // Set security labels (requires SELinux/AppArmor support) - isolationLabel := fmt.Sprintf("builderd:tenant:%s", dirs.TenantID) - - for _, dir := range []string{dirs.BaseDir, dirs.WorkspaceDir, dirs.RootfsDir} { - if err := s.setSecurityLabel(dir, isolationLabel); err != nil { - s.logger.Debug("failed to set security label", - slog.String("dir", dir), - slog.String("error", err.Error()), - ) - } - } - } - - // Create access control files - readmeContent := fmt.Sprintf(`# Builderd Tenant Storage - -This directory contains build artifacts for: -- Tenant ID: %s -- Build ID: %s -- Created: %s -- Encryption: %v -- Compression: %v - -WARNING: This directory is managed by builderd. -Do not modify files directly. -`, dirs.TenantID, dirs.BuildID, time.Now().Format(time.RFC3339), - dirs.EncryptionEnabled, dirs.CompressionEnabled) - - readmePath := filepath.Join(dirs.BaseDir, "README.txt") - if err := s.writeFile(readmePath, []byte(readmeContent), dirs.FileMode, dirs.EncryptionEnabled); err != nil { - s.logger.Debug("failed to create README", slog.String("error", err.Error())) - } - - return nil -} - -// setupQuotaMonitoring sets up directory quotas if supported -// -//nolint:unparam // error return reserved for future quota implementation -func (s *StorageIsolator) setupQuotaMonitoring(dirs *TenantDirectories, config *TenantConfig) error { - // This is a placeholder for quota setup - // In production, you might use: - // - XFS project quotas - // - ext4 project quotas - // - Directory quotas via quota tools - // - Custom monitoring with periodic size checks - - s.logger.Debug("quota monitoring setup", - slog.String("tenant_id", dirs.TenantID), - slog.Int64("max_storage_bytes", config.Limits.MaxStorageBytes), - ) - - return nil -} - -// WriteFile writes a file with optional encryption and compression -func (s *StorageIsolator) WriteFile( - dirs *TenantDirectories, - relativePath string, - data []byte, - compress bool, -) error { - fullPath := filepath.Join(dirs.BaseDir, relativePath) - - // Ensure the file is within the tenant directory - if !strings.HasPrefix(fullPath, dirs.BaseDir) { - return fmt.Errorf("path traversal attempt detected: %s", relativePath) - } - - // Create parent directory if needed - if err := os.MkdirAll(filepath.Dir(fullPath), dirs.DirMode); err != nil { - return fmt.Errorf("failed to create parent directory: %w", err) - } - - return s.writeFile(fullPath, data, dirs.FileMode, dirs.EncryptionEnabled) -} - -// ReadFile reads a file with optional decryption and decompression -func (s *StorageIsolator) ReadFile( - dirs *TenantDirectories, - relativePath string, -) ([]byte, error) { - fullPath := filepath.Join(dirs.BaseDir, relativePath) - - // Ensure the file is within the tenant directory - if !strings.HasPrefix(fullPath, dirs.BaseDir) { - return nil, fmt.Errorf("path traversal attempt detected: %s", relativePath) - } - - return s.readFile(fullPath, dirs.EncryptionEnabled) -} - -// writeFile writes data to a file with optional encryption -func (s *StorageIsolator) writeFile(path string, data []byte, mode os.FileMode, encrypt bool) error { - var finalData []byte - var err error - - if encrypt { - finalData, err = s.encryptData(data) - if err != nil { - return fmt.Errorf("failed to encrypt data: %w", err) - } - } else { - finalData = data - } - - file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode) - if err != nil { - return fmt.Errorf("failed to open file: %w", err) - } - defer file.Close() - - if _, err := file.Write(finalData); err != nil { - return fmt.Errorf("failed to write data: %w", err) - } - - return nil -} - -// readFile reads data from a file with optional decryption -func (s *StorageIsolator) readFile(path string, decrypt bool) ([]byte, error) { - data, err := os.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("failed to read file: %w", err) - } - - if decrypt { - decryptedData, err := s.decryptData(data) - if err != nil { - return nil, fmt.Errorf("failed to decrypt data: %w", err) - } - return decryptedData, nil - } - - return data, nil -} - -// encryptData encrypts data using AES-GCM -func (s *StorageIsolator) encryptData(data []byte) ([]byte, error) { - block, err := aes.NewCipher(s.encryptionKey) - if err != nil { - return nil, err - } - - gcm, err := cipher.NewGCM(block) - if err != nil { - return nil, err - } - - nonce := make([]byte, gcm.NonceSize()) - if _, err := io.ReadFull(rand.Reader, nonce); err != nil { - return nil, err - } - - ciphertext := gcm.Seal(nonce, nonce, data, nil) - return ciphertext, nil -} - -// decryptData decrypts data using AES-GCM -func (s *StorageIsolator) decryptData(data []byte) ([]byte, error) { - block, err := aes.NewCipher(s.encryptionKey) - if err != nil { - return nil, err - } - - gcm, err := cipher.NewGCM(block) - if err != nil { - return nil, err - } - - if len(data) < gcm.NonceSize() { - return nil, fmt.Errorf("ciphertext too short") - } - - nonce, ciphertext := data[:gcm.NonceSize()], data[gcm.NonceSize():] - plaintext, err := gcm.Open(nil, nonce, ciphertext, nil) - if err != nil { - return nil, err - } - - return plaintext, nil -} - -// setSecurityLabel sets security labels on directories (placeholder) -// -//nolint:unparam // error return reserved for future SELinux/AppArmor implementation -func (s *StorageIsolator) setSecurityLabel(path, label string) error { - // This would integrate with SELinux or AppArmor - // For now, we'll use extended attributes as a placeholder - - // Example with xattr (requires golang.org/x/sys/unix) - // return unix.Setxattr(path, "security.builderd", []byte(label), 0) - - s.logger.Debug("security label applied", - slog.String("path", path), - slog.String("label", label), - ) - - return nil -} - -// GetDirectorySize calculates the total size of a directory -func (s *StorageIsolator) GetDirectorySize(path string) (int64, error) { - var totalSize int64 - - err := filepath.Walk(path, func(filePath string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !info.IsDir() { - totalSize += info.Size() - } - return nil - }) - - return totalSize, err -} - -// CheckQuota checks if a directory exceeds its quota -func (s *StorageIsolator) CheckQuota( - ctx context.Context, - dirs *TenantDirectories, - maxBytes int64, -) error { - currentSize, err := s.GetDirectorySize(dirs.BaseDir) - if err != nil { - return fmt.Errorf("failed to calculate directory size: %w", err) - } - - if currentSize > maxBytes { - return &QuotaError{ - Type: QuotaTypeStorage, - TenantID: dirs.TenantID, - Current: currentSize, - Limit: maxBytes, - Message: fmt.Sprintf("storage quota exceeded: %d/%d bytes", currentSize, maxBytes), - } - } - - // Update tenant manager with current usage - s.tenantMgr.UpdateStorageUsage(ctx, dirs.TenantID, currentSize) - - return nil -} - -// CleanupDirectories removes build directories and optionally archives them -func (s *StorageIsolator) CleanupDirectories( - ctx context.Context, - dirs *TenantDirectories, - archive bool, -) error { - if archive { - // Archive the build before cleanup - if err := s.archiveBuild(dirs); err != nil { - s.logger.WarnContext(ctx, "failed to archive build", slog.String("error", err.Error())) - } - } - - // Remove temporary directories immediately - tempDirs := []string{dirs.TempDir, dirs.WorkspaceDir} - for _, dir := range tempDirs { - if err := os.RemoveAll(dir); err != nil { - s.logger.WarnContext(ctx, "failed to remove temp directory", - slog.String("dir", dir), - slog.String("error", err.Error()), - ) - } - } - - // Calculate freed space - freedBytes, _ := s.GetDirectorySize(dirs.BaseDir) - - // Remove the entire build directory - if err := os.RemoveAll(dirs.BaseDir); err != nil { - return fmt.Errorf("failed to remove build directory: %w", err) - } - - // Update storage usage - s.tenantMgr.UpdateStorageUsage(ctx, dirs.TenantID, -freedBytes) - - s.logger.InfoContext(ctx, "cleaned up tenant directories", - slog.String("tenant_id", dirs.TenantID), - slog.String("build_id", dirs.BuildID), - slog.Int64("freed_bytes", freedBytes), - ) - - return nil -} - -// archiveBuild creates an archive of the build artifacts -// -//nolint:unparam // error return reserved for future archive implementation -func (s *StorageIsolator) archiveBuild(dirs *TenantDirectories) error { - // This is a placeholder for build archiving - // In production, you might: - // - Create tar.gz archives - // - Upload to S3/GCS/Azure - // - Store in long-term storage - // - Apply retention policies - - archivePath := filepath.Join(dirs.MetadataDir, "build.tar.gz") - - s.logger.Info("archived build", - slog.String("tenant_id", dirs.TenantID), - slog.String("build_id", dirs.BuildID), - slog.String("archive_path", archivePath), - ) - - return nil -} - -// GetStorageStats returns storage statistics for a tenant -func (s *StorageIsolator) GetStorageStats( - ctx context.Context, - tenantID string, -) (*StorageStats, error) { - tenantDir := filepath.Join(s.baseDir, "tenants", tenantID) - - totalSize, err := s.GetDirectorySize(tenantDir) - if err != nil { - return nil, fmt.Errorf("failed to calculate tenant storage size: %w", err) - } - - // Count builds - buildsDir := filepath.Join(tenantDir, "builds") - buildCount := 0 - if entries, readErr := os.ReadDir(buildsDir); readErr == nil { - buildCount = len(entries) - } - - // Get cache size - cacheDir := filepath.Join(tenantDir, "cache") - cacheSize, _ := s.GetDirectorySize(cacheDir) - - // Safe conversion of buildCount from int to int32 - buildCountInt32, err := safeIntToInt32(buildCount) - if err != nil { - return nil, fmt.Errorf("invalid build count %d: %w", buildCount, err) - } - - stats := &StorageStats{ - TenantID: tenantID, - TotalBytes: totalSize, - CacheBytes: cacheSize, - BuildCount: buildCountInt32, - LastUpdated: time.Now(), - } - - return stats, nil -} - -// StorageStats represents storage statistics for a tenant -type StorageStats struct { - TenantID string `json:"tenant_id"` - TotalBytes int64 `json:"total_bytes"` - CacheBytes int64 `json:"cache_bytes"` - BuildCount int32 `json:"build_count"` - LastUpdated time.Time `json:"last_updated"` -} - -// safeIntToInt32 safely converts int to int32, checking for overflow -func safeIntToInt32(value int) (int32, error) { - if value > math.MaxInt32 { - return 0, fmt.Errorf("value %d exceeds maximum int32 value %d", value, math.MaxInt32) - } - if value < math.MinInt32 { - return 0, fmt.Errorf("value %d is below minimum int32 value %d", value, math.MinInt32) - } - return int32(value), nil -} diff --git a/go/deploy/builderd/internal/tenant/types.go b/go/deploy/builderd/internal/tenant/types.go deleted file mode 100644 index 283323416e..0000000000 --- a/go/deploy/builderd/internal/tenant/types.go +++ /dev/null @@ -1,236 +0,0 @@ -package tenant - -import ( - "time" -) - -// QuotaType represents different types of quotas -type QuotaType string - -const ( - QuotaTypeConcurrentBuilds QuotaType = "concurrent_builds" - QuotaTypeDailyBuilds QuotaType = "daily_builds" - QuotaTypeStorage QuotaType = "storage" - QuotaTypeCompute QuotaType = "compute" - QuotaTypeBuildTime QuotaType = "build_time" - QuotaTypeMemory QuotaType = "memory" - QuotaTypeCPU QuotaType = "cpu" - QuotaTypeDisk QuotaType = "disk" - QuotaTypeNetwork QuotaType = "network" -) - -// QuotaError represents a quota violation error -type QuotaError struct { - Type QuotaType `json:"type"` - TenantID string `json:"tenant_id"` - Current int64 `json:"current"` - Limit int64 `json:"limit"` - Message string `json:"message"` -} - -// Error implements the error interface -func (e *QuotaError) Error() string { - return e.Message -} - -// IsQuotaError checks if an error is a quota error -func IsQuotaError(err error) bool { - _, ok := err.(*QuotaError) - return ok -} - -// UsageStats represents current usage statistics for a tenant -type UsageStats struct { - TenantID string `json:"tenant_id"` - ActiveBuilds int32 `json:"active_builds"` - DailyBuildsUsed int32 `json:"daily_builds_used"` - StorageBytesUsed int64 `json:"storage_bytes_used"` - ComputeMinutesUsed int64 `json:"compute_minutes_used"` - Timestamp time.Time `json:"timestamp"` -} - -// BuildConstraints represents resource constraints for a specific build -type BuildConstraints struct { - // Process constraints - MaxMemoryBytes int64 `json:"max_memory_bytes"` - MaxCPUCores int32 `json:"max_cpu_cores"` - MaxDiskBytes int64 `json:"max_disk_bytes"` - TimeoutSeconds int32 `json:"timeout_seconds"` - - // Security constraints - RunAsUser int32 `json:"run_as_user"` - RunAsGroup int32 `json:"run_as_group"` - ReadOnlyRootfs bool `json:"read_only_rootfs"` - NoPrivileged bool `json:"no_privileged"` - DroppedCapabilities []string `json:"dropped_capabilities"` - - // Network constraints - NetworkMode string `json:"network_mode"` - AllowedRegistries []string `json:"allowed_registries"` - AllowedGitHosts []string `json:"allowed_git_hosts"` - BlockedDomains []string `json:"blocked_domains"` - - // Storage constraints - WorkspaceDir string `json:"workspace_dir"` - RootfsDir string `json:"rootfs_dir"` - TempDir string `json:"temp_dir"` - MaxTempSizeBytes int64 `json:"max_temp_size_bytes"` -} - -// IsolationLevel represents the level of isolation for a tenant -type IsolationLevel int - -const ( - IsolationLevelNone IsolationLevel = iota - IsolationLevelBasic - IsolationLevelStrict - IsolationLevelMaximum -) - -// String returns the string representation of an isolation level -func (l IsolationLevel) String() string { - switch l { - case IsolationLevelNone: - return "none" - case IsolationLevelBasic: - return "basic" - case IsolationLevelStrict: - return "strict" - case IsolationLevelMaximum: - return "maximum" - default: - return "unknown" - } -} - -// SecurityPolicy represents security policies for a tenant -type SecurityPolicy struct { - IsolationLevel IsolationLevel `json:"isolation_level"` - AllowPrivileged bool `json:"allow_privileged"` - AllowHostNetwork bool `json:"allow_host_network"` - AllowHostPID bool `json:"allow_host_pid"` - AllowHostIPC bool `json:"allow_host_ipc"` - AllowSysAdmin bool `json:"allow_sys_admin"` - RequireNonRoot bool `json:"require_non_root"` - SelinuxEnabled bool `json:"selinux_enabled"` - AppArmorEnabled bool `json:"apparmor_enabled"` - SeccompProfile string `json:"seccomp_profile"` - DroppedCapabilities []string `json:"dropped_capabilities"` - AddedCapabilities []string `json:"added_capabilities"` -} - -// AuditEvent represents an audit event for compliance tracking -type AuditEvent struct { - EventID string `json:"event_id"` - TenantID string `json:"tenant_id"` - CustomerID string `json:"customer_id"` - BuildID string `json:"build_id,omitempty"` - Action string `json:"action"` - Resource string `json:"resource"` - Result string `json:"result"` - Reason string `json:"reason,omitempty"` - Timestamp time.Time `json:"timestamp"` - UserAgent string `json:"user_agent,omitempty"` - IPAddress string `json:"ip_address,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// AuditAction represents different types of audit actions -type AuditAction string - -const ( - AuditActionBuildStart AuditAction = "build_start" - AuditActionBuildComplete AuditAction = "build_complete" - AuditActionBuildCancel AuditAction = "build_cancel" - AuditActionQuotaCheck AuditAction = "quota_check" - AuditActionResourceAccess AuditAction = "resource_access" - AuditActionPolicyViolation AuditAction = "policy_violation" - AuditActionStorageAccess AuditAction = "storage_access" - AuditActionNetworkAccess AuditAction = "network_access" -) - -// AuditResult represents the result of an audited action -type AuditResult string - -const ( - AuditResultAllowed AuditResult = "allowed" - AuditResultDenied AuditResult = "denied" - AuditResultError AuditResult = "error" -) - -// QuotaViolation represents a quota violation for reporting -type QuotaViolation struct { - TenantID string `json:"tenant_id"` - QuotaType QuotaType `json:"quota_type"` - Current int64 `json:"current"` - Limit int64 `json:"limit"` - Percentage float64 `json:"percentage"` - Timestamp time.Time `json:"timestamp"` - Severity string `json:"severity"` // warning, critical - Action string `json:"action"` // throttled, blocked - Duration int64 `json:"duration"` // how long the violation lasted -} - -// ResourceUsage represents detailed resource usage for a build -type ResourceUsage struct { - BuildID string `json:"build_id"` - TenantID string `json:"tenant_id"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"end_time"` - Duration time.Duration `json:"duration"` - - // CPU usage - CPUUsagePercent float64 `json:"cpu_usage_percent"` - CPUTimeTotal time.Duration `json:"cpu_time_total"` - CPUThrottleTime time.Duration `json:"cpu_throttle_time"` - - // Memory usage - MemoryUsedBytes int64 `json:"memory_used_bytes"` - MemoryMaxBytes int64 `json:"memory_max_bytes"` - MemoryLimitBytes int64 `json:"memory_limit_bytes"` - MemorySwapBytes int64 `json:"memory_swap_bytes"` - - // Disk usage - DiskReadBytes int64 `json:"disk_read_bytes"` - DiskWriteBytes int64 `json:"disk_write_bytes"` - DiskUsedBytes int64 `json:"disk_used_bytes"` - DiskLimitBytes int64 `json:"disk_limit_bytes"` - - // Network usage - NetworkRxBytes int64 `json:"network_rx_bytes"` - NetworkTxBytes int64 `json:"network_tx_bytes"` - NetworkConnections int32 `json:"network_connections"` - - // Process information - ProcessCount int32 `json:"process_count"` - ThreadCount int32 `json:"thread_count"` - FileDescriptorCount int32 `json:"file_descriptor_count"` -} - -// TenantMetrics represents aggregated metrics for a tenant -type TenantMetrics struct { - TenantID string `json:"tenant_id"` - Timestamp time.Time `json:"timestamp"` - - // Build metrics - TotalBuilds int64 `json:"total_builds"` - SuccessfulBuilds int64 `json:"successful_builds"` - FailedBuilds int64 `json:"failed_builds"` - CancelledBuilds int64 `json:"cancelled_builds"` - AvgBuildDuration time.Duration `json:"avg_build_duration"` - - // Resource metrics - TotalCPUTime time.Duration `json:"total_cpu_time"` - TotalMemoryBytes int64 `json:"total_memory_bytes"` - TotalDiskBytes int64 `json:"total_disk_bytes"` - TotalNetworkBytes int64 `json:"total_network_bytes"` - - // Cost metrics (for billing) - ComputeCost float64 `json:"compute_cost"` - StorageCost float64 `json:"storage_cost"` - NetworkCost float64 `json:"network_cost"` - TotalCost float64 `json:"total_cost"` - - // Quota violations - QuotaViolations []QuotaViolation `json:"quota_violations"` -} diff --git a/go/gen/proto/deploy/builderd/v1/builder.pb.go b/go/gen/proto/deploy/builderd/v1/builder.pb.go index ab37ee464f..647413ab58 100644 --- a/go/gen/proto/deploy/builderd/v1/builder.pb.go +++ b/go/gen/proto/deploy/builderd/v1/builder.pb.go @@ -202,91 +202,6 @@ func (InitStrategy) EnumDescriptor() ([]byte, []int) { return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{2} } -// Multi-tenant context -type TenantContext struct { - state protoimpl.MessageState `protogen:"open.v1"` - TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // Primary tenant identifier - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // Customer within tenant (for billing) - OrganizationId string `protobuf:"bytes,3,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` // Organization (for enterprise) - Tier TenantTier `protobuf:"varint,4,opt,name=tier,proto3,enum=deploy.builderd.v1.TenantTier" json:"tier,omitempty"` // Service tier - Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"` // Build permissions - Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Tenant metadata - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TenantContext) Reset() { - *x = TenantContext{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TenantContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TenantContext) ProtoMessage() {} - -func (x *TenantContext) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TenantContext.ProtoReflect.Descriptor instead. -func (*TenantContext) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{0} -} - -func (x *TenantContext) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - -func (x *TenantContext) GetCustomerId() string { - if x != nil { - return x.CustomerId - } - return "" -} - -func (x *TenantContext) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *TenantContext) GetTier() TenantTier { - if x != nil { - return x.Tier - } - return TenantTier_TENANT_TIER_UNSPECIFIED -} - -func (x *TenantContext) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *TenantContext) GetMetadata() map[string]string { - if x != nil { - return x.Metadata - } - return nil -} - // Build source types - extensible for future build types type BuildSource struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -302,7 +217,7 @@ type BuildSource struct { func (x *BuildSource) Reset() { *x = BuildSource{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[1] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -314,7 +229,7 @@ func (x *BuildSource) String() string { func (*BuildSource) ProtoMessage() {} func (x *BuildSource) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[1] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -327,7 +242,7 @@ func (x *BuildSource) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildSource.ProtoReflect.Descriptor instead. func (*BuildSource) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{1} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{0} } func (x *BuildSource) GetSourceType() isBuildSource_SourceType { @@ -398,7 +313,7 @@ type DockerImageSource struct { func (x *DockerImageSource) Reset() { *x = DockerImageSource{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[2] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -410,7 +325,7 @@ func (x *DockerImageSource) String() string { func (*DockerImageSource) ProtoMessage() {} func (x *DockerImageSource) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[2] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -423,7 +338,7 @@ func (x *DockerImageSource) ProtoReflect() protoreflect.Message { // Deprecated: Use DockerImageSource.ProtoReflect.Descriptor instead. func (*DockerImageSource) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{2} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{1} } func (x *DockerImageSource) GetImageUri() string { @@ -459,7 +374,7 @@ type DockerAuth struct { func (x *DockerAuth) Reset() { *x = DockerAuth{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[3] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -471,7 +386,7 @@ func (x *DockerAuth) String() string { func (*DockerAuth) ProtoMessage() {} func (x *DockerAuth) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[3] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -484,7 +399,7 @@ func (x *DockerAuth) ProtoReflect() protoreflect.Message { // Deprecated: Use DockerAuth.ProtoReflect.Descriptor instead. func (*DockerAuth) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{3} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{2} } func (x *DockerAuth) GetUsername() string { @@ -528,7 +443,7 @@ type GitRepositorySource struct { func (x *GitRepositorySource) Reset() { *x = GitRepositorySource{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[4] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -540,7 +455,7 @@ func (x *GitRepositorySource) String() string { func (*GitRepositorySource) ProtoMessage() {} func (x *GitRepositorySource) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[4] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -553,7 +468,7 @@ func (x *GitRepositorySource) ProtoReflect() protoreflect.Message { // Deprecated: Use GitRepositorySource.ProtoReflect.Descriptor instead. func (*GitRepositorySource) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{4} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{3} } func (x *GitRepositorySource) GetRepositoryUrl() string { @@ -596,7 +511,7 @@ type GitAuth struct { func (x *GitAuth) Reset() { *x = GitAuth{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[5] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -608,7 +523,7 @@ func (x *GitAuth) String() string { func (*GitAuth) ProtoMessage() {} func (x *GitAuth) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[5] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -621,7 +536,7 @@ func (x *GitAuth) ProtoReflect() protoreflect.Message { // Deprecated: Use GitAuth.ProtoReflect.Descriptor instead. func (*GitAuth) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{5} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{4} } func (x *GitAuth) GetUsername() string { @@ -664,7 +579,7 @@ type ArchiveSource struct { func (x *ArchiveSource) Reset() { *x = ArchiveSource{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[6] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -676,7 +591,7 @@ func (x *ArchiveSource) String() string { func (*ArchiveSource) ProtoMessage() {} func (x *ArchiveSource) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[6] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -689,7 +604,7 @@ func (x *ArchiveSource) ProtoReflect() protoreflect.Message { // Deprecated: Use ArchiveSource.ProtoReflect.Descriptor instead. func (*ArchiveSource) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{6} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{5} } func (x *ArchiveSource) GetArchiveUrl() string { @@ -727,7 +642,7 @@ type BuildTarget struct { func (x *BuildTarget) Reset() { *x = BuildTarget{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[7] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -739,7 +654,7 @@ func (x *BuildTarget) String() string { func (*BuildTarget) ProtoMessage() {} func (x *BuildTarget) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[7] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -752,7 +667,7 @@ func (x *BuildTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildTarget.ProtoReflect.Descriptor instead. func (*BuildTarget) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{7} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{6} } func (x *BuildTarget) GetTargetType() isBuildTarget_TargetType { @@ -809,7 +724,7 @@ type MicroVMRootfs struct { func (x *MicroVMRootfs) Reset() { *x = MicroVMRootfs{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[8] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -821,7 +736,7 @@ func (x *MicroVMRootfs) String() string { func (*MicroVMRootfs) ProtoMessage() {} func (x *MicroVMRootfs) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[8] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -834,7 +749,7 @@ func (x *MicroVMRootfs) ProtoReflect() protoreflect.Message { // Deprecated: Use MicroVMRootfs.ProtoReflect.Descriptor instead. func (*MicroVMRootfs) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{8} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{7} } func (x *MicroVMRootfs) GetInitStrategy() InitStrategy { @@ -876,7 +791,7 @@ type ContainerImage struct { func (x *ContainerImage) Reset() { *x = ContainerImage{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[9] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +803,7 @@ func (x *ContainerImage) String() string { func (*ContainerImage) ProtoMessage() {} func (x *ContainerImage) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[9] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +816,7 @@ func (x *ContainerImage) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerImage.ProtoReflect.Descriptor instead. func (*ContainerImage) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{9} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{8} } func (x *ContainerImage) GetBaseImage() string { @@ -931,7 +846,7 @@ type RuntimeConfig struct { func (x *RuntimeConfig) Reset() { *x = RuntimeConfig{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[10] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -943,7 +858,7 @@ func (x *RuntimeConfig) String() string { func (*RuntimeConfig) ProtoMessage() {} func (x *RuntimeConfig) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[10] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -956,7 +871,7 @@ func (x *RuntimeConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use RuntimeConfig.ProtoReflect.Descriptor instead. func (*RuntimeConfig) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{10} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{9} } func (x *RuntimeConfig) GetCommand() []string { @@ -1008,7 +923,7 @@ type OptimizationSettings struct { func (x *OptimizationSettings) Reset() { *x = OptimizationSettings{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[11] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1020,7 +935,7 @@ func (x *OptimizationSettings) String() string { func (*OptimizationSettings) ProtoMessage() {} func (x *OptimizationSettings) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[11] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1033,7 +948,7 @@ func (x *OptimizationSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use OptimizationSettings.ProtoReflect.Descriptor instead. func (*OptimizationSettings) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{11} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{10} } func (x *OptimizationSettings) GetStripDebugSymbols() bool { @@ -1094,7 +1009,7 @@ type BuildStrategy struct { func (x *BuildStrategy) Reset() { *x = BuildStrategy{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[12] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1106,7 +1021,7 @@ func (x *BuildStrategy) String() string { func (*BuildStrategy) ProtoMessage() {} func (x *BuildStrategy) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[12] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1119,7 +1034,7 @@ func (x *BuildStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildStrategy.ProtoReflect.Descriptor instead. func (*BuildStrategy) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{12} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{11} } func (x *BuildStrategy) GetStrategyType() isBuildStrategy_StrategyType { @@ -1205,7 +1120,7 @@ type DockerExtractStrategy struct { func (x *DockerExtractStrategy) Reset() { *x = DockerExtractStrategy{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[13] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1217,7 +1132,7 @@ func (x *DockerExtractStrategy) String() string { func (*DockerExtractStrategy) ProtoMessage() {} func (x *DockerExtractStrategy) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[13] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1230,7 +1145,7 @@ func (x *DockerExtractStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use DockerExtractStrategy.ProtoReflect.Descriptor instead. func (*DockerExtractStrategy) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{13} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{12} } func (x *DockerExtractStrategy) GetPreserveLayers() bool { @@ -1267,7 +1182,7 @@ type GoApiStrategy struct { func (x *GoApiStrategy) Reset() { *x = GoApiStrategy{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[14] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1279,7 +1194,7 @@ func (x *GoApiStrategy) String() string { func (*GoApiStrategy) ProtoMessage() {} func (x *GoApiStrategy) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[14] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1292,7 +1207,7 @@ func (x *GoApiStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use GoApiStrategy.ProtoReflect.Descriptor instead. func (*GoApiStrategy) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{14} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{13} } func (x *GoApiStrategy) GetGoVersion() string { @@ -1336,7 +1251,7 @@ type SinatraStrategy struct { func (x *SinatraStrategy) Reset() { *x = SinatraStrategy{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[15] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1348,7 +1263,7 @@ func (x *SinatraStrategy) String() string { func (*SinatraStrategy) ProtoMessage() {} func (x *SinatraStrategy) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[15] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1361,7 +1276,7 @@ func (x *SinatraStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use SinatraStrategy.ProtoReflect.Descriptor instead. func (*SinatraStrategy) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{15} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{14} } func (x *SinatraStrategy) GetRubyVersion() string { @@ -1405,7 +1320,7 @@ type NodejsStrategy struct { func (x *NodejsStrategy) Reset() { *x = NodejsStrategy{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[16] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1417,7 +1332,7 @@ func (x *NodejsStrategy) String() string { func (*NodejsStrategy) ProtoMessage() {} func (x *NodejsStrategy) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[16] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1430,7 +1345,7 @@ func (x *NodejsStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use NodejsStrategy.ProtoReflect.Descriptor instead. func (*NodejsStrategy) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{16} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{15} } func (x *NodejsStrategy) GetNodeVersion() string { @@ -1461,46 +1376,40 @@ func (x *NodejsStrategy) GetEnableProduction() bool { return false } -// Tenant-aware resource limits -type TenantResourceLimits struct { +// Main build configuration +type BuildConfig struct { state protoimpl.MessageState `protogen:"open.v1"` - // Per-build limits - MaxMemoryBytes int64 `protobuf:"varint,1,opt,name=max_memory_bytes,json=maxMemoryBytes,proto3" json:"max_memory_bytes,omitempty"` - MaxCpuCores int32 `protobuf:"varint,2,opt,name=max_cpu_cores,json=maxCpuCores,proto3" json:"max_cpu_cores,omitempty"` - MaxDiskBytes int64 `protobuf:"varint,3,opt,name=max_disk_bytes,json=maxDiskBytes,proto3" json:"max_disk_bytes,omitempty"` - TimeoutSeconds int32 `protobuf:"varint,4,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` - // Tenant-wide quotas - MaxConcurrentBuilds int32 `protobuf:"varint,5,opt,name=max_concurrent_builds,json=maxConcurrentBuilds,proto3" json:"max_concurrent_builds,omitempty"` // Concurrent builds per tenant - MaxDailyBuilds int32 `protobuf:"varint,6,opt,name=max_daily_builds,json=maxDailyBuilds,proto3" json:"max_daily_builds,omitempty"` // Daily build quota - MaxStorageBytes int64 `protobuf:"varint,7,opt,name=max_storage_bytes,json=maxStorageBytes,proto3" json:"max_storage_bytes,omitempty"` // Total storage quota - MaxBuildTimeMinutes int32 `protobuf:"varint,8,opt,name=max_build_time_minutes,json=maxBuildTimeMinutes,proto3" json:"max_build_time_minutes,omitempty"` // Max time per build - // Network restrictions - AllowedRegistries []string `protobuf:"bytes,9,rep,name=allowed_registries,json=allowedRegistries,proto3" json:"allowed_registries,omitempty"` // Docker registries - AllowedGitHosts []string `protobuf:"bytes,10,rep,name=allowed_git_hosts,json=allowedGitHosts,proto3" json:"allowed_git_hosts,omitempty"` // Git hosts - AllowExternalNetwork bool `protobuf:"varint,11,opt,name=allow_external_network,json=allowExternalNetwork,proto3" json:"allow_external_network,omitempty"` // External network access - // Security restrictions - AllowPrivilegedBuilds bool `protobuf:"varint,12,opt,name=allow_privileged_builds,json=allowPrivilegedBuilds,proto3" json:"allow_privileged_builds,omitempty"` // Privileged containers - BlockedCommands []string `protobuf:"bytes,13,rep,name=blocked_commands,json=blockedCommands,proto3" json:"blocked_commands,omitempty"` // Forbidden commands - SandboxLevel int32 `protobuf:"varint,14,opt,name=sandbox_level,json=sandboxLevel,proto3" json:"sandbox_level,omitempty"` // Isolation level (0-3) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TenantResourceLimits) Reset() { - *x = TenantResourceLimits{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[17] + // What we're building from + Source *BuildSource `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + // What we're building to + Target *BuildTarget `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + // How to build it + Strategy *BuildStrategy `protobuf:"bytes,3,opt,name=strategy,proto3" json:"strategy,omitempty"` + // Build metadata + BuildName string `protobuf:"bytes,4,opt,name=build_name,json=buildName,proto3" json:"build_name,omitempty"` // Human-readable name + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Custom labels + // Suggested asset ID to use when registering the built artifact + // This allows the caller to pre-generate the asset ID + SuggestedAssetId string `protobuf:"bytes,6,opt,name=suggested_asset_id,json=suggestedAssetId,proto3" json:"suggested_asset_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BuildConfig) Reset() { + *x = BuildConfig{} + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *TenantResourceLimits) String() string { +func (x *BuildConfig) String() string { return protoimpl.X.MessageStringOf(x) } -func (*TenantResourceLimits) ProtoMessage() {} +func (*BuildConfig) ProtoMessage() {} -func (x *TenantResourceLimits) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[17] +func (x *BuildConfig) ProtoReflect() protoreflect.Message { + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1511,291 +1420,126 @@ func (x *TenantResourceLimits) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use TenantResourceLimits.ProtoReflect.Descriptor instead. -func (*TenantResourceLimits) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{17} +// Deprecated: Use BuildConfig.ProtoReflect.Descriptor instead. +func (*BuildConfig) Descriptor() ([]byte, []int) { + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{16} } -func (x *TenantResourceLimits) GetMaxMemoryBytes() int64 { +func (x *BuildConfig) GetSource() *BuildSource { if x != nil { - return x.MaxMemoryBytes + return x.Source } - return 0 + return nil } -func (x *TenantResourceLimits) GetMaxCpuCores() int32 { +func (x *BuildConfig) GetTarget() *BuildTarget { if x != nil { - return x.MaxCpuCores + return x.Target } - return 0 + return nil } -func (x *TenantResourceLimits) GetMaxDiskBytes() int64 { +func (x *BuildConfig) GetStrategy() *BuildStrategy { if x != nil { - return x.MaxDiskBytes + return x.Strategy } - return 0 + return nil } -func (x *TenantResourceLimits) GetTimeoutSeconds() int32 { +func (x *BuildConfig) GetBuildName() string { if x != nil { - return x.TimeoutSeconds + return x.BuildName } - return 0 + return "" } -func (x *TenantResourceLimits) GetMaxConcurrentBuilds() int32 { +func (x *BuildConfig) GetLabels() map[string]string { if x != nil { - return x.MaxConcurrentBuilds + return x.Labels } - return 0 + return nil } -func (x *TenantResourceLimits) GetMaxDailyBuilds() int32 { +func (x *BuildConfig) GetSuggestedAssetId() string { if x != nil { - return x.MaxDailyBuilds + return x.SuggestedAssetId } - return 0 + return "" } -func (x *TenantResourceLimits) GetMaxStorageBytes() int64 { - if x != nil { - return x.MaxStorageBytes - } - return 0 +// Build isolation metadata +type BuildIsolation struct { + state protoimpl.MessageState `protogen:"open.v1"` + SandboxId string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` // Unique sandbox identifier + NetworkNamespace string `protobuf:"bytes,2,opt,name=network_namespace,json=networkNamespace,proto3" json:"network_namespace,omitempty"` // Network isolation + FilesystemNamespace string `protobuf:"bytes,3,opt,name=filesystem_namespace,json=filesystemNamespace,proto3" json:"filesystem_namespace,omitempty"` // Filesystem isolation + SecurityContexts []string `protobuf:"bytes,4,rep,name=security_contexts,json=securityContexts,proto3" json:"security_contexts,omitempty"` // SELinux/AppArmor contexts + CgroupPath string `protobuf:"bytes,5,opt,name=cgroup_path,json=cgroupPath,proto3" json:"cgroup_path,omitempty"` // Resource cgroup + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x *TenantResourceLimits) GetMaxBuildTimeMinutes() int32 { - if x != nil { - return x.MaxBuildTimeMinutes - } - return 0 +func (x *BuildIsolation) Reset() { + *x = BuildIsolation{} + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BuildIsolation) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *TenantResourceLimits) GetAllowedRegistries() []string { +func (*BuildIsolation) ProtoMessage() {} + +func (x *BuildIsolation) ProtoReflect() protoreflect.Message { + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[17] if x != nil { - return x.AllowedRegistries + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) +} + +// Deprecated: Use BuildIsolation.ProtoReflect.Descriptor instead. +func (*BuildIsolation) Descriptor() ([]byte, []int) { + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{17} } -func (x *TenantResourceLimits) GetAllowedGitHosts() []string { +func (x *BuildIsolation) GetSandboxId() string { if x != nil { - return x.AllowedGitHosts + return x.SandboxId } - return nil + return "" } -func (x *TenantResourceLimits) GetAllowExternalNetwork() bool { +func (x *BuildIsolation) GetNetworkNamespace() string { if x != nil { - return x.AllowExternalNetwork + return x.NetworkNamespace } - return false + return "" } -func (x *TenantResourceLimits) GetAllowPrivilegedBuilds() bool { +func (x *BuildIsolation) GetFilesystemNamespace() string { if x != nil { - return x.AllowPrivilegedBuilds + return x.FilesystemNamespace } - return false + return "" } -func (x *TenantResourceLimits) GetBlockedCommands() []string { +func (x *BuildIsolation) GetSecurityContexts() []string { if x != nil { - return x.BlockedCommands + return x.SecurityContexts } return nil } -func (x *TenantResourceLimits) GetSandboxLevel() int32 { +func (x *BuildIsolation) GetCgroupPath() string { if x != nil { - return x.SandboxLevel - } - return 0 -} - -// Main build configuration -type BuildConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Tenant identification - Tenant *TenantContext `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` - // What we're building from - Source *BuildSource `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - // What we're building to - Target *BuildTarget `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` - // How to build it - Strategy *BuildStrategy `protobuf:"bytes,4,opt,name=strategy,proto3" json:"strategy,omitempty"` - // Build constraints (tenant-aware) - Limits *TenantResourceLimits `protobuf:"bytes,5,opt,name=limits,proto3" json:"limits,omitempty"` - // Build metadata - BuildName string `protobuf:"bytes,6,opt,name=build_name,json=buildName,proto3" json:"build_name,omitempty"` // Human-readable name - Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Custom labels - // Suggested asset ID to use when registering the built artifact - // This allows the caller to pre-generate the asset ID - SuggestedAssetId string `protobuf:"bytes,8,opt,name=suggested_asset_id,json=suggestedAssetId,proto3" json:"suggested_asset_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BuildConfig) Reset() { - *x = BuildConfig{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BuildConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BuildConfig) ProtoMessage() {} - -func (x *BuildConfig) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BuildConfig.ProtoReflect.Descriptor instead. -func (*BuildConfig) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{18} -} - -func (x *BuildConfig) GetTenant() *TenantContext { - if x != nil { - return x.Tenant - } - return nil -} - -func (x *BuildConfig) GetSource() *BuildSource { - if x != nil { - return x.Source - } - return nil -} - -func (x *BuildConfig) GetTarget() *BuildTarget { - if x != nil { - return x.Target - } - return nil -} - -func (x *BuildConfig) GetStrategy() *BuildStrategy { - if x != nil { - return x.Strategy - } - return nil -} - -func (x *BuildConfig) GetLimits() *TenantResourceLimits { - if x != nil { - return x.Limits - } - return nil -} - -func (x *BuildConfig) GetBuildName() string { - if x != nil { - return x.BuildName - } - return "" -} - -func (x *BuildConfig) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *BuildConfig) GetSuggestedAssetId() string { - if x != nil { - return x.SuggestedAssetId - } - return "" -} - -// Build isolation metadata -type BuildIsolation struct { - state protoimpl.MessageState `protogen:"open.v1"` - SandboxId string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` // Unique sandbox identifier - NetworkNamespace string `protobuf:"bytes,2,opt,name=network_namespace,json=networkNamespace,proto3" json:"network_namespace,omitempty"` // Network isolation - FilesystemNamespace string `protobuf:"bytes,3,opt,name=filesystem_namespace,json=filesystemNamespace,proto3" json:"filesystem_namespace,omitempty"` // Filesystem isolation - SecurityContexts []string `protobuf:"bytes,4,rep,name=security_contexts,json=securityContexts,proto3" json:"security_contexts,omitempty"` // SELinux/AppArmor contexts - CgroupPath string `protobuf:"bytes,5,opt,name=cgroup_path,json=cgroupPath,proto3" json:"cgroup_path,omitempty"` // Resource cgroup - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BuildIsolation) Reset() { - *x = BuildIsolation{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BuildIsolation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BuildIsolation) ProtoMessage() {} - -func (x *BuildIsolation) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BuildIsolation.ProtoReflect.Descriptor instead. -func (*BuildIsolation) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{19} -} - -func (x *BuildIsolation) GetSandboxId() string { - if x != nil { - return x.SandboxId - } - return "" -} - -func (x *BuildIsolation) GetNetworkNamespace() string { - if x != nil { - return x.NetworkNamespace - } - return "" -} - -func (x *BuildIsolation) GetFilesystemNamespace() string { - if x != nil { - return x.FilesystemNamespace - } - return "" -} - -func (x *BuildIsolation) GetSecurityContexts() []string { - if x != nil { - return x.SecurityContexts - } - return nil -} - -func (x *BuildIsolation) GetCgroupPath() string { - if x != nil { - return x.CgroupPath + return x.CgroupPath } return "" } @@ -1820,7 +1564,7 @@ type ImageMetadata struct { func (x *ImageMetadata) Reset() { *x = ImageMetadata{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[20] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1832,7 +1576,7 @@ func (x *ImageMetadata) String() string { func (*ImageMetadata) ProtoMessage() {} func (x *ImageMetadata) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[20] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1845,7 +1589,7 @@ func (x *ImageMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageMetadata.ProtoReflect.Descriptor instead. func (*ImageMetadata) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{20} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{18} } func (x *ImageMetadata) GetOriginalImage() string { @@ -1945,7 +1689,7 @@ type BuildMetrics struct { func (x *BuildMetrics) Reset() { *x = BuildMetrics{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[21] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1957,7 +1701,7 @@ func (x *BuildMetrics) String() string { func (*BuildMetrics) ProtoMessage() {} func (x *BuildMetrics) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[21] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1970,7 +1714,7 @@ func (x *BuildMetrics) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildMetrics.ProtoReflect.Descriptor instead. func (*BuildMetrics) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{21} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{19} } func (x *BuildMetrics) GetPullDurationMs() int64 { @@ -2080,7 +1824,7 @@ type BuildJob struct { func (x *BuildJob) Reset() { *x = BuildJob{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[22] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2092,7 +1836,7 @@ func (x *BuildJob) String() string { func (*BuildJob) ProtoMessage() {} func (x *BuildJob) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[22] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2105,7 +1849,7 @@ func (x *BuildJob) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildJob.ProtoReflect.Descriptor instead. func (*BuildJob) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{22} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{20} } func (x *BuildJob) GetBuildId() string { @@ -2234,7 +1978,7 @@ type StreamBuildLogsResponse struct { func (x *StreamBuildLogsResponse) Reset() { *x = StreamBuildLogsResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[23] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2246,7 +1990,7 @@ func (x *StreamBuildLogsResponse) String() string { func (*StreamBuildLogsResponse) ProtoMessage() {} func (x *StreamBuildLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[23] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2259,7 +2003,7 @@ func (x *StreamBuildLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamBuildLogsResponse.ProtoReflect.Descriptor instead. func (*StreamBuildLogsResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{23} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{21} } func (x *StreamBuildLogsResponse) GetTimestamp() *timestamppb.Timestamp { @@ -2297,167 +2041,6 @@ func (x *StreamBuildLogsResponse) GetMetadata() map[string]string { return nil } -// Tenant usage statistics -type TenantUsageStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActiveBuilds int32 `protobuf:"varint,1,opt,name=active_builds,json=activeBuilds,proto3" json:"active_builds,omitempty"` - DailyBuildsUsed int32 `protobuf:"varint,2,opt,name=daily_builds_used,json=dailyBuildsUsed,proto3" json:"daily_builds_used,omitempty"` - StorageBytesUsed int64 `protobuf:"varint,3,opt,name=storage_bytes_used,json=storageBytesUsed,proto3" json:"storage_bytes_used,omitempty"` - ComputeMinutesUsed int64 `protobuf:"varint,4,opt,name=compute_minutes_used,json=computeMinutesUsed,proto3" json:"compute_minutes_used,omitempty"` - BuildsQueued int32 `protobuf:"varint,5,opt,name=builds_queued,json=buildsQueued,proto3" json:"builds_queued,omitempty"` - BuildsCompletedToday int32 `protobuf:"varint,6,opt,name=builds_completed_today,json=buildsCompletedToday,proto3" json:"builds_completed_today,omitempty"` - BuildsFailedToday int32 `protobuf:"varint,7,opt,name=builds_failed_today,json=buildsFailedToday,proto3" json:"builds_failed_today,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TenantUsageStats) Reset() { - *x = TenantUsageStats{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TenantUsageStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TenantUsageStats) ProtoMessage() {} - -func (x *TenantUsageStats) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TenantUsageStats.ProtoReflect.Descriptor instead. -func (*TenantUsageStats) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{24} -} - -func (x *TenantUsageStats) GetActiveBuilds() int32 { - if x != nil { - return x.ActiveBuilds - } - return 0 -} - -func (x *TenantUsageStats) GetDailyBuildsUsed() int32 { - if x != nil { - return x.DailyBuildsUsed - } - return 0 -} - -func (x *TenantUsageStats) GetStorageBytesUsed() int64 { - if x != nil { - return x.StorageBytesUsed - } - return 0 -} - -func (x *TenantUsageStats) GetComputeMinutesUsed() int64 { - if x != nil { - return x.ComputeMinutesUsed - } - return 0 -} - -func (x *TenantUsageStats) GetBuildsQueued() int32 { - if x != nil { - return x.BuildsQueued - } - return 0 -} - -func (x *TenantUsageStats) GetBuildsCompletedToday() int32 { - if x != nil { - return x.BuildsCompletedToday - } - return 0 -} - -func (x *TenantUsageStats) GetBuildsFailedToday() int32 { - if x != nil { - return x.BuildsFailedToday - } - return 0 -} - -type QuotaViolation struct { - state protoimpl.MessageState `protogen:"open.v1"` - QuotaType string `protobuf:"bytes,1,opt,name=quota_type,json=quotaType,proto3" json:"quota_type,omitempty"` // "concurrent_builds", "daily_builds", etc. - CurrentValue int64 `protobuf:"varint,2,opt,name=current_value,json=currentValue,proto3" json:"current_value,omitempty"` - LimitValue int64 `protobuf:"varint,3,opt,name=limit_value,json=limitValue,proto3" json:"limit_value,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *QuotaViolation) Reset() { - *x = QuotaViolation{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *QuotaViolation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QuotaViolation) ProtoMessage() {} - -func (x *QuotaViolation) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QuotaViolation.ProtoReflect.Descriptor instead. -func (*QuotaViolation) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{25} -} - -func (x *QuotaViolation) GetQuotaType() string { - if x != nil { - return x.QuotaType - } - return "" -} - -func (x *QuotaViolation) GetCurrentValue() int64 { - if x != nil { - return x.CurrentValue - } - return 0 -} - -func (x *QuotaViolation) GetLimitValue() int64 { - if x != nil { - return x.LimitValue - } - return 0 -} - -func (x *QuotaViolation) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - // Request/Response messages type CreateBuildRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2468,7 +2051,7 @@ type CreateBuildRequest struct { func (x *CreateBuildRequest) Reset() { *x = CreateBuildRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[26] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2480,7 +2063,7 @@ func (x *CreateBuildRequest) String() string { func (*CreateBuildRequest) ProtoMessage() {} func (x *CreateBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[26] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2493,7 +2076,7 @@ func (x *CreateBuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateBuildRequest.ProtoReflect.Descriptor instead. func (*CreateBuildRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{26} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{22} } func (x *CreateBuildRequest) GetConfig() *BuildConfig { @@ -2515,7 +2098,7 @@ type CreateBuildResponse struct { func (x *CreateBuildResponse) Reset() { *x = CreateBuildResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[27] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2527,7 +2110,7 @@ func (x *CreateBuildResponse) String() string { func (*CreateBuildResponse) ProtoMessage() {} func (x *CreateBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[27] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2540,7 +2123,7 @@ func (x *CreateBuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateBuildResponse.ProtoReflect.Descriptor instead. func (*CreateBuildResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{27} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{23} } func (x *CreateBuildResponse) GetBuildId() string { @@ -2581,7 +2164,7 @@ type GetBuildRequest struct { func (x *GetBuildRequest) Reset() { *x = GetBuildRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[28] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2593,7 +2176,7 @@ func (x *GetBuildRequest) String() string { func (*GetBuildRequest) ProtoMessage() {} func (x *GetBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[28] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2606,7 +2189,7 @@ func (x *GetBuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBuildRequest.ProtoReflect.Descriptor instead. func (*GetBuildRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{28} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{24} } func (x *GetBuildRequest) GetBuildId() string { @@ -2632,7 +2215,7 @@ type GetBuildResponse struct { func (x *GetBuildResponse) Reset() { *x = GetBuildResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[29] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2644,7 +2227,7 @@ func (x *GetBuildResponse) String() string { func (*GetBuildResponse) ProtoMessage() {} func (x *GetBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[29] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2657,7 +2240,7 @@ func (x *GetBuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBuildResponse.ProtoReflect.Descriptor instead. func (*GetBuildResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{29} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{25} } func (x *GetBuildResponse) GetBuild() *BuildJob { @@ -2669,17 +2252,16 @@ func (x *GetBuildResponse) GetBuild() *BuildJob { type ListBuildsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // Required for filtering - StateFilter []BuildState `protobuf:"varint,2,rep,packed,name=state_filter,json=stateFilter,proto3,enum=deploy.builderd.v1.BuildState" json:"state_filter,omitempty"` - PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + StateFilter []BuildState `protobuf:"varint,1,rep,packed,name=state_filter,json=stateFilter,proto3,enum=deploy.builderd.v1.BuildState" json:"state_filter,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ListBuildsRequest) Reset() { *x = ListBuildsRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[30] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2691,7 +2273,7 @@ func (x *ListBuildsRequest) String() string { func (*ListBuildsRequest) ProtoMessage() {} func (x *ListBuildsRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[30] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2704,14 +2286,7 @@ func (x *ListBuildsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBuildsRequest.ProtoReflect.Descriptor instead. func (*ListBuildsRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{30} -} - -func (x *ListBuildsRequest) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{26} } func (x *ListBuildsRequest) GetStateFilter() []BuildState { @@ -2746,7 +2321,7 @@ type ListBuildsResponse struct { func (x *ListBuildsResponse) Reset() { *x = ListBuildsResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[31] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2758,7 +2333,7 @@ func (x *ListBuildsResponse) String() string { func (*ListBuildsResponse) ProtoMessage() {} func (x *ListBuildsResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[31] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2771,7 +2346,7 @@ func (x *ListBuildsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBuildsResponse.ProtoReflect.Descriptor instead. func (*ListBuildsResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{31} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{27} } func (x *ListBuildsResponse) GetBuilds() []*BuildJob { @@ -2798,14 +2373,13 @@ func (x *ListBuildsResponse) GetTotalCount() int32 { type CancelBuildRequest struct { state protoimpl.MessageState `protogen:"open.v1"` BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // For authorization unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CancelBuildRequest) Reset() { *x = CancelBuildRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[32] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2817,7 +2391,7 @@ func (x *CancelBuildRequest) String() string { func (*CancelBuildRequest) ProtoMessage() {} func (x *CancelBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[32] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2830,7 +2404,7 @@ func (x *CancelBuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelBuildRequest.ProtoReflect.Descriptor instead. func (*CancelBuildRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{32} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{28} } func (x *CancelBuildRequest) GetBuildId() string { @@ -2840,13 +2414,6 @@ func (x *CancelBuildRequest) GetBuildId() string { return "" } -func (x *CancelBuildRequest) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - type CancelBuildResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` @@ -2857,7 +2424,7 @@ type CancelBuildResponse struct { func (x *CancelBuildResponse) Reset() { *x = CancelBuildResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[33] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2869,7 +2436,7 @@ func (x *CancelBuildResponse) String() string { func (*CancelBuildResponse) ProtoMessage() {} func (x *CancelBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[33] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2882,7 +2449,7 @@ func (x *CancelBuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelBuildResponse.ProtoReflect.Descriptor instead. func (*CancelBuildResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{33} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{29} } func (x *CancelBuildResponse) GetSuccess() bool { @@ -2902,15 +2469,14 @@ func (x *CancelBuildResponse) GetState() BuildState { type DeleteBuildRequest struct { state protoimpl.MessageState `protogen:"open.v1"` BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // For authorization - Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` // Delete even if running + Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` // Delete even if running unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DeleteBuildRequest) Reset() { *x = DeleteBuildRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[34] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2922,7 +2488,7 @@ func (x *DeleteBuildRequest) String() string { func (*DeleteBuildRequest) ProtoMessage() {} func (x *DeleteBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[34] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2935,7 +2501,7 @@ func (x *DeleteBuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteBuildRequest.ProtoReflect.Descriptor instead. func (*DeleteBuildRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{34} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{30} } func (x *DeleteBuildRequest) GetBuildId() string { @@ -2945,13 +2511,6 @@ func (x *DeleteBuildRequest) GetBuildId() string { return "" } -func (x *DeleteBuildRequest) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - func (x *DeleteBuildRequest) GetForce() bool { if x != nil { return x.Force @@ -2968,7 +2527,7 @@ type DeleteBuildResponse struct { func (x *DeleteBuildResponse) Reset() { *x = DeleteBuildResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[35] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2980,7 +2539,7 @@ func (x *DeleteBuildResponse) String() string { func (*DeleteBuildResponse) ProtoMessage() {} func (x *DeleteBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[35] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2993,7 +2552,7 @@ func (x *DeleteBuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteBuildResponse.ProtoReflect.Descriptor instead. func (*DeleteBuildResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{35} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{31} } func (x *DeleteBuildResponse) GetSuccess() bool { @@ -3006,15 +2565,14 @@ func (x *DeleteBuildResponse) GetSuccess() bool { type StreamBuildLogsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // For authorization - Follow bool `protobuf:"varint,3,opt,name=follow,proto3" json:"follow,omitempty"` // Continue streaming new logs + Follow bool `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"` // Continue streaming new logs unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StreamBuildLogsRequest) Reset() { *x = StreamBuildLogsRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[36] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3026,7 +2584,7 @@ func (x *StreamBuildLogsRequest) String() string { func (*StreamBuildLogsRequest) ProtoMessage() {} func (x *StreamBuildLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[36] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3039,7 +2597,7 @@ func (x *StreamBuildLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamBuildLogsRequest.ProtoReflect.Descriptor instead. func (*StreamBuildLogsRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{36} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{32} } func (x *StreamBuildLogsRequest) GetBuildId() string { @@ -3049,13 +2607,6 @@ func (x *StreamBuildLogsRequest) GetBuildId() string { return "" } -func (x *StreamBuildLogsRequest) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - func (x *StreamBuildLogsRequest) GetFollow() bool { if x != nil { return x.Follow @@ -3063,110 +2614,6 @@ func (x *StreamBuildLogsRequest) GetFollow() bool { return false } -type GetTenantQuotasRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetTenantQuotasRequest) Reset() { - *x = GetTenantQuotasRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetTenantQuotasRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTenantQuotasRequest) ProtoMessage() {} - -func (x *GetTenantQuotasRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[37] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTenantQuotasRequest.ProtoReflect.Descriptor instead. -func (*GetTenantQuotasRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{37} -} - -func (x *GetTenantQuotasRequest) GetTenantId() string { - if x != nil { - return x.TenantId - } - return "" -} - -type GetTenantQuotasResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - CurrentLimits *TenantResourceLimits `protobuf:"bytes,1,opt,name=current_limits,json=currentLimits,proto3" json:"current_limits,omitempty"` - CurrentUsage *TenantUsageStats `protobuf:"bytes,2,opt,name=current_usage,json=currentUsage,proto3" json:"current_usage,omitempty"` - Violations []*QuotaViolation `protobuf:"bytes,3,rep,name=violations,proto3" json:"violations,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetTenantQuotasResponse) Reset() { - *x = GetTenantQuotasResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetTenantQuotasResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTenantQuotasResponse) ProtoMessage() {} - -func (x *GetTenantQuotasResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[38] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTenantQuotasResponse.ProtoReflect.Descriptor instead. -func (*GetTenantQuotasResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{38} -} - -func (x *GetTenantQuotasResponse) GetCurrentLimits() *TenantResourceLimits { - if x != nil { - return x.CurrentLimits - } - return nil -} - -func (x *GetTenantQuotasResponse) GetCurrentUsage() *TenantUsageStats { - if x != nil { - return x.CurrentUsage - } - return nil -} - -func (x *GetTenantQuotasResponse) GetViolations() []*QuotaViolation { - if x != nil { - return x.Violations - } - return nil -} - type GetBuildStatsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` @@ -3178,7 +2625,7 @@ type GetBuildStatsRequest struct { func (x *GetBuildStatsRequest) Reset() { *x = GetBuildStatsRequest{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[39] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3190,7 +2637,7 @@ func (x *GetBuildStatsRequest) String() string { func (*GetBuildStatsRequest) ProtoMessage() {} func (x *GetBuildStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[39] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3203,7 +2650,7 @@ func (x *GetBuildStatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBuildStatsRequest.ProtoReflect.Descriptor instead. func (*GetBuildStatsRequest) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{39} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{33} } func (x *GetBuildStatsRequest) GetTenantId() string { @@ -3242,7 +2689,7 @@ type GetBuildStatsResponse struct { func (x *GetBuildStatsResponse) Reset() { *x = GetBuildStatsResponse{} - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[40] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3254,7 +2701,7 @@ func (x *GetBuildStatsResponse) String() string { func (*GetBuildStatsResponse) ProtoMessage() {} func (x *GetBuildStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_deploy_builderd_v1_builder_proto_msgTypes[40] + mi := &file_deploy_builderd_v1_builder_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3267,7 +2714,7 @@ func (x *GetBuildStatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBuildStatsResponse.ProtoReflect.Descriptor instead. func (*GetBuildStatsResponse) Descriptor() ([]byte, []int) { - return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{40} + return file_deploy_builderd_v1_builder_proto_rawDescGZIP(), []int{34} } func (x *GetBuildStatsResponse) GetTotalBuilds() int32 { @@ -3323,18 +2770,7 @@ var File_deploy_builderd_v1_builder_proto protoreflect.FileDescriptor const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "\n" + - " deploy/builderd/v1/builder.proto\x12\x12deploy.builderd.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd6\x02\n" + - "\rTenantContext\x12\x1b\n" + - "\ttenant_id\x18\x01 \x01(\tR\btenantId\x12\x1f\n" + - "\vcustomer_id\x18\x02 \x01(\tR\n" + - "customerId\x12'\n" + - "\x0forganization_id\x18\x03 \x01(\tR\x0eorganizationId\x122\n" + - "\x04tier\x18\x04 \x01(\x0e2\x1e.deploy.builderd.v1.TenantTierR\x04tier\x12 \n" + - "\vpermissions\x18\x05 \x03(\tR\vpermissions\x12K\n" + - "\bmetadata\x18\x06 \x03(\v2/.deploy.builderd.v1.TenantContext.MetadataEntryR\bmetadata\x1a;\n" + - "\rMetadataEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf9\x01\n" + + " deploy/builderd/v1/builder.proto\x12\x12deploy.builderd.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf9\x01\n" + "\vBuildSource\x12J\n" + "\fdocker_image\x18\x01 \x01(\v2%.deploy.builderd.v1.DockerImageSourceH\x00R\vdockerImage\x12P\n" + "\x0egit_repository\x18\x02 \x01(\v2'.deploy.builderd.v1.GitRepositorySourceH\x00R\rgitRepository\x12=\n" + @@ -3430,33 +2866,15 @@ const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "\fnode_version\x18\x01 \x01(\tR\vnodeVersion\x12'\n" + "\x0fpackage_manager\x18\x02 \x01(\tR\x0epackageManager\x12!\n" + "\fstart_script\x18\x03 \x01(\tR\vstartScript\x12+\n" + - "\x11enable_production\x18\x04 \x01(\bR\x10enableProduction\"\x8b\x05\n" + - "\x14TenantResourceLimits\x12(\n" + - "\x10max_memory_bytes\x18\x01 \x01(\x03R\x0emaxMemoryBytes\x12\"\n" + - "\rmax_cpu_cores\x18\x02 \x01(\x05R\vmaxCpuCores\x12$\n" + - "\x0emax_disk_bytes\x18\x03 \x01(\x03R\fmaxDiskBytes\x12'\n" + - "\x0ftimeout_seconds\x18\x04 \x01(\x05R\x0etimeoutSeconds\x122\n" + - "\x15max_concurrent_builds\x18\x05 \x01(\x05R\x13maxConcurrentBuilds\x12(\n" + - "\x10max_daily_builds\x18\x06 \x01(\x05R\x0emaxDailyBuilds\x12*\n" + - "\x11max_storage_bytes\x18\a \x01(\x03R\x0fmaxStorageBytes\x123\n" + - "\x16max_build_time_minutes\x18\b \x01(\x05R\x13maxBuildTimeMinutes\x12-\n" + - "\x12allowed_registries\x18\t \x03(\tR\x11allowedRegistries\x12*\n" + - "\x11allowed_git_hosts\x18\n" + - " \x03(\tR\x0fallowedGitHosts\x124\n" + - "\x16allow_external_network\x18\v \x01(\bR\x14allowExternalNetwork\x126\n" + - "\x17allow_privileged_builds\x18\f \x01(\bR\x15allowPrivilegedBuilds\x12)\n" + - "\x10blocked_commands\x18\r \x03(\tR\x0fblockedCommands\x12#\n" + - "\rsandbox_level\x18\x0e \x01(\x05R\fsandboxLevel\"\x88\x04\n" + - "\vBuildConfig\x129\n" + - "\x06tenant\x18\x01 \x01(\v2!.deploy.builderd.v1.TenantContextR\x06tenant\x127\n" + - "\x06source\x18\x02 \x01(\v2\x1f.deploy.builderd.v1.BuildSourceR\x06source\x127\n" + - "\x06target\x18\x03 \x01(\v2\x1f.deploy.builderd.v1.BuildTargetR\x06target\x12=\n" + - "\bstrategy\x18\x04 \x01(\v2!.deploy.builderd.v1.BuildStrategyR\bstrategy\x12@\n" + - "\x06limits\x18\x05 \x01(\v2(.deploy.builderd.v1.TenantResourceLimitsR\x06limits\x12\x1d\n" + + "\x11enable_production\x18\x04 \x01(\bR\x10enableProduction\"\x8b\x03\n" + + "\vBuildConfig\x127\n" + + "\x06source\x18\x01 \x01(\v2\x1f.deploy.builderd.v1.BuildSourceR\x06source\x127\n" + + "\x06target\x18\x02 \x01(\v2\x1f.deploy.builderd.v1.BuildTargetR\x06target\x12=\n" + + "\bstrategy\x18\x03 \x01(\v2!.deploy.builderd.v1.BuildStrategyR\bstrategy\x12\x1d\n" + "\n" + - "build_name\x18\x06 \x01(\tR\tbuildName\x12C\n" + - "\x06labels\x18\a \x03(\v2+.deploy.builderd.v1.BuildConfig.LabelsEntryR\x06labels\x12,\n" + - "\x12suggested_asset_id\x18\b \x01(\tR\x10suggestedAssetId\x1a9\n" + + "build_name\x18\x04 \x01(\tR\tbuildName\x12C\n" + + "\x06labels\x18\x05 \x03(\v2+.deploy.builderd.v1.BuildConfig.LabelsEntryR\x06labels\x12,\n" + + "\x12suggested_asset_id\x18\x06 \x01(\tR\x10suggestedAssetId\x1a9\n" + "\vLabelsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xdd\x01\n" + @@ -3533,22 +2951,7 @@ const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "\bmetadata\x18\x05 \x03(\v29.deploy.builderd.v1.StreamBuildLogsResponse.MetadataEntryR\bmetadata\x1a;\n" + "\rMetadataEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xce\x02\n" + - "\x10TenantUsageStats\x12#\n" + - "\ractive_builds\x18\x01 \x01(\x05R\factiveBuilds\x12*\n" + - "\x11daily_builds_used\x18\x02 \x01(\x05R\x0fdailyBuildsUsed\x12,\n" + - "\x12storage_bytes_used\x18\x03 \x01(\x03R\x10storageBytesUsed\x120\n" + - "\x14compute_minutes_used\x18\x04 \x01(\x03R\x12computeMinutesUsed\x12#\n" + - "\rbuilds_queued\x18\x05 \x01(\x05R\fbuildsQueued\x124\n" + - "\x16builds_completed_today\x18\x06 \x01(\x05R\x14buildsCompletedToday\x12.\n" + - "\x13builds_failed_today\x18\a \x01(\x05R\x11buildsFailedToday\"\x8f\x01\n" + - "\x0eQuotaViolation\x12\x1d\n" + - "\n" + - "quota_type\x18\x01 \x01(\tR\tquotaType\x12#\n" + - "\rcurrent_value\x18\x02 \x01(\x03R\fcurrentValue\x12\x1f\n" + - "\vlimit_value\x18\x03 \x01(\x03R\n" + - "limitValue\x12\x18\n" + - "\amessage\x18\x04 \x01(\tR\amessage\"M\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"M\n" + "\x12CreateBuildRequest\x127\n" + "\x06config\x18\x01 \x01(\v2\x1f.deploy.builderd.v1.BuildConfigR\x06config\"\xc2\x01\n" + "\x13CreateBuildResponse\x12\x19\n" + @@ -3562,42 +2965,30 @@ const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x1b\n" + "\ttenant_id\x18\x02 \x01(\tR\btenantId\"F\n" + "\x10GetBuildResponse\x122\n" + - "\x05build\x18\x01 \x01(\v2\x1c.deploy.builderd.v1.BuildJobR\x05build\"\xaf\x01\n" + - "\x11ListBuildsRequest\x12\x1b\n" + - "\ttenant_id\x18\x01 \x01(\tR\btenantId\x12A\n" + - "\fstate_filter\x18\x02 \x03(\x0e2\x1e.deploy.builderd.v1.BuildStateR\vstateFilter\x12\x1b\n" + - "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1d\n" + + "\x05build\x18\x01 \x01(\v2\x1c.deploy.builderd.v1.BuildJobR\x05build\"\x92\x01\n" + + "\x11ListBuildsRequest\x12A\n" + + "\fstate_filter\x18\x01 \x03(\x0e2\x1e.deploy.builderd.v1.BuildStateR\vstateFilter\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + "\n" + - "page_token\x18\x04 \x01(\tR\tpageToken\"\x93\x01\n" + + "page_token\x18\x03 \x01(\tR\tpageToken\"\x93\x01\n" + "\x12ListBuildsResponse\x124\n" + "\x06builds\x18\x01 \x03(\v2\x1c.deploy.builderd.v1.BuildJobR\x06builds\x12&\n" + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1f\n" + "\vtotal_count\x18\x03 \x01(\x05R\n" + - "totalCount\"L\n" + + "totalCount\"/\n" + "\x12CancelBuildRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x1b\n" + - "\ttenant_id\x18\x02 \x01(\tR\btenantId\"e\n" + + "\bbuild_id\x18\x01 \x01(\tR\abuildId\"e\n" + "\x13CancelBuildResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x124\n" + - "\x05state\x18\x02 \x01(\x0e2\x1e.deploy.builderd.v1.BuildStateR\x05state\"b\n" + + "\x05state\x18\x02 \x01(\x0e2\x1e.deploy.builderd.v1.BuildStateR\x05state\"E\n" + "\x12DeleteBuildRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x1b\n" + - "\ttenant_id\x18\x02 \x01(\tR\btenantId\x12\x14\n" + - "\x05force\x18\x03 \x01(\bR\x05force\"/\n" + + "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x14\n" + + "\x05force\x18\x02 \x01(\bR\x05force\"/\n" + "\x13DeleteBuildResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\"h\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"K\n" + "\x16StreamBuildLogsRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x1b\n" + - "\ttenant_id\x18\x02 \x01(\tR\btenantId\x12\x16\n" + - "\x06follow\x18\x03 \x01(\bR\x06follow\"5\n" + - "\x16GetTenantQuotasRequest\x12\x1b\n" + - "\ttenant_id\x18\x01 \x01(\tR\btenantId\"\xf9\x01\n" + - "\x17GetTenantQuotasResponse\x12O\n" + - "\x0ecurrent_limits\x18\x01 \x01(\v2(.deploy.builderd.v1.TenantResourceLimitsR\rcurrentLimits\x12I\n" + - "\rcurrent_usage\x18\x02 \x01(\v2$.deploy.builderd.v1.TenantUsageStatsR\fcurrentUsage\x12B\n" + - "\n" + - "violations\x18\x03 \x03(\v2\".deploy.builderd.v1.QuotaViolationR\n" + - "violations\"\xa5\x01\n" + + "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x16\n" + + "\x06follow\x18\x02 \x01(\bR\x06follow\"\xa5\x01\n" + "\x14GetBuildStatsRequest\x12\x1b\n" + "\ttenant_id\x18\x01 \x01(\tR\btenantId\x129\n" + "\n" + @@ -3634,7 +3025,7 @@ const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "\x19INIT_STRATEGY_UNSPECIFIED\x10\x00\x12\x16\n" + "\x12INIT_STRATEGY_TINI\x10\x01\x12\x18\n" + "\x14INIT_STRATEGY_DIRECT\x10\x02\x12\x18\n" + - "\x14INIT_STRATEGY_CUSTOM\x10\x032\xa4\x06\n" + + "\x14INIT_STRATEGY_CUSTOM\x10\x032\xb8\x05\n" + "\x0eBuilderService\x12^\n" + "\vCreateBuild\x12&.deploy.builderd.v1.CreateBuildRequest\x1a'.deploy.builderd.v1.CreateBuildResponse\x12U\n" + "\bGetBuild\x12#.deploy.builderd.v1.GetBuildRequest\x1a$.deploy.builderd.v1.GetBuildResponse\x12[\n" + @@ -3642,8 +3033,7 @@ const file_deploy_builderd_v1_builder_proto_rawDesc = "" + "ListBuilds\x12%.deploy.builderd.v1.ListBuildsRequest\x1a&.deploy.builderd.v1.ListBuildsResponse\x12^\n" + "\vCancelBuild\x12&.deploy.builderd.v1.CancelBuildRequest\x1a'.deploy.builderd.v1.CancelBuildResponse\x12^\n" + "\vDeleteBuild\x12&.deploy.builderd.v1.DeleteBuildRequest\x1a'.deploy.builderd.v1.DeleteBuildResponse\x12l\n" + - "\x0fStreamBuildLogs\x12*.deploy.builderd.v1.StreamBuildLogsRequest\x1a+.deploy.builderd.v1.StreamBuildLogsResponse0\x01\x12j\n" + - "\x0fGetTenantQuotas\x12*.deploy.builderd.v1.GetTenantQuotasRequest\x1a+.deploy.builderd.v1.GetTenantQuotasResponse\x12d\n" + + "\x0fStreamBuildLogs\x12*.deploy.builderd.v1.StreamBuildLogsRequest\x1a+.deploy.builderd.v1.StreamBuildLogsResponse0\x01\x12d\n" + "\rGetBuildStats\x12(.deploy.builderd.v1.GetBuildStatsRequest\x1a).deploy.builderd.v1.GetBuildStatsResponseBEZCgithub.com/unkeyed/unkey/go/gen/proto/deploy/builderd/v1;builderdv1b\x06proto3" var ( @@ -3659,132 +3049,116 @@ func file_deploy_builderd_v1_builder_proto_rawDescGZIP() []byte { } var file_deploy_builderd_v1_builder_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_deploy_builderd_v1_builder_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_deploy_builderd_v1_builder_proto_msgTypes = make([]protoimpl.MessageInfo, 41) var file_deploy_builderd_v1_builder_proto_goTypes = []any{ (BuildState)(0), // 0: deploy.builderd.v1.BuildState (TenantTier)(0), // 1: deploy.builderd.v1.TenantTier (InitStrategy)(0), // 2: deploy.builderd.v1.InitStrategy - (*TenantContext)(nil), // 3: deploy.builderd.v1.TenantContext - (*BuildSource)(nil), // 4: deploy.builderd.v1.BuildSource - (*DockerImageSource)(nil), // 5: deploy.builderd.v1.DockerImageSource - (*DockerAuth)(nil), // 6: deploy.builderd.v1.DockerAuth - (*GitRepositorySource)(nil), // 7: deploy.builderd.v1.GitRepositorySource - (*GitAuth)(nil), // 8: deploy.builderd.v1.GitAuth - (*ArchiveSource)(nil), // 9: deploy.builderd.v1.ArchiveSource - (*BuildTarget)(nil), // 10: deploy.builderd.v1.BuildTarget - (*MicroVMRootfs)(nil), // 11: deploy.builderd.v1.MicroVMRootfs - (*ContainerImage)(nil), // 12: deploy.builderd.v1.ContainerImage - (*RuntimeConfig)(nil), // 13: deploy.builderd.v1.RuntimeConfig - (*OptimizationSettings)(nil), // 14: deploy.builderd.v1.OptimizationSettings - (*BuildStrategy)(nil), // 15: deploy.builderd.v1.BuildStrategy - (*DockerExtractStrategy)(nil), // 16: deploy.builderd.v1.DockerExtractStrategy - (*GoApiStrategy)(nil), // 17: deploy.builderd.v1.GoApiStrategy - (*SinatraStrategy)(nil), // 18: deploy.builderd.v1.SinatraStrategy - (*NodejsStrategy)(nil), // 19: deploy.builderd.v1.NodejsStrategy - (*TenantResourceLimits)(nil), // 20: deploy.builderd.v1.TenantResourceLimits - (*BuildConfig)(nil), // 21: deploy.builderd.v1.BuildConfig - (*BuildIsolation)(nil), // 22: deploy.builderd.v1.BuildIsolation - (*ImageMetadata)(nil), // 23: deploy.builderd.v1.ImageMetadata - (*BuildMetrics)(nil), // 24: deploy.builderd.v1.BuildMetrics - (*BuildJob)(nil), // 25: deploy.builderd.v1.BuildJob - (*StreamBuildLogsResponse)(nil), // 26: deploy.builderd.v1.StreamBuildLogsResponse - (*TenantUsageStats)(nil), // 27: deploy.builderd.v1.TenantUsageStats - (*QuotaViolation)(nil), // 28: deploy.builderd.v1.QuotaViolation - (*CreateBuildRequest)(nil), // 29: deploy.builderd.v1.CreateBuildRequest - (*CreateBuildResponse)(nil), // 30: deploy.builderd.v1.CreateBuildResponse - (*GetBuildRequest)(nil), // 31: deploy.builderd.v1.GetBuildRequest - (*GetBuildResponse)(nil), // 32: deploy.builderd.v1.GetBuildResponse - (*ListBuildsRequest)(nil), // 33: deploy.builderd.v1.ListBuildsRequest - (*ListBuildsResponse)(nil), // 34: deploy.builderd.v1.ListBuildsResponse - (*CancelBuildRequest)(nil), // 35: deploy.builderd.v1.CancelBuildRequest - (*CancelBuildResponse)(nil), // 36: deploy.builderd.v1.CancelBuildResponse - (*DeleteBuildRequest)(nil), // 37: deploy.builderd.v1.DeleteBuildRequest - (*DeleteBuildResponse)(nil), // 38: deploy.builderd.v1.DeleteBuildResponse - (*StreamBuildLogsRequest)(nil), // 39: deploy.builderd.v1.StreamBuildLogsRequest - (*GetTenantQuotasRequest)(nil), // 40: deploy.builderd.v1.GetTenantQuotasRequest - (*GetTenantQuotasResponse)(nil), // 41: deploy.builderd.v1.GetTenantQuotasResponse - (*GetBuildStatsRequest)(nil), // 42: deploy.builderd.v1.GetBuildStatsRequest - (*GetBuildStatsResponse)(nil), // 43: deploy.builderd.v1.GetBuildStatsResponse - nil, // 44: deploy.builderd.v1.TenantContext.MetadataEntry - nil, // 45: deploy.builderd.v1.RuntimeConfig.EnvironmentEntry - nil, // 46: deploy.builderd.v1.SinatraStrategy.RackConfigEntry - nil, // 47: deploy.builderd.v1.BuildConfig.LabelsEntry - nil, // 48: deploy.builderd.v1.ImageMetadata.LabelsEntry - nil, // 49: deploy.builderd.v1.ImageMetadata.EnvEntry - nil, // 50: deploy.builderd.v1.StreamBuildLogsResponse.MetadataEntry - (*timestamppb.Timestamp)(nil), // 51: google.protobuf.Timestamp + (*BuildSource)(nil), // 3: deploy.builderd.v1.BuildSource + (*DockerImageSource)(nil), // 4: deploy.builderd.v1.DockerImageSource + (*DockerAuth)(nil), // 5: deploy.builderd.v1.DockerAuth + (*GitRepositorySource)(nil), // 6: deploy.builderd.v1.GitRepositorySource + (*GitAuth)(nil), // 7: deploy.builderd.v1.GitAuth + (*ArchiveSource)(nil), // 8: deploy.builderd.v1.ArchiveSource + (*BuildTarget)(nil), // 9: deploy.builderd.v1.BuildTarget + (*MicroVMRootfs)(nil), // 10: deploy.builderd.v1.MicroVMRootfs + (*ContainerImage)(nil), // 11: deploy.builderd.v1.ContainerImage + (*RuntimeConfig)(nil), // 12: deploy.builderd.v1.RuntimeConfig + (*OptimizationSettings)(nil), // 13: deploy.builderd.v1.OptimizationSettings + (*BuildStrategy)(nil), // 14: deploy.builderd.v1.BuildStrategy + (*DockerExtractStrategy)(nil), // 15: deploy.builderd.v1.DockerExtractStrategy + (*GoApiStrategy)(nil), // 16: deploy.builderd.v1.GoApiStrategy + (*SinatraStrategy)(nil), // 17: deploy.builderd.v1.SinatraStrategy + (*NodejsStrategy)(nil), // 18: deploy.builderd.v1.NodejsStrategy + (*BuildConfig)(nil), // 19: deploy.builderd.v1.BuildConfig + (*BuildIsolation)(nil), // 20: deploy.builderd.v1.BuildIsolation + (*ImageMetadata)(nil), // 21: deploy.builderd.v1.ImageMetadata + (*BuildMetrics)(nil), // 22: deploy.builderd.v1.BuildMetrics + (*BuildJob)(nil), // 23: deploy.builderd.v1.BuildJob + (*StreamBuildLogsResponse)(nil), // 24: deploy.builderd.v1.StreamBuildLogsResponse + (*CreateBuildRequest)(nil), // 25: deploy.builderd.v1.CreateBuildRequest + (*CreateBuildResponse)(nil), // 26: deploy.builderd.v1.CreateBuildResponse + (*GetBuildRequest)(nil), // 27: deploy.builderd.v1.GetBuildRequest + (*GetBuildResponse)(nil), // 28: deploy.builderd.v1.GetBuildResponse + (*ListBuildsRequest)(nil), // 29: deploy.builderd.v1.ListBuildsRequest + (*ListBuildsResponse)(nil), // 30: deploy.builderd.v1.ListBuildsResponse + (*CancelBuildRequest)(nil), // 31: deploy.builderd.v1.CancelBuildRequest + (*CancelBuildResponse)(nil), // 32: deploy.builderd.v1.CancelBuildResponse + (*DeleteBuildRequest)(nil), // 33: deploy.builderd.v1.DeleteBuildRequest + (*DeleteBuildResponse)(nil), // 34: deploy.builderd.v1.DeleteBuildResponse + (*StreamBuildLogsRequest)(nil), // 35: deploy.builderd.v1.StreamBuildLogsRequest + (*GetBuildStatsRequest)(nil), // 36: deploy.builderd.v1.GetBuildStatsRequest + (*GetBuildStatsResponse)(nil), // 37: deploy.builderd.v1.GetBuildStatsResponse + nil, // 38: deploy.builderd.v1.RuntimeConfig.EnvironmentEntry + nil, // 39: deploy.builderd.v1.SinatraStrategy.RackConfigEntry + nil, // 40: deploy.builderd.v1.BuildConfig.LabelsEntry + nil, // 41: deploy.builderd.v1.ImageMetadata.LabelsEntry + nil, // 42: deploy.builderd.v1.ImageMetadata.EnvEntry + nil, // 43: deploy.builderd.v1.StreamBuildLogsResponse.MetadataEntry + (*timestamppb.Timestamp)(nil), // 44: google.protobuf.Timestamp } var file_deploy_builderd_v1_builder_proto_depIdxs = []int32{ - 1, // 0: deploy.builderd.v1.TenantContext.tier:type_name -> deploy.builderd.v1.TenantTier - 44, // 1: deploy.builderd.v1.TenantContext.metadata:type_name -> deploy.builderd.v1.TenantContext.MetadataEntry - 5, // 2: deploy.builderd.v1.BuildSource.docker_image:type_name -> deploy.builderd.v1.DockerImageSource - 7, // 3: deploy.builderd.v1.BuildSource.git_repository:type_name -> deploy.builderd.v1.GitRepositorySource - 9, // 4: deploy.builderd.v1.BuildSource.archive:type_name -> deploy.builderd.v1.ArchiveSource - 6, // 5: deploy.builderd.v1.DockerImageSource.auth:type_name -> deploy.builderd.v1.DockerAuth - 8, // 6: deploy.builderd.v1.GitRepositorySource.auth:type_name -> deploy.builderd.v1.GitAuth - 11, // 7: deploy.builderd.v1.BuildTarget.microvm_rootfs:type_name -> deploy.builderd.v1.MicroVMRootfs - 12, // 8: deploy.builderd.v1.BuildTarget.container_image:type_name -> deploy.builderd.v1.ContainerImage - 2, // 9: deploy.builderd.v1.MicroVMRootfs.init_strategy:type_name -> deploy.builderd.v1.InitStrategy - 13, // 10: deploy.builderd.v1.MicroVMRootfs.runtime_config:type_name -> deploy.builderd.v1.RuntimeConfig - 14, // 11: deploy.builderd.v1.MicroVMRootfs.optimization:type_name -> deploy.builderd.v1.OptimizationSettings - 45, // 12: deploy.builderd.v1.RuntimeConfig.environment:type_name -> deploy.builderd.v1.RuntimeConfig.EnvironmentEntry - 16, // 13: deploy.builderd.v1.BuildStrategy.docker_extract:type_name -> deploy.builderd.v1.DockerExtractStrategy - 17, // 14: deploy.builderd.v1.BuildStrategy.go_api:type_name -> deploy.builderd.v1.GoApiStrategy - 18, // 15: deploy.builderd.v1.BuildStrategy.sinatra:type_name -> deploy.builderd.v1.SinatraStrategy - 19, // 16: deploy.builderd.v1.BuildStrategy.nodejs:type_name -> deploy.builderd.v1.NodejsStrategy - 46, // 17: deploy.builderd.v1.SinatraStrategy.rack_config:type_name -> deploy.builderd.v1.SinatraStrategy.RackConfigEntry - 3, // 18: deploy.builderd.v1.BuildConfig.tenant:type_name -> deploy.builderd.v1.TenantContext - 4, // 19: deploy.builderd.v1.BuildConfig.source:type_name -> deploy.builderd.v1.BuildSource - 10, // 20: deploy.builderd.v1.BuildConfig.target:type_name -> deploy.builderd.v1.BuildTarget - 15, // 21: deploy.builderd.v1.BuildConfig.strategy:type_name -> deploy.builderd.v1.BuildStrategy - 20, // 22: deploy.builderd.v1.BuildConfig.limits:type_name -> deploy.builderd.v1.TenantResourceLimits - 47, // 23: deploy.builderd.v1.BuildConfig.labels:type_name -> deploy.builderd.v1.BuildConfig.LabelsEntry - 48, // 24: deploy.builderd.v1.ImageMetadata.labels:type_name -> deploy.builderd.v1.ImageMetadata.LabelsEntry - 49, // 25: deploy.builderd.v1.ImageMetadata.env:type_name -> deploy.builderd.v1.ImageMetadata.EnvEntry - 21, // 26: deploy.builderd.v1.BuildJob.config:type_name -> deploy.builderd.v1.BuildConfig - 0, // 27: deploy.builderd.v1.BuildJob.state:type_name -> deploy.builderd.v1.BuildState - 51, // 28: deploy.builderd.v1.BuildJob.created_at:type_name -> google.protobuf.Timestamp - 51, // 29: deploy.builderd.v1.BuildJob.started_at:type_name -> google.protobuf.Timestamp - 51, // 30: deploy.builderd.v1.BuildJob.completed_at:type_name -> google.protobuf.Timestamp - 23, // 31: deploy.builderd.v1.BuildJob.image_metadata:type_name -> deploy.builderd.v1.ImageMetadata - 24, // 32: deploy.builderd.v1.BuildJob.metrics:type_name -> deploy.builderd.v1.BuildMetrics - 22, // 33: deploy.builderd.v1.BuildJob.isolation:type_name -> deploy.builderd.v1.BuildIsolation - 51, // 34: deploy.builderd.v1.StreamBuildLogsResponse.timestamp:type_name -> google.protobuf.Timestamp - 50, // 35: deploy.builderd.v1.StreamBuildLogsResponse.metadata:type_name -> deploy.builderd.v1.StreamBuildLogsResponse.MetadataEntry - 21, // 36: deploy.builderd.v1.CreateBuildRequest.config:type_name -> deploy.builderd.v1.BuildConfig - 0, // 37: deploy.builderd.v1.CreateBuildResponse.state:type_name -> deploy.builderd.v1.BuildState - 51, // 38: deploy.builderd.v1.CreateBuildResponse.created_at:type_name -> google.protobuf.Timestamp - 25, // 39: deploy.builderd.v1.GetBuildResponse.build:type_name -> deploy.builderd.v1.BuildJob - 0, // 40: deploy.builderd.v1.ListBuildsRequest.state_filter:type_name -> deploy.builderd.v1.BuildState - 25, // 41: deploy.builderd.v1.ListBuildsResponse.builds:type_name -> deploy.builderd.v1.BuildJob - 0, // 42: deploy.builderd.v1.CancelBuildResponse.state:type_name -> deploy.builderd.v1.BuildState - 20, // 43: deploy.builderd.v1.GetTenantQuotasResponse.current_limits:type_name -> deploy.builderd.v1.TenantResourceLimits - 27, // 44: deploy.builderd.v1.GetTenantQuotasResponse.current_usage:type_name -> deploy.builderd.v1.TenantUsageStats - 28, // 45: deploy.builderd.v1.GetTenantQuotasResponse.violations:type_name -> deploy.builderd.v1.QuotaViolation - 51, // 46: deploy.builderd.v1.GetBuildStatsRequest.start_time:type_name -> google.protobuf.Timestamp - 51, // 47: deploy.builderd.v1.GetBuildStatsRequest.end_time:type_name -> google.protobuf.Timestamp - 25, // 48: deploy.builderd.v1.GetBuildStatsResponse.recent_builds:type_name -> deploy.builderd.v1.BuildJob - 29, // 49: deploy.builderd.v1.BuilderService.CreateBuild:input_type -> deploy.builderd.v1.CreateBuildRequest - 31, // 50: deploy.builderd.v1.BuilderService.GetBuild:input_type -> deploy.builderd.v1.GetBuildRequest - 33, // 51: deploy.builderd.v1.BuilderService.ListBuilds:input_type -> deploy.builderd.v1.ListBuildsRequest - 35, // 52: deploy.builderd.v1.BuilderService.CancelBuild:input_type -> deploy.builderd.v1.CancelBuildRequest - 37, // 53: deploy.builderd.v1.BuilderService.DeleteBuild:input_type -> deploy.builderd.v1.DeleteBuildRequest - 39, // 54: deploy.builderd.v1.BuilderService.StreamBuildLogs:input_type -> deploy.builderd.v1.StreamBuildLogsRequest - 40, // 55: deploy.builderd.v1.BuilderService.GetTenantQuotas:input_type -> deploy.builderd.v1.GetTenantQuotasRequest - 42, // 56: deploy.builderd.v1.BuilderService.GetBuildStats:input_type -> deploy.builderd.v1.GetBuildStatsRequest - 30, // 57: deploy.builderd.v1.BuilderService.CreateBuild:output_type -> deploy.builderd.v1.CreateBuildResponse - 32, // 58: deploy.builderd.v1.BuilderService.GetBuild:output_type -> deploy.builderd.v1.GetBuildResponse - 34, // 59: deploy.builderd.v1.BuilderService.ListBuilds:output_type -> deploy.builderd.v1.ListBuildsResponse - 36, // 60: deploy.builderd.v1.BuilderService.CancelBuild:output_type -> deploy.builderd.v1.CancelBuildResponse - 38, // 61: deploy.builderd.v1.BuilderService.DeleteBuild:output_type -> deploy.builderd.v1.DeleteBuildResponse - 26, // 62: deploy.builderd.v1.BuilderService.StreamBuildLogs:output_type -> deploy.builderd.v1.StreamBuildLogsResponse - 41, // 63: deploy.builderd.v1.BuilderService.GetTenantQuotas:output_type -> deploy.builderd.v1.GetTenantQuotasResponse - 43, // 64: deploy.builderd.v1.BuilderService.GetBuildStats:output_type -> deploy.builderd.v1.GetBuildStatsResponse - 57, // [57:65] is the sub-list for method output_type - 49, // [49:57] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name + 4, // 0: deploy.builderd.v1.BuildSource.docker_image:type_name -> deploy.builderd.v1.DockerImageSource + 6, // 1: deploy.builderd.v1.BuildSource.git_repository:type_name -> deploy.builderd.v1.GitRepositorySource + 8, // 2: deploy.builderd.v1.BuildSource.archive:type_name -> deploy.builderd.v1.ArchiveSource + 5, // 3: deploy.builderd.v1.DockerImageSource.auth:type_name -> deploy.builderd.v1.DockerAuth + 7, // 4: deploy.builderd.v1.GitRepositorySource.auth:type_name -> deploy.builderd.v1.GitAuth + 10, // 5: deploy.builderd.v1.BuildTarget.microvm_rootfs:type_name -> deploy.builderd.v1.MicroVMRootfs + 11, // 6: deploy.builderd.v1.BuildTarget.container_image:type_name -> deploy.builderd.v1.ContainerImage + 2, // 7: deploy.builderd.v1.MicroVMRootfs.init_strategy:type_name -> deploy.builderd.v1.InitStrategy + 12, // 8: deploy.builderd.v1.MicroVMRootfs.runtime_config:type_name -> deploy.builderd.v1.RuntimeConfig + 13, // 9: deploy.builderd.v1.MicroVMRootfs.optimization:type_name -> deploy.builderd.v1.OptimizationSettings + 38, // 10: deploy.builderd.v1.RuntimeConfig.environment:type_name -> deploy.builderd.v1.RuntimeConfig.EnvironmentEntry + 15, // 11: deploy.builderd.v1.BuildStrategy.docker_extract:type_name -> deploy.builderd.v1.DockerExtractStrategy + 16, // 12: deploy.builderd.v1.BuildStrategy.go_api:type_name -> deploy.builderd.v1.GoApiStrategy + 17, // 13: deploy.builderd.v1.BuildStrategy.sinatra:type_name -> deploy.builderd.v1.SinatraStrategy + 18, // 14: deploy.builderd.v1.BuildStrategy.nodejs:type_name -> deploy.builderd.v1.NodejsStrategy + 39, // 15: deploy.builderd.v1.SinatraStrategy.rack_config:type_name -> deploy.builderd.v1.SinatraStrategy.RackConfigEntry + 3, // 16: deploy.builderd.v1.BuildConfig.source:type_name -> deploy.builderd.v1.BuildSource + 9, // 17: deploy.builderd.v1.BuildConfig.target:type_name -> deploy.builderd.v1.BuildTarget + 14, // 18: deploy.builderd.v1.BuildConfig.strategy:type_name -> deploy.builderd.v1.BuildStrategy + 40, // 19: deploy.builderd.v1.BuildConfig.labels:type_name -> deploy.builderd.v1.BuildConfig.LabelsEntry + 41, // 20: deploy.builderd.v1.ImageMetadata.labels:type_name -> deploy.builderd.v1.ImageMetadata.LabelsEntry + 42, // 21: deploy.builderd.v1.ImageMetadata.env:type_name -> deploy.builderd.v1.ImageMetadata.EnvEntry + 19, // 22: deploy.builderd.v1.BuildJob.config:type_name -> deploy.builderd.v1.BuildConfig + 0, // 23: deploy.builderd.v1.BuildJob.state:type_name -> deploy.builderd.v1.BuildState + 44, // 24: deploy.builderd.v1.BuildJob.created_at:type_name -> google.protobuf.Timestamp + 44, // 25: deploy.builderd.v1.BuildJob.started_at:type_name -> google.protobuf.Timestamp + 44, // 26: deploy.builderd.v1.BuildJob.completed_at:type_name -> google.protobuf.Timestamp + 21, // 27: deploy.builderd.v1.BuildJob.image_metadata:type_name -> deploy.builderd.v1.ImageMetadata + 22, // 28: deploy.builderd.v1.BuildJob.metrics:type_name -> deploy.builderd.v1.BuildMetrics + 20, // 29: deploy.builderd.v1.BuildJob.isolation:type_name -> deploy.builderd.v1.BuildIsolation + 44, // 30: deploy.builderd.v1.StreamBuildLogsResponse.timestamp:type_name -> google.protobuf.Timestamp + 43, // 31: deploy.builderd.v1.StreamBuildLogsResponse.metadata:type_name -> deploy.builderd.v1.StreamBuildLogsResponse.MetadataEntry + 19, // 32: deploy.builderd.v1.CreateBuildRequest.config:type_name -> deploy.builderd.v1.BuildConfig + 0, // 33: deploy.builderd.v1.CreateBuildResponse.state:type_name -> deploy.builderd.v1.BuildState + 44, // 34: deploy.builderd.v1.CreateBuildResponse.created_at:type_name -> google.protobuf.Timestamp + 23, // 35: deploy.builderd.v1.GetBuildResponse.build:type_name -> deploy.builderd.v1.BuildJob + 0, // 36: deploy.builderd.v1.ListBuildsRequest.state_filter:type_name -> deploy.builderd.v1.BuildState + 23, // 37: deploy.builderd.v1.ListBuildsResponse.builds:type_name -> deploy.builderd.v1.BuildJob + 0, // 38: deploy.builderd.v1.CancelBuildResponse.state:type_name -> deploy.builderd.v1.BuildState + 44, // 39: deploy.builderd.v1.GetBuildStatsRequest.start_time:type_name -> google.protobuf.Timestamp + 44, // 40: deploy.builderd.v1.GetBuildStatsRequest.end_time:type_name -> google.protobuf.Timestamp + 23, // 41: deploy.builderd.v1.GetBuildStatsResponse.recent_builds:type_name -> deploy.builderd.v1.BuildJob + 25, // 42: deploy.builderd.v1.BuilderService.CreateBuild:input_type -> deploy.builderd.v1.CreateBuildRequest + 27, // 43: deploy.builderd.v1.BuilderService.GetBuild:input_type -> deploy.builderd.v1.GetBuildRequest + 29, // 44: deploy.builderd.v1.BuilderService.ListBuilds:input_type -> deploy.builderd.v1.ListBuildsRequest + 31, // 45: deploy.builderd.v1.BuilderService.CancelBuild:input_type -> deploy.builderd.v1.CancelBuildRequest + 33, // 46: deploy.builderd.v1.BuilderService.DeleteBuild:input_type -> deploy.builderd.v1.DeleteBuildRequest + 35, // 47: deploy.builderd.v1.BuilderService.StreamBuildLogs:input_type -> deploy.builderd.v1.StreamBuildLogsRequest + 36, // 48: deploy.builderd.v1.BuilderService.GetBuildStats:input_type -> deploy.builderd.v1.GetBuildStatsRequest + 26, // 49: deploy.builderd.v1.BuilderService.CreateBuild:output_type -> deploy.builderd.v1.CreateBuildResponse + 28, // 50: deploy.builderd.v1.BuilderService.GetBuild:output_type -> deploy.builderd.v1.GetBuildResponse + 30, // 51: deploy.builderd.v1.BuilderService.ListBuilds:output_type -> deploy.builderd.v1.ListBuildsResponse + 32, // 52: deploy.builderd.v1.BuilderService.CancelBuild:output_type -> deploy.builderd.v1.CancelBuildResponse + 34, // 53: deploy.builderd.v1.BuilderService.DeleteBuild:output_type -> deploy.builderd.v1.DeleteBuildResponse + 24, // 54: deploy.builderd.v1.BuilderService.StreamBuildLogs:output_type -> deploy.builderd.v1.StreamBuildLogsResponse + 37, // 55: deploy.builderd.v1.BuilderService.GetBuildStats:output_type -> deploy.builderd.v1.GetBuildStatsResponse + 49, // [49:56] is the sub-list for method output_type + 42, // [42:49] is the sub-list for method input_type + 42, // [42:42] is the sub-list for extension type_name + 42, // [42:42] is the sub-list for extension extendee + 0, // [0:42] is the sub-list for field type_name } func init() { file_deploy_builderd_v1_builder_proto_init() } @@ -3792,16 +3166,16 @@ func file_deploy_builderd_v1_builder_proto_init() { if File_deploy_builderd_v1_builder_proto != nil { return } - file_deploy_builderd_v1_builder_proto_msgTypes[1].OneofWrappers = []any{ + file_deploy_builderd_v1_builder_proto_msgTypes[0].OneofWrappers = []any{ (*BuildSource_DockerImage)(nil), (*BuildSource_GitRepository)(nil), (*BuildSource_Archive)(nil), } - file_deploy_builderd_v1_builder_proto_msgTypes[7].OneofWrappers = []any{ + file_deploy_builderd_v1_builder_proto_msgTypes[6].OneofWrappers = []any{ (*BuildTarget_MicrovmRootfs)(nil), (*BuildTarget_ContainerImage)(nil), } - file_deploy_builderd_v1_builder_proto_msgTypes[12].OneofWrappers = []any{ + file_deploy_builderd_v1_builder_proto_msgTypes[11].OneofWrappers = []any{ (*BuildStrategy_DockerExtract)(nil), (*BuildStrategy_GoApi)(nil), (*BuildStrategy_Sinatra)(nil), @@ -3813,7 +3187,7 @@ func file_deploy_builderd_v1_builder_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_deploy_builderd_v1_builder_proto_rawDesc), len(file_deploy_builderd_v1_builder_proto_rawDesc)), NumEnums: 3, - NumMessages: 48, + NumMessages: 41, NumExtensions: 0, NumServices: 1, }, diff --git a/go/gen/proto/deploy/builderd/v1/builderdv1connect/builder.connect.go b/go/gen/proto/deploy/builderd/v1/builderdv1connect/builder.connect.go index 4025e1acaa..d9ccbff427 100644 --- a/go/gen/proto/deploy/builderd/v1/builderdv1connect/builder.connect.go +++ b/go/gen/proto/deploy/builderd/v1/builderdv1connect/builder.connect.go @@ -50,9 +50,6 @@ const ( // BuilderServiceStreamBuildLogsProcedure is the fully-qualified name of the BuilderService's // StreamBuildLogs RPC. BuilderServiceStreamBuildLogsProcedure = "/deploy.builderd.v1.BuilderService/StreamBuildLogs" - // BuilderServiceGetTenantQuotasProcedure is the fully-qualified name of the BuilderService's - // GetTenantQuotas RPC. - BuilderServiceGetTenantQuotasProcedure = "/deploy.builderd.v1.BuilderService/GetTenantQuotas" // BuilderServiceGetBuildStatsProcedure is the fully-qualified name of the BuilderService's // GetBuildStats RPC. BuilderServiceGetBuildStatsProcedure = "/deploy.builderd.v1.BuilderService/GetBuildStats" @@ -72,8 +69,6 @@ type BuilderServiceClient interface { DeleteBuild(context.Context, *connect.Request[v1.DeleteBuildRequest]) (*connect.Response[v1.DeleteBuildResponse], error) // Stream build logs in real-time StreamBuildLogs(context.Context, *connect.Request[v1.StreamBuildLogsRequest]) (*connect.ServerStreamForClient[v1.StreamBuildLogsResponse], error) - // Get tenant quotas and usage - GetTenantQuotas(context.Context, *connect.Request[v1.GetTenantQuotasRequest]) (*connect.Response[v1.GetTenantQuotasResponse], error) // Get build statistics GetBuildStats(context.Context, *connect.Request[v1.GetBuildStatsRequest]) (*connect.Response[v1.GetBuildStatsResponse], error) } @@ -125,12 +120,6 @@ func NewBuilderServiceClient(httpClient connect.HTTPClient, baseURL string, opts connect.WithSchema(builderServiceMethods.ByName("StreamBuildLogs")), connect.WithClientOptions(opts...), ), - getTenantQuotas: connect.NewClient[v1.GetTenantQuotasRequest, v1.GetTenantQuotasResponse]( - httpClient, - baseURL+BuilderServiceGetTenantQuotasProcedure, - connect.WithSchema(builderServiceMethods.ByName("GetTenantQuotas")), - connect.WithClientOptions(opts...), - ), getBuildStats: connect.NewClient[v1.GetBuildStatsRequest, v1.GetBuildStatsResponse]( httpClient, baseURL+BuilderServiceGetBuildStatsProcedure, @@ -148,7 +137,6 @@ type builderServiceClient struct { cancelBuild *connect.Client[v1.CancelBuildRequest, v1.CancelBuildResponse] deleteBuild *connect.Client[v1.DeleteBuildRequest, v1.DeleteBuildResponse] streamBuildLogs *connect.Client[v1.StreamBuildLogsRequest, v1.StreamBuildLogsResponse] - getTenantQuotas *connect.Client[v1.GetTenantQuotasRequest, v1.GetTenantQuotasResponse] getBuildStats *connect.Client[v1.GetBuildStatsRequest, v1.GetBuildStatsResponse] } @@ -182,11 +170,6 @@ func (c *builderServiceClient) StreamBuildLogs(ctx context.Context, req *connect return c.streamBuildLogs.CallServerStream(ctx, req) } -// GetTenantQuotas calls deploy.builderd.v1.BuilderService.GetTenantQuotas. -func (c *builderServiceClient) GetTenantQuotas(ctx context.Context, req *connect.Request[v1.GetTenantQuotasRequest]) (*connect.Response[v1.GetTenantQuotasResponse], error) { - return c.getTenantQuotas.CallUnary(ctx, req) -} - // GetBuildStats calls deploy.builderd.v1.BuilderService.GetBuildStats. func (c *builderServiceClient) GetBuildStats(ctx context.Context, req *connect.Request[v1.GetBuildStatsRequest]) (*connect.Response[v1.GetBuildStatsResponse], error) { return c.getBuildStats.CallUnary(ctx, req) @@ -206,8 +189,6 @@ type BuilderServiceHandler interface { DeleteBuild(context.Context, *connect.Request[v1.DeleteBuildRequest]) (*connect.Response[v1.DeleteBuildResponse], error) // Stream build logs in real-time StreamBuildLogs(context.Context, *connect.Request[v1.StreamBuildLogsRequest], *connect.ServerStream[v1.StreamBuildLogsResponse]) error - // Get tenant quotas and usage - GetTenantQuotas(context.Context, *connect.Request[v1.GetTenantQuotasRequest]) (*connect.Response[v1.GetTenantQuotasResponse], error) // Get build statistics GetBuildStats(context.Context, *connect.Request[v1.GetBuildStatsRequest]) (*connect.Response[v1.GetBuildStatsResponse], error) } @@ -255,12 +236,6 @@ func NewBuilderServiceHandler(svc BuilderServiceHandler, opts ...connect.Handler connect.WithSchema(builderServiceMethods.ByName("StreamBuildLogs")), connect.WithHandlerOptions(opts...), ) - builderServiceGetTenantQuotasHandler := connect.NewUnaryHandler( - BuilderServiceGetTenantQuotasProcedure, - svc.GetTenantQuotas, - connect.WithSchema(builderServiceMethods.ByName("GetTenantQuotas")), - connect.WithHandlerOptions(opts...), - ) builderServiceGetBuildStatsHandler := connect.NewUnaryHandler( BuilderServiceGetBuildStatsProcedure, svc.GetBuildStats, @@ -281,8 +256,6 @@ func NewBuilderServiceHandler(svc BuilderServiceHandler, opts ...connect.Handler builderServiceDeleteBuildHandler.ServeHTTP(w, r) case BuilderServiceStreamBuildLogsProcedure: builderServiceStreamBuildLogsHandler.ServeHTTP(w, r) - case BuilderServiceGetTenantQuotasProcedure: - builderServiceGetTenantQuotasHandler.ServeHTTP(w, r) case BuilderServiceGetBuildStatsProcedure: builderServiceGetBuildStatsHandler.ServeHTTP(w, r) default: @@ -318,10 +291,6 @@ func (UnimplementedBuilderServiceHandler) StreamBuildLogs(context.Context, *conn return connect.NewError(connect.CodeUnimplemented, errors.New("deploy.builderd.v1.BuilderService.StreamBuildLogs is not implemented")) } -func (UnimplementedBuilderServiceHandler) GetTenantQuotas(context.Context, *connect.Request[v1.GetTenantQuotasRequest]) (*connect.Response[v1.GetTenantQuotasResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("deploy.builderd.v1.BuilderService.GetTenantQuotas is not implemented")) -} - func (UnimplementedBuilderServiceHandler) GetBuildStats(context.Context, *connect.Request[v1.GetBuildStatsRequest]) (*connect.Response[v1.GetBuildStatsResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("deploy.builderd.v1.BuilderService.GetBuildStats is not implemented")) } diff --git a/go/gen/proto/metal/vmprovisioner/v1/vmprovisioner.pb.go b/go/gen/proto/metal/vmprovisioner/v1/vmprovisioner.pb.go index f349f0dc39..744b0d0ae1 100644 --- a/go/gen/proto/metal/vmprovisioner/v1/vmprovisioner.pb.go +++ b/go/gen/proto/metal/vmprovisioner/v1/vmprovisioner.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.7 +// protoc-gen-go v1.36.8 // protoc (unknown) -// source: proto/metal/vmprovisioner/v1/vmprovisioner.proto +// source: metal/vmprovisioner/v1/vmprovisioner.proto package vmprovisionerv1 @@ -61,11 +61,11 @@ func (x VmState) String() string { } func (VmState) Descriptor() protoreflect.EnumDescriptor { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[0].Descriptor() + return file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[0].Descriptor() } func (VmState) Type() protoreflect.EnumType { - return &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[0] + return &file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[0] } func (x VmState) Number() protoreflect.EnumNumber { @@ -74,7 +74,7 @@ func (x VmState) Number() protoreflect.EnumNumber { // Deprecated: Use VmState.Descriptor instead. func (VmState) EnumDescriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{0} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{0} } // Network mode for the interface @@ -114,11 +114,11 @@ func (x NetworkMode) String() string { } func (NetworkMode) Descriptor() protoreflect.EnumDescriptor { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[1].Descriptor() + return file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[1].Descriptor() } func (NetworkMode) Type() protoreflect.EnumType { - return &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[1] + return &file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes[1] } func (x NetworkMode) Number() protoreflect.EnumNumber { @@ -127,7 +127,7 @@ func (x NetworkMode) Number() protoreflect.EnumNumber { // Deprecated: Use NetworkMode.Descriptor instead. func (NetworkMode) EnumDescriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{1} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{1} } // Unified VM configuration that works across different hypervisors @@ -153,7 +153,7 @@ type VmConfig struct { func (x *VmConfig) Reset() { *x = VmConfig{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[0] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -165,7 +165,7 @@ func (x *VmConfig) String() string { func (*VmConfig) ProtoMessage() {} func (x *VmConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[0] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -178,7 +178,7 @@ func (x *VmConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use VmConfig.ProtoReflect.Descriptor instead. func (*VmConfig) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{0} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{0} } func (x *VmConfig) GetCpu() *CpuConfig { @@ -246,7 +246,7 @@ type CpuConfig struct { func (x *CpuConfig) Reset() { *x = CpuConfig{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[1] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -258,7 +258,7 @@ func (x *CpuConfig) String() string { func (*CpuConfig) ProtoMessage() {} func (x *CpuConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[1] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -271,7 +271,7 @@ func (x *CpuConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use CpuConfig.ProtoReflect.Descriptor instead. func (*CpuConfig) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{1} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{1} } func (x *CpuConfig) GetVcpuCount() int32 { @@ -313,7 +313,7 @@ type CpuTopology struct { func (x *CpuTopology) Reset() { *x = CpuTopology{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[2] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -325,7 +325,7 @@ func (x *CpuTopology) String() string { func (*CpuTopology) ProtoMessage() {} func (x *CpuTopology) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[2] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -338,7 +338,7 @@ func (x *CpuTopology) ProtoReflect() protoreflect.Message { // Deprecated: Use CpuTopology.ProtoReflect.Descriptor instead. func (*CpuTopology) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{2} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{2} } func (x *CpuTopology) GetSockets() int32 { @@ -378,7 +378,7 @@ type MemoryConfig struct { func (x *MemoryConfig) Reset() { *x = MemoryConfig{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[3] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -390,7 +390,7 @@ func (x *MemoryConfig) String() string { func (*MemoryConfig) ProtoMessage() {} func (x *MemoryConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[3] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -403,7 +403,7 @@ func (x *MemoryConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use MemoryConfig.ProtoReflect.Descriptor instead. func (*MemoryConfig) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{3} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{3} } func (x *MemoryConfig) GetSizeBytes() int64 { @@ -450,7 +450,7 @@ type BootConfig struct { func (x *BootConfig) Reset() { *x = BootConfig{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[4] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -462,7 +462,7 @@ func (x *BootConfig) String() string { func (*BootConfig) ProtoMessage() {} func (x *BootConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[4] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -475,7 +475,7 @@ func (x *BootConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use BootConfig.ProtoReflect.Descriptor instead. func (*BootConfig) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{4} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{4} } func (x *BootConfig) GetKernelPath() string { @@ -526,7 +526,7 @@ type StorageDevice struct { func (x *StorageDevice) Reset() { *x = StorageDevice{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[5] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -538,7 +538,7 @@ func (x *StorageDevice) String() string { func (*StorageDevice) ProtoMessage() {} func (x *StorageDevice) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[5] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -551,7 +551,7 @@ func (x *StorageDevice) ProtoReflect() protoreflect.Message { // Deprecated: Use StorageDevice.ProtoReflect.Descriptor instead. func (*StorageDevice) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{5} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{5} } func (x *StorageDevice) GetId() string { @@ -623,7 +623,7 @@ type NetworkInterface struct { func (x *NetworkInterface) Reset() { *x = NetworkInterface{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[6] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -635,7 +635,7 @@ func (x *NetworkInterface) String() string { func (*NetworkInterface) ProtoMessage() {} func (x *NetworkInterface) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[6] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -648,7 +648,7 @@ func (x *NetworkInterface) ProtoReflect() protoreflect.Message { // Deprecated: Use NetworkInterface.ProtoReflect.Descriptor instead. func (*NetworkInterface) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{6} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{6} } func (x *NetworkInterface) GetId() string { @@ -735,7 +735,7 @@ type IPv4Config struct { func (x *IPv4Config) Reset() { *x = IPv4Config{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[7] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -747,7 +747,7 @@ func (x *IPv4Config) String() string { func (*IPv4Config) ProtoMessage() {} func (x *IPv4Config) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[7] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -760,7 +760,7 @@ func (x *IPv4Config) ProtoReflect() protoreflect.Message { // Deprecated: Use IPv4Config.ProtoReflect.Descriptor instead. func (*IPv4Config) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{7} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{7} } func (x *IPv4Config) GetAddress() string { @@ -814,7 +814,7 @@ type IPv6Config struct { func (x *IPv6Config) Reset() { *x = IPv6Config{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[8] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -826,7 +826,7 @@ func (x *IPv6Config) String() string { func (*IPv6Config) ProtoMessage() {} func (x *IPv6Config) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[8] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -839,7 +839,7 @@ func (x *IPv6Config) ProtoReflect() protoreflect.Message { // Deprecated: Use IPv6Config.ProtoReflect.Descriptor instead. func (*IPv6Config) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{8} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{8} } func (x *IPv6Config) GetAddress() string { @@ -903,7 +903,7 @@ type RateLimit struct { func (x *RateLimit) Reset() { *x = RateLimit{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[9] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -915,7 +915,7 @@ func (x *RateLimit) String() string { func (*RateLimit) ProtoMessage() {} func (x *RateLimit) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[9] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -928,7 +928,7 @@ func (x *RateLimit) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimit.ProtoReflect.Descriptor instead. func (*RateLimit) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{9} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{9} } func (x *RateLimit) GetBandwidth() int64 { @@ -968,7 +968,7 @@ type ConsoleConfig struct { func (x *ConsoleConfig) Reset() { *x = ConsoleConfig{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[10] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -980,7 +980,7 @@ func (x *ConsoleConfig) String() string { func (*ConsoleConfig) ProtoMessage() {} func (x *ConsoleConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[10] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -993,7 +993,7 @@ func (x *ConsoleConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ConsoleConfig.ProtoReflect.Descriptor instead. func (*ConsoleConfig) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{10} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{10} } func (x *ConsoleConfig) GetEnabled() bool { @@ -1039,7 +1039,7 @@ type CreateVmRequest struct { func (x *CreateVmRequest) Reset() { *x = CreateVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[11] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1051,7 +1051,7 @@ func (x *CreateVmRequest) String() string { func (*CreateVmRequest) ProtoMessage() {} func (x *CreateVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[11] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1064,7 +1064,7 @@ func (x *CreateVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateVmRequest.ProtoReflect.Descriptor instead. func (*CreateVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{11} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{11} } func (x *CreateVmRequest) GetVmId() string { @@ -1100,7 +1100,7 @@ type CreateVmResponse struct { func (x *CreateVmResponse) Reset() { *x = CreateVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[12] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1112,7 +1112,7 @@ func (x *CreateVmResponse) String() string { func (*CreateVmResponse) ProtoMessage() {} func (x *CreateVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[12] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1125,7 +1125,7 @@ func (x *CreateVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateVmResponse.ProtoReflect.Descriptor instead. func (*CreateVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{12} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{12} } func (x *CreateVmResponse) GetVmId() string { @@ -1153,7 +1153,7 @@ type DeleteVmRequest struct { func (x *DeleteVmRequest) Reset() { *x = DeleteVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[13] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1165,7 +1165,7 @@ func (x *DeleteVmRequest) String() string { func (*DeleteVmRequest) ProtoMessage() {} func (x *DeleteVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[13] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1178,7 +1178,7 @@ func (x *DeleteVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteVmRequest.ProtoReflect.Descriptor instead. func (*DeleteVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{13} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{13} } func (x *DeleteVmRequest) GetVmId() string { @@ -1204,7 +1204,7 @@ type DeleteVmResponse struct { func (x *DeleteVmResponse) Reset() { *x = DeleteVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[14] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1216,7 +1216,7 @@ func (x *DeleteVmResponse) String() string { func (*DeleteVmResponse) ProtoMessage() {} func (x *DeleteVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[14] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1229,7 +1229,7 @@ func (x *DeleteVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteVmResponse.ProtoReflect.Descriptor instead. func (*DeleteVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{14} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{14} } func (x *DeleteVmResponse) GetSuccess() bool { @@ -1248,7 +1248,7 @@ type BootVmRequest struct { func (x *BootVmRequest) Reset() { *x = BootVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[15] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1260,7 +1260,7 @@ func (x *BootVmRequest) String() string { func (*BootVmRequest) ProtoMessage() {} func (x *BootVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[15] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1273,7 +1273,7 @@ func (x *BootVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BootVmRequest.ProtoReflect.Descriptor instead. func (*BootVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{15} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{15} } func (x *BootVmRequest) GetVmId() string { @@ -1293,7 +1293,7 @@ type BootVmResponse struct { func (x *BootVmResponse) Reset() { *x = BootVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[16] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1305,7 +1305,7 @@ func (x *BootVmResponse) String() string { func (*BootVmResponse) ProtoMessage() {} func (x *BootVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[16] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1318,7 +1318,7 @@ func (x *BootVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BootVmResponse.ProtoReflect.Descriptor instead. func (*BootVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{16} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{16} } func (x *BootVmResponse) GetSuccess() bool { @@ -1348,7 +1348,7 @@ type ShutdownVmRequest struct { func (x *ShutdownVmRequest) Reset() { *x = ShutdownVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[17] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1360,7 +1360,7 @@ func (x *ShutdownVmRequest) String() string { func (*ShutdownVmRequest) ProtoMessage() {} func (x *ShutdownVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[17] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1373,7 +1373,7 @@ func (x *ShutdownVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ShutdownVmRequest.ProtoReflect.Descriptor instead. func (*ShutdownVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{17} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{17} } func (x *ShutdownVmRequest) GetVmId() string { @@ -1407,7 +1407,7 @@ type ShutdownVmResponse struct { func (x *ShutdownVmResponse) Reset() { *x = ShutdownVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[18] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1419,7 +1419,7 @@ func (x *ShutdownVmResponse) String() string { func (*ShutdownVmResponse) ProtoMessage() {} func (x *ShutdownVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[18] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1432,7 +1432,7 @@ func (x *ShutdownVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ShutdownVmResponse.ProtoReflect.Descriptor instead. func (*ShutdownVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{18} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{18} } func (x *ShutdownVmResponse) GetSuccess() bool { @@ -1458,7 +1458,7 @@ type PauseVmRequest struct { func (x *PauseVmRequest) Reset() { *x = PauseVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[19] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1470,7 +1470,7 @@ func (x *PauseVmRequest) String() string { func (*PauseVmRequest) ProtoMessage() {} func (x *PauseVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[19] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1483,7 +1483,7 @@ func (x *PauseVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PauseVmRequest.ProtoReflect.Descriptor instead. func (*PauseVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{19} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{19} } func (x *PauseVmRequest) GetVmId() string { @@ -1503,7 +1503,7 @@ type PauseVmResponse struct { func (x *PauseVmResponse) Reset() { *x = PauseVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[20] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1515,7 +1515,7 @@ func (x *PauseVmResponse) String() string { func (*PauseVmResponse) ProtoMessage() {} func (x *PauseVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[20] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1528,7 +1528,7 @@ func (x *PauseVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PauseVmResponse.ProtoReflect.Descriptor instead. func (*PauseVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{20} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{20} } func (x *PauseVmResponse) GetSuccess() bool { @@ -1554,7 +1554,7 @@ type ResumeVmRequest struct { func (x *ResumeVmRequest) Reset() { *x = ResumeVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[21] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1566,7 +1566,7 @@ func (x *ResumeVmRequest) String() string { func (*ResumeVmRequest) ProtoMessage() {} func (x *ResumeVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[21] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1579,7 +1579,7 @@ func (x *ResumeVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResumeVmRequest.ProtoReflect.Descriptor instead. func (*ResumeVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{21} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{21} } func (x *ResumeVmRequest) GetVmId() string { @@ -1599,7 +1599,7 @@ type ResumeVmResponse struct { func (x *ResumeVmResponse) Reset() { *x = ResumeVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[22] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1611,7 +1611,7 @@ func (x *ResumeVmResponse) String() string { func (*ResumeVmResponse) ProtoMessage() {} func (x *ResumeVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[22] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1624,7 +1624,7 @@ func (x *ResumeVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResumeVmResponse.ProtoReflect.Descriptor instead. func (*ResumeVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{22} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{22} } func (x *ResumeVmResponse) GetSuccess() bool { @@ -1652,7 +1652,7 @@ type RebootVmRequest struct { func (x *RebootVmRequest) Reset() { *x = RebootVmRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[23] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1664,7 +1664,7 @@ func (x *RebootVmRequest) String() string { func (*RebootVmRequest) ProtoMessage() {} func (x *RebootVmRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[23] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1677,7 +1677,7 @@ func (x *RebootVmRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RebootVmRequest.ProtoReflect.Descriptor instead. func (*RebootVmRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{23} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{23} } func (x *RebootVmRequest) GetVmId() string { @@ -1704,7 +1704,7 @@ type RebootVmResponse struct { func (x *RebootVmResponse) Reset() { *x = RebootVmResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[24] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1716,7 +1716,7 @@ func (x *RebootVmResponse) String() string { func (*RebootVmResponse) ProtoMessage() {} func (x *RebootVmResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[24] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1729,7 +1729,7 @@ func (x *RebootVmResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RebootVmResponse.ProtoReflect.Descriptor instead. func (*RebootVmResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{24} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{24} } func (x *RebootVmResponse) GetSuccess() bool { @@ -1755,7 +1755,7 @@ type GetVmInfoRequest struct { func (x *GetVmInfoRequest) Reset() { *x = GetVmInfoRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[25] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1767,7 +1767,7 @@ func (x *GetVmInfoRequest) String() string { func (*GetVmInfoRequest) ProtoMessage() {} func (x *GetVmInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[25] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1780,7 +1780,7 @@ func (x *GetVmInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetVmInfoRequest.ProtoReflect.Descriptor instead. func (*GetVmInfoRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{25} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{25} } func (x *GetVmInfoRequest) GetVmId() string { @@ -1806,7 +1806,7 @@ type GetVmInfoResponse struct { func (x *GetVmInfoResponse) Reset() { *x = GetVmInfoResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[26] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1818,7 +1818,7 @@ func (x *GetVmInfoResponse) String() string { func (*GetVmInfoResponse) ProtoMessage() {} func (x *GetVmInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[26] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1831,7 +1831,7 @@ func (x *GetVmInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetVmInfoResponse.ProtoReflect.Descriptor instead. func (*GetVmInfoResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{26} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{26} } func (x *GetVmInfoResponse) GetVmId() string { @@ -1888,7 +1888,7 @@ type PortMapping struct { func (x *PortMapping) Reset() { *x = PortMapping{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[27] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1900,7 +1900,7 @@ func (x *PortMapping) String() string { func (*PortMapping) ProtoMessage() {} func (x *PortMapping) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[27] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1913,7 +1913,7 @@ func (x *PortMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use PortMapping.ProtoReflect.Descriptor instead. func (*PortMapping) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{27} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{27} } func (x *PortMapping) GetContainerPort() int32 { @@ -1953,7 +1953,7 @@ type VmNetworkInfo struct { func (x *VmNetworkInfo) Reset() { *x = VmNetworkInfo{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[28] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1965,7 +1965,7 @@ func (x *VmNetworkInfo) String() string { func (*VmNetworkInfo) ProtoMessage() {} func (x *VmNetworkInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[28] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1978,7 +1978,7 @@ func (x *VmNetworkInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use VmNetworkInfo.ProtoReflect.Descriptor instead. func (*VmNetworkInfo) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{28} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{28} } func (x *VmNetworkInfo) GetIpAddress() string { @@ -2048,7 +2048,7 @@ type VmMetrics struct { func (x *VmMetrics) Reset() { *x = VmMetrics{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[29] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2060,7 +2060,7 @@ func (x *VmMetrics) String() string { func (*VmMetrics) ProtoMessage() {} func (x *VmMetrics) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[29] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2073,7 +2073,7 @@ func (x *VmMetrics) ProtoReflect() protoreflect.Message { // Deprecated: Use VmMetrics.ProtoReflect.Descriptor instead. func (*VmMetrics) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{29} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{29} } func (x *VmMetrics) GetCpuUsagePercent() float64 { @@ -2123,7 +2123,7 @@ type NetworkStats struct { func (x *NetworkStats) Reset() { *x = NetworkStats{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[30] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2135,7 +2135,7 @@ func (x *NetworkStats) String() string { func (*NetworkStats) ProtoMessage() {} func (x *NetworkStats) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[30] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2148,7 +2148,7 @@ func (x *NetworkStats) ProtoReflect() protoreflect.Message { // Deprecated: Use NetworkStats.ProtoReflect.Descriptor instead. func (*NetworkStats) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{30} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{30} } func (x *NetworkStats) GetBytesReceived() int64 { @@ -2191,7 +2191,7 @@ type StorageStats struct { func (x *StorageStats) Reset() { *x = StorageStats{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[31] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2203,7 +2203,7 @@ func (x *StorageStats) String() string { func (*StorageStats) ProtoMessage() {} func (x *StorageStats) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[31] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2216,7 +2216,7 @@ func (x *StorageStats) ProtoReflect() protoreflect.Message { // Deprecated: Use StorageStats.ProtoReflect.Descriptor instead. func (*StorageStats) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{31} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{31} } func (x *StorageStats) GetBytesRead() int64 { @@ -2260,7 +2260,7 @@ type ListVmsRequest struct { func (x *ListVmsRequest) Reset() { *x = ListVmsRequest{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[32] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2272,7 +2272,7 @@ func (x *ListVmsRequest) String() string { func (*ListVmsRequest) ProtoMessage() {} func (x *ListVmsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[32] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2285,7 +2285,7 @@ func (x *ListVmsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListVmsRequest.ProtoReflect.Descriptor instead. func (*ListVmsRequest) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{32} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{32} } func (x *ListVmsRequest) GetStateFilter() []VmState { @@ -2320,7 +2320,7 @@ type ListVmsResponse struct { func (x *ListVmsResponse) Reset() { *x = ListVmsResponse{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[33] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2332,7 +2332,7 @@ func (x *ListVmsResponse) String() string { func (*ListVmsResponse) ProtoMessage() {} func (x *ListVmsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[33] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2345,7 +2345,7 @@ func (x *ListVmsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListVmsResponse.ProtoReflect.Descriptor instead. func (*ListVmsResponse) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{33} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{33} } func (x *ListVmsResponse) GetVms() []*VmInfo { @@ -2389,7 +2389,7 @@ type VmInfo struct { func (x *VmInfo) Reset() { *x = VmInfo{} - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[34] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2401,7 +2401,7 @@ func (x *VmInfo) String() string { func (*VmInfo) ProtoMessage() {} func (x *VmInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[34] + mi := &file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2414,7 +2414,7 @@ func (x *VmInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use VmInfo.ProtoReflect.Descriptor instead. func (*VmInfo) Descriptor() ([]byte, []int) { - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{34} + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP(), []int{34} } func (x *VmInfo) GetVmId() string { @@ -2473,11 +2473,11 @@ func (x *VmInfo) GetCustomerId() string { return "" } -var File_proto_metal_vmprovisioner_v1_vmprovisioner_proto protoreflect.FileDescriptor +var File_metal_vmprovisioner_v1_vmprovisioner_proto protoreflect.FileDescriptor -const file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc = "" + +const file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc = "" + "\n" + - "0proto/metal/vmprovisioner/v1/vmprovisioner.proto\x12\x16metal.vmprovisioner.v1\"\x84\x04\n" + + "*metal/vmprovisioner/v1/vmprovisioner.proto\x12\x16metal.vmprovisioner.v1\"\x84\x04\n" + "\bVmConfig\x123\n" + "\x03cpu\x18\x01 \x01(\v2!.metal.vmprovisioner.v1.CpuConfigR\x03cpu\x12<\n" + "\x06memory\x18\x02 \x01(\v2$.metal.vmprovisioner.v1.MemoryConfigR\x06memory\x126\n" + @@ -2715,20 +2715,20 @@ const file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc = "" + "\aListVms\x12&.metal.vmprovisioner.v1.ListVmsRequest\x1a'.metal.vmprovisioner.v1.ListVmsResponseBNZLgithub.com/unkeyed/unkey/go/gen/proto/metal/vmprovisioner/v1;vmprovisionerv1b\x06proto3" var ( - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescOnce sync.Once - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData []byte + file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescOnce sync.Once + file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData []byte ) -func file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP() []byte { - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescOnce.Do(func() { - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc), len(file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc))) +func file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescGZIP() []byte { + file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescOnce.Do(func() { + file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc), len(file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc))) }) - return file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData + return file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDescData } -var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes = make([]protoimpl.MessageInfo, 43) -var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes = []any{ +var file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes = []any{ (VmState)(0), // 0: metal.vmprovisioner.v1.VmState (NetworkMode)(0), // 1: metal.vmprovisioner.v1.NetworkMode (*VmConfig)(nil), // 2: metal.vmprovisioner.v1.VmConfig @@ -2775,7 +2775,7 @@ var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes = []any{ nil, // 43: metal.vmprovisioner.v1.GetVmInfoResponse.BackendInfoEntry nil, // 44: metal.vmprovisioner.v1.VmInfo.MetadataEntry } -var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs = []int32{ +var file_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs = []int32{ 3, // 0: metal.vmprovisioner.v1.VmConfig.cpu:type_name -> metal.vmprovisioner.v1.CpuConfig 5, // 1: metal.vmprovisioner.v1.VmConfig.memory:type_name -> metal.vmprovisioner.v1.MemoryConfig 6, // 2: metal.vmprovisioner.v1.VmConfig.boot:type_name -> metal.vmprovisioner.v1.BootConfig @@ -2838,27 +2838,27 @@ var file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs = []int32{ 0, // [0:37] is the sub-list for field type_name } -func init() { file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_init() } -func file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_init() { - if File_proto_metal_vmprovisioner_v1_vmprovisioner_proto != nil { +func init() { file_metal_vmprovisioner_v1_vmprovisioner_proto_init() } +func file_metal_vmprovisioner_v1_vmprovisioner_proto_init() { + if File_metal_vmprovisioner_v1_vmprovisioner_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc), len(file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc), len(file_metal_vmprovisioner_v1_vmprovisioner_proto_rawDesc)), NumEnums: 2, NumMessages: 43, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes, - DependencyIndexes: file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs, - EnumInfos: file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes, - MessageInfos: file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes, + GoTypes: file_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes, + DependencyIndexes: file_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs, + EnumInfos: file_metal_vmprovisioner_v1_vmprovisioner_proto_enumTypes, + MessageInfos: file_metal_vmprovisioner_v1_vmprovisioner_proto_msgTypes, }.Build() - File_proto_metal_vmprovisioner_v1_vmprovisioner_proto = out.File - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes = nil - file_proto_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs = nil + File_metal_vmprovisioner_v1_vmprovisioner_proto = out.File + file_metal_vmprovisioner_v1_vmprovisioner_proto_goTypes = nil + file_metal_vmprovisioner_v1_vmprovisioner_proto_depIdxs = nil } diff --git a/go/gen/proto/metal/vmprovisioner/v1/vmprovisionerv1connect/vmprovisioner.connect.go b/go/gen/proto/metal/vmprovisioner/v1/vmprovisionerv1connect/vmprovisioner.connect.go new file mode 100644 index 0000000000..43fdc2aea1 --- /dev/null +++ b/go/gen/proto/metal/vmprovisioner/v1/vmprovisionerv1connect/vmprovisioner.connect.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: metal/vmprovisioner/v1/vmprovisioner.proto + +package vmprovisionerv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/unkeyed/unkey/go/gen/proto/metal/vmprovisioner/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // VmServiceName is the fully-qualified name of the VmService service. + VmServiceName = "metal.vmprovisioner.v1.VmService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // VmServiceCreateVmProcedure is the fully-qualified name of the VmService's CreateVm RPC. + VmServiceCreateVmProcedure = "/metal.vmprovisioner.v1.VmService/CreateVm" + // VmServiceDeleteVmProcedure is the fully-qualified name of the VmService's DeleteVm RPC. + VmServiceDeleteVmProcedure = "/metal.vmprovisioner.v1.VmService/DeleteVm" + // VmServiceBootVmProcedure is the fully-qualified name of the VmService's BootVm RPC. + VmServiceBootVmProcedure = "/metal.vmprovisioner.v1.VmService/BootVm" + // VmServiceShutdownVmProcedure is the fully-qualified name of the VmService's ShutdownVm RPC. + VmServiceShutdownVmProcedure = "/metal.vmprovisioner.v1.VmService/ShutdownVm" + // VmServicePauseVmProcedure is the fully-qualified name of the VmService's PauseVm RPC. + VmServicePauseVmProcedure = "/metal.vmprovisioner.v1.VmService/PauseVm" + // VmServiceResumeVmProcedure is the fully-qualified name of the VmService's ResumeVm RPC. + VmServiceResumeVmProcedure = "/metal.vmprovisioner.v1.VmService/ResumeVm" + // VmServiceRebootVmProcedure is the fully-qualified name of the VmService's RebootVm RPC. + VmServiceRebootVmProcedure = "/metal.vmprovisioner.v1.VmService/RebootVm" + // VmServiceGetVmInfoProcedure is the fully-qualified name of the VmService's GetVmInfo RPC. + VmServiceGetVmInfoProcedure = "/metal.vmprovisioner.v1.VmService/GetVmInfo" + // VmServiceListVmsProcedure is the fully-qualified name of the VmService's ListVms RPC. + VmServiceListVmsProcedure = "/metal.vmprovisioner.v1.VmService/ListVms" +) + +// VmServiceClient is a client for the metal.vmprovisioner.v1.VmService service. +type VmServiceClient interface { + // CreateVm creates a new virtual machine instance + CreateVm(context.Context, *connect.Request[v1.CreateVmRequest]) (*connect.Response[v1.CreateVmResponse], error) + // DeleteVm removes a virtual machine instance + DeleteVm(context.Context, *connect.Request[v1.DeleteVmRequest]) (*connect.Response[v1.DeleteVmResponse], error) + // BootVm starts a created virtual machine + BootVm(context.Context, *connect.Request[v1.BootVmRequest]) (*connect.Response[v1.BootVmResponse], error) + // ShutdownVm gracefully stops a running virtual machine + ShutdownVm(context.Context, *connect.Request[v1.ShutdownVmRequest]) (*connect.Response[v1.ShutdownVmResponse], error) + // PauseVm pauses a running virtual machine + PauseVm(context.Context, *connect.Request[v1.PauseVmRequest]) (*connect.Response[v1.PauseVmResponse], error) + // ResumeVm resumes a paused virtual machine + ResumeVm(context.Context, *connect.Request[v1.ResumeVmRequest]) (*connect.Response[v1.ResumeVmResponse], error) + // RebootVm restarts a running virtual machine + RebootVm(context.Context, *connect.Request[v1.RebootVmRequest]) (*connect.Response[v1.RebootVmResponse], error) + // GetVmInfo retrieves virtual machine status and configuration + GetVmInfo(context.Context, *connect.Request[v1.GetVmInfoRequest]) (*connect.Response[v1.GetVmInfoResponse], error) + // ListVms lists all virtual machines managed by this service + ListVms(context.Context, *connect.Request[v1.ListVmsRequest]) (*connect.Response[v1.ListVmsResponse], error) +} + +// NewVmServiceClient constructs a client for the metal.vmprovisioner.v1.VmService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewVmServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VmServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + vmServiceMethods := v1.File_metal_vmprovisioner_v1_vmprovisioner_proto.Services().ByName("VmService").Methods() + return &vmServiceClient{ + createVm: connect.NewClient[v1.CreateVmRequest, v1.CreateVmResponse]( + httpClient, + baseURL+VmServiceCreateVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("CreateVm")), + connect.WithClientOptions(opts...), + ), + deleteVm: connect.NewClient[v1.DeleteVmRequest, v1.DeleteVmResponse]( + httpClient, + baseURL+VmServiceDeleteVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("DeleteVm")), + connect.WithClientOptions(opts...), + ), + bootVm: connect.NewClient[v1.BootVmRequest, v1.BootVmResponse]( + httpClient, + baseURL+VmServiceBootVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("BootVm")), + connect.WithClientOptions(opts...), + ), + shutdownVm: connect.NewClient[v1.ShutdownVmRequest, v1.ShutdownVmResponse]( + httpClient, + baseURL+VmServiceShutdownVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("ShutdownVm")), + connect.WithClientOptions(opts...), + ), + pauseVm: connect.NewClient[v1.PauseVmRequest, v1.PauseVmResponse]( + httpClient, + baseURL+VmServicePauseVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("PauseVm")), + connect.WithClientOptions(opts...), + ), + resumeVm: connect.NewClient[v1.ResumeVmRequest, v1.ResumeVmResponse]( + httpClient, + baseURL+VmServiceResumeVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("ResumeVm")), + connect.WithClientOptions(opts...), + ), + rebootVm: connect.NewClient[v1.RebootVmRequest, v1.RebootVmResponse]( + httpClient, + baseURL+VmServiceRebootVmProcedure, + connect.WithSchema(vmServiceMethods.ByName("RebootVm")), + connect.WithClientOptions(opts...), + ), + getVmInfo: connect.NewClient[v1.GetVmInfoRequest, v1.GetVmInfoResponse]( + httpClient, + baseURL+VmServiceGetVmInfoProcedure, + connect.WithSchema(vmServiceMethods.ByName("GetVmInfo")), + connect.WithClientOptions(opts...), + ), + listVms: connect.NewClient[v1.ListVmsRequest, v1.ListVmsResponse]( + httpClient, + baseURL+VmServiceListVmsProcedure, + connect.WithSchema(vmServiceMethods.ByName("ListVms")), + connect.WithClientOptions(opts...), + ), + } +} + +// vmServiceClient implements VmServiceClient. +type vmServiceClient struct { + createVm *connect.Client[v1.CreateVmRequest, v1.CreateVmResponse] + deleteVm *connect.Client[v1.DeleteVmRequest, v1.DeleteVmResponse] + bootVm *connect.Client[v1.BootVmRequest, v1.BootVmResponse] + shutdownVm *connect.Client[v1.ShutdownVmRequest, v1.ShutdownVmResponse] + pauseVm *connect.Client[v1.PauseVmRequest, v1.PauseVmResponse] + resumeVm *connect.Client[v1.ResumeVmRequest, v1.ResumeVmResponse] + rebootVm *connect.Client[v1.RebootVmRequest, v1.RebootVmResponse] + getVmInfo *connect.Client[v1.GetVmInfoRequest, v1.GetVmInfoResponse] + listVms *connect.Client[v1.ListVmsRequest, v1.ListVmsResponse] +} + +// CreateVm calls metal.vmprovisioner.v1.VmService.CreateVm. +func (c *vmServiceClient) CreateVm(ctx context.Context, req *connect.Request[v1.CreateVmRequest]) (*connect.Response[v1.CreateVmResponse], error) { + return c.createVm.CallUnary(ctx, req) +} + +// DeleteVm calls metal.vmprovisioner.v1.VmService.DeleteVm. +func (c *vmServiceClient) DeleteVm(ctx context.Context, req *connect.Request[v1.DeleteVmRequest]) (*connect.Response[v1.DeleteVmResponse], error) { + return c.deleteVm.CallUnary(ctx, req) +} + +// BootVm calls metal.vmprovisioner.v1.VmService.BootVm. +func (c *vmServiceClient) BootVm(ctx context.Context, req *connect.Request[v1.BootVmRequest]) (*connect.Response[v1.BootVmResponse], error) { + return c.bootVm.CallUnary(ctx, req) +} + +// ShutdownVm calls metal.vmprovisioner.v1.VmService.ShutdownVm. +func (c *vmServiceClient) ShutdownVm(ctx context.Context, req *connect.Request[v1.ShutdownVmRequest]) (*connect.Response[v1.ShutdownVmResponse], error) { + return c.shutdownVm.CallUnary(ctx, req) +} + +// PauseVm calls metal.vmprovisioner.v1.VmService.PauseVm. +func (c *vmServiceClient) PauseVm(ctx context.Context, req *connect.Request[v1.PauseVmRequest]) (*connect.Response[v1.PauseVmResponse], error) { + return c.pauseVm.CallUnary(ctx, req) +} + +// ResumeVm calls metal.vmprovisioner.v1.VmService.ResumeVm. +func (c *vmServiceClient) ResumeVm(ctx context.Context, req *connect.Request[v1.ResumeVmRequest]) (*connect.Response[v1.ResumeVmResponse], error) { + return c.resumeVm.CallUnary(ctx, req) +} + +// RebootVm calls metal.vmprovisioner.v1.VmService.RebootVm. +func (c *vmServiceClient) RebootVm(ctx context.Context, req *connect.Request[v1.RebootVmRequest]) (*connect.Response[v1.RebootVmResponse], error) { + return c.rebootVm.CallUnary(ctx, req) +} + +// GetVmInfo calls metal.vmprovisioner.v1.VmService.GetVmInfo. +func (c *vmServiceClient) GetVmInfo(ctx context.Context, req *connect.Request[v1.GetVmInfoRequest]) (*connect.Response[v1.GetVmInfoResponse], error) { + return c.getVmInfo.CallUnary(ctx, req) +} + +// ListVms calls metal.vmprovisioner.v1.VmService.ListVms. +func (c *vmServiceClient) ListVms(ctx context.Context, req *connect.Request[v1.ListVmsRequest]) (*connect.Response[v1.ListVmsResponse], error) { + return c.listVms.CallUnary(ctx, req) +} + +// VmServiceHandler is an implementation of the metal.vmprovisioner.v1.VmService service. +type VmServiceHandler interface { + // CreateVm creates a new virtual machine instance + CreateVm(context.Context, *connect.Request[v1.CreateVmRequest]) (*connect.Response[v1.CreateVmResponse], error) + // DeleteVm removes a virtual machine instance + DeleteVm(context.Context, *connect.Request[v1.DeleteVmRequest]) (*connect.Response[v1.DeleteVmResponse], error) + // BootVm starts a created virtual machine + BootVm(context.Context, *connect.Request[v1.BootVmRequest]) (*connect.Response[v1.BootVmResponse], error) + // ShutdownVm gracefully stops a running virtual machine + ShutdownVm(context.Context, *connect.Request[v1.ShutdownVmRequest]) (*connect.Response[v1.ShutdownVmResponse], error) + // PauseVm pauses a running virtual machine + PauseVm(context.Context, *connect.Request[v1.PauseVmRequest]) (*connect.Response[v1.PauseVmResponse], error) + // ResumeVm resumes a paused virtual machine + ResumeVm(context.Context, *connect.Request[v1.ResumeVmRequest]) (*connect.Response[v1.ResumeVmResponse], error) + // RebootVm restarts a running virtual machine + RebootVm(context.Context, *connect.Request[v1.RebootVmRequest]) (*connect.Response[v1.RebootVmResponse], error) + // GetVmInfo retrieves virtual machine status and configuration + GetVmInfo(context.Context, *connect.Request[v1.GetVmInfoRequest]) (*connect.Response[v1.GetVmInfoResponse], error) + // ListVms lists all virtual machines managed by this service + ListVms(context.Context, *connect.Request[v1.ListVmsRequest]) (*connect.Response[v1.ListVmsResponse], error) +} + +// NewVmServiceHandler builds an HTTP handler from the service implementation. It returns the path +// on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewVmServiceHandler(svc VmServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + vmServiceMethods := v1.File_metal_vmprovisioner_v1_vmprovisioner_proto.Services().ByName("VmService").Methods() + vmServiceCreateVmHandler := connect.NewUnaryHandler( + VmServiceCreateVmProcedure, + svc.CreateVm, + connect.WithSchema(vmServiceMethods.ByName("CreateVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceDeleteVmHandler := connect.NewUnaryHandler( + VmServiceDeleteVmProcedure, + svc.DeleteVm, + connect.WithSchema(vmServiceMethods.ByName("DeleteVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceBootVmHandler := connect.NewUnaryHandler( + VmServiceBootVmProcedure, + svc.BootVm, + connect.WithSchema(vmServiceMethods.ByName("BootVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceShutdownVmHandler := connect.NewUnaryHandler( + VmServiceShutdownVmProcedure, + svc.ShutdownVm, + connect.WithSchema(vmServiceMethods.ByName("ShutdownVm")), + connect.WithHandlerOptions(opts...), + ) + vmServicePauseVmHandler := connect.NewUnaryHandler( + VmServicePauseVmProcedure, + svc.PauseVm, + connect.WithSchema(vmServiceMethods.ByName("PauseVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceResumeVmHandler := connect.NewUnaryHandler( + VmServiceResumeVmProcedure, + svc.ResumeVm, + connect.WithSchema(vmServiceMethods.ByName("ResumeVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceRebootVmHandler := connect.NewUnaryHandler( + VmServiceRebootVmProcedure, + svc.RebootVm, + connect.WithSchema(vmServiceMethods.ByName("RebootVm")), + connect.WithHandlerOptions(opts...), + ) + vmServiceGetVmInfoHandler := connect.NewUnaryHandler( + VmServiceGetVmInfoProcedure, + svc.GetVmInfo, + connect.WithSchema(vmServiceMethods.ByName("GetVmInfo")), + connect.WithHandlerOptions(opts...), + ) + vmServiceListVmsHandler := connect.NewUnaryHandler( + VmServiceListVmsProcedure, + svc.ListVms, + connect.WithSchema(vmServiceMethods.ByName("ListVms")), + connect.WithHandlerOptions(opts...), + ) + return "/metal.vmprovisioner.v1.VmService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case VmServiceCreateVmProcedure: + vmServiceCreateVmHandler.ServeHTTP(w, r) + case VmServiceDeleteVmProcedure: + vmServiceDeleteVmHandler.ServeHTTP(w, r) + case VmServiceBootVmProcedure: + vmServiceBootVmHandler.ServeHTTP(w, r) + case VmServiceShutdownVmProcedure: + vmServiceShutdownVmHandler.ServeHTTP(w, r) + case VmServicePauseVmProcedure: + vmServicePauseVmHandler.ServeHTTP(w, r) + case VmServiceResumeVmProcedure: + vmServiceResumeVmHandler.ServeHTTP(w, r) + case VmServiceRebootVmProcedure: + vmServiceRebootVmHandler.ServeHTTP(w, r) + case VmServiceGetVmInfoProcedure: + vmServiceGetVmInfoHandler.ServeHTTP(w, r) + case VmServiceListVmsProcedure: + vmServiceListVmsHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedVmServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedVmServiceHandler struct{} + +func (UnimplementedVmServiceHandler) CreateVm(context.Context, *connect.Request[v1.CreateVmRequest]) (*connect.Response[v1.CreateVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.CreateVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) DeleteVm(context.Context, *connect.Request[v1.DeleteVmRequest]) (*connect.Response[v1.DeleteVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.DeleteVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) BootVm(context.Context, *connect.Request[v1.BootVmRequest]) (*connect.Response[v1.BootVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.BootVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) ShutdownVm(context.Context, *connect.Request[v1.ShutdownVmRequest]) (*connect.Response[v1.ShutdownVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.ShutdownVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) PauseVm(context.Context, *connect.Request[v1.PauseVmRequest]) (*connect.Response[v1.PauseVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.PauseVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) ResumeVm(context.Context, *connect.Request[v1.ResumeVmRequest]) (*connect.Response[v1.ResumeVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.ResumeVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) RebootVm(context.Context, *connect.Request[v1.RebootVmRequest]) (*connect.Response[v1.RebootVmResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.RebootVm is not implemented")) +} + +func (UnimplementedVmServiceHandler) GetVmInfo(context.Context, *connect.Request[v1.GetVmInfoRequest]) (*connect.Response[v1.GetVmInfoResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.GetVmInfo is not implemented")) +} + +func (UnimplementedVmServiceHandler) ListVms(context.Context, *connect.Request[v1.ListVmsRequest]) (*connect.Response[v1.ListVmsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metal.vmprovisioner.v1.VmService.ListVms is not implemented")) +} diff --git a/go/proto/deploy/builderd/v1/builder.proto b/go/proto/deploy/builderd/v1/builder.proto index 132b06b31f..d357e31677 100644 --- a/go/proto/deploy/builderd/v1/builder.proto +++ b/go/proto/deploy/builderd/v1/builder.proto @@ -24,11 +24,7 @@ service BuilderService { rpc DeleteBuild(DeleteBuildRequest) returns (DeleteBuildResponse); // Stream build logs in real-time - rpc StreamBuildLogs(StreamBuildLogsRequest) - returns (stream StreamBuildLogsResponse); - - // Get tenant quotas and usage - rpc GetTenantQuotas(GetTenantQuotasRequest) returns (GetTenantQuotasResponse); + rpc StreamBuildLogs(StreamBuildLogsRequest) returns (stream StreamBuildLogsResponse); // Get build statistics rpc GetBuildStats(GetBuildStatsRequest) returns (GetBuildStatsResponse); @@ -37,44 +33,34 @@ service BuilderService { // Build job lifecycle states enum BuildState { BUILD_STATE_UNSPECIFIED = 0; - BUILD_STATE_PENDING = 1; // Job queued - BUILD_STATE_PULLING = 2; // Pulling Docker image or source + BUILD_STATE_PENDING = 1; // Job queued + BUILD_STATE_PULLING = 2; // Pulling Docker image or source BUILD_STATE_EXTRACTING = 3; // Extracting/preparing source - BUILD_STATE_BUILDING = 4; // Building rootfs + BUILD_STATE_BUILDING = 4; // Building rootfs BUILD_STATE_OPTIMIZING = 5; // Applying optimizations - BUILD_STATE_COMPLETED = 6; // Build successful - BUILD_STATE_FAILED = 7; // Build failed - BUILD_STATE_CANCELLED = 8; // Build cancelled - BUILD_STATE_CLEANING = 9; // Cleaning up resources + BUILD_STATE_COMPLETED = 6; // Build successful + BUILD_STATE_FAILED = 7; // Build failed + BUILD_STATE_CANCELLED = 8; // Build cancelled + BUILD_STATE_CLEANING = 9; // Cleaning up resources } // Tenant service tiers enum TenantTier { TENANT_TIER_UNSPECIFIED = 0; - TENANT_TIER_FREE = 1; // Limited resources - TENANT_TIER_PRO = 2; // Standard resources + TENANT_TIER_FREE = 1; // Limited resources + TENANT_TIER_PRO = 2; // Standard resources TENANT_TIER_ENTERPRISE = 3; // Higher limits + isolation - TENANT_TIER_DEDICATED = 4; // Dedicated infrastructure + TENANT_TIER_DEDICATED = 4; // Dedicated infrastructure } // Init process strategies for microVMs enum InitStrategy { INIT_STRATEGY_UNSPECIFIED = 0; - INIT_STRATEGY_TINI = 1; // Use tini as init (recommended) + INIT_STRATEGY_TINI = 1; // Use tini as init (recommended) INIT_STRATEGY_DIRECT = 2; // Direct exec (risky) INIT_STRATEGY_CUSTOM = 3; // Custom init script } -// Multi-tenant context -message TenantContext { - string tenant_id = 1; // Primary tenant identifier - string customer_id = 2; // Customer within tenant (for billing) - string organization_id = 3; // Organization (for enterprise) - TenantTier tier = 4; // Service tier - repeated string permissions = 5; // Build permissions - map metadata = 6; // Tenant metadata -} - // Build source types - extensible for future build types message BuildSource { oneof source_type { @@ -87,8 +73,8 @@ message BuildSource { // Docker image extraction (first implementation) message DockerImageSource { - string image_uri = 1; // "ghcr.io/unkeyed/unkey:f4cfee5" - DockerAuth auth = 2; // Registry authentication + string image_uri = 1; // "ghcr.io/unkeyed/unkey:f4cfee5" + DockerAuth auth = 2; // Registry authentication repeated string pull_tags = 3; // Additional tags to consider } @@ -102,8 +88,8 @@ message DockerAuth { // Git repository builds (future) message GitRepositorySource { string repository_url = 1; // "https://github.com/unkeyed/unkey" - string ref = 2; // branch/tag/commit - string build_context = 3; // subdirectory if needed + string ref = 2; // branch/tag/commit + string build_context = 3; // subdirectory if needed GitAuth auth = 4; } @@ -116,8 +102,8 @@ message GitAuth { // Archive builds (future) message ArchiveSource { - string archive_url = 1; // URL to tar.gz, zip, etc. - string archive_type = 2; // "tar.gz", "zip" + string archive_url = 1; // URL to tar.gz, zip, etc. + string archive_type = 2; // "tar.gz", "zip" string build_context = 3; // subdirectory in archive } @@ -145,19 +131,19 @@ message ContainerImage { } message RuntimeConfig { - repeated string command = 1; // Override CMD - repeated string entrypoint = 2; // Override ENTRYPOINT - string working_dir = 3; // Override WORKDIR + repeated string command = 1; // Override CMD + repeated string entrypoint = 2; // Override ENTRYPOINT + string working_dir = 3; // Override WORKDIR map environment = 4; // Environment variables - repeated string exposed_ports = 5; // Ports to expose + repeated string exposed_ports = 5; // Ports to expose } message OptimizationSettings { - bool strip_debug_symbols = 1; // Strip debug info - bool compress_binaries = 2; // Compress with UPX - bool remove_docs = 3; // Remove documentation - bool remove_cache = 4; // Remove package caches - repeated string preserve_paths = 5; // Paths to always keep + bool strip_debug_symbols = 1; // Strip debug info + bool compress_binaries = 2; // Compress with UPX + bool remove_docs = 3; // Remove documentation + bool remove_cache = 4; // Remove package caches + repeated string preserve_paths = 5; // Paths to always keep repeated string exclude_patterns = 6; // Files to exclude } @@ -174,132 +160,103 @@ message BuildStrategy { // Docker extraction strategy (first implementation) message DockerExtractStrategy { - bool preserve_layers = 1; // Keep layer structure - bool flatten_filesystem = 2; // Merge all layers + bool preserve_layers = 1; // Keep layer structure + bool flatten_filesystem = 2; // Merge all layers repeated string exclude_patterns = 3; // Files to exclude } // Go API strategy (future) message GoApiStrategy { - string go_version = 1; // "1.21", "latest" + string go_version = 1; // "1.21", "latest" repeated string build_flags = 2; // "-ldflags", "-tags" - string main_package = 3; // "./cmd/api" + string main_package = 3; // "./cmd/api" bool enable_cgo = 4; } // Sinatra strategy (future) message SinatraStrategy { - string ruby_version = 1; // "3.2", "latest" - string gemfile_path = 2; // "Gemfile" - string rack_server = 3; // "puma", "unicorn" + string ruby_version = 1; // "3.2", "latest" + string gemfile_path = 2; // "Gemfile" + string rack_server = 3; // "puma", "unicorn" map rack_config = 4; // Server-specific config } // Node.js strategy (future) message NodejsStrategy { - string node_version = 1; // "18", "20", "latest" + string node_version = 1; // "18", "20", "latest" string package_manager = 2; // "npm", "yarn", "pnpm" - string start_script = 3; // "start", "server" + string start_script = 3; // "start", "server" bool enable_production = 4; // NODE_ENV=production } -// Tenant-aware resource limits -message TenantResourceLimits { - // Per-build limits - int64 max_memory_bytes = 1; - int32 max_cpu_cores = 2; - int64 max_disk_bytes = 3; - int32 timeout_seconds = 4; - - // Tenant-wide quotas - int32 max_concurrent_builds = 5; // Concurrent builds per tenant - int32 max_daily_builds = 6; // Daily build quota - int64 max_storage_bytes = 7; // Total storage quota - int32 max_build_time_minutes = 8; // Max time per build - - // Network restrictions - repeated string allowed_registries = 9; // Docker registries - repeated string allowed_git_hosts = 10; // Git hosts - bool allow_external_network = 11; // External network access - - // Security restrictions - bool allow_privileged_builds = 12; // Privileged containers - repeated string blocked_commands = 13; // Forbidden commands - int32 sandbox_level = 14; // Isolation level (0-3) -} - // Main build configuration message BuildConfig { // Tenant identification - TenantContext tenant = 1; // What we're building from - BuildSource source = 2; + BuildSource source = 1; // What we're building to - BuildTarget target = 3; + BuildTarget target = 2; // How to build it - BuildStrategy strategy = 4; - - // Build constraints (tenant-aware) - TenantResourceLimits limits = 5; + BuildStrategy strategy = 3; // Build metadata - string build_name = 6; // Human-readable name - map labels = 7; // Custom labels - + string build_name = 4; // Human-readable name + map labels = 5; // Custom labels + // Suggested asset ID to use when registering the built artifact // This allows the caller to pre-generate the asset ID - string suggested_asset_id = 8; + string suggested_asset_id = 6; } // Build isolation metadata message BuildIsolation { - string sandbox_id = 1; // Unique sandbox identifier - string network_namespace = 2; // Network isolation - string filesystem_namespace = 3; // Filesystem isolation + string sandbox_id = 1; // Unique sandbox identifier + string network_namespace = 2; // Network isolation + string filesystem_namespace = 3; // Filesystem isolation repeated string security_contexts = 4; // SELinux/AppArmor contexts - string cgroup_path = 5; // Resource cgroup + string cgroup_path = 5; // Resource cgroup } // Image metadata extracted from Docker images message ImageMetadata { - string original_image = 1; // Original Docker image - string image_digest = 2; // Docker image SHA256 - repeated string layers = 3; // Layer digests - map labels = 4; // Docker labels - repeated string command = 5; // Original CMD - repeated string entrypoint = 6; // Original ENTRYPOINT - string working_dir = 7; // WORKDIR - map env = 8; // Environment variables + string original_image = 1; // Original Docker image + string image_digest = 2; // Docker image SHA256 + repeated string layers = 3; // Layer digests + map labels = 4; // Docker labels + repeated string command = 5; // Original CMD + repeated string entrypoint = 6; // Original ENTRYPOINT + string working_dir = 7; // WORKDIR + map env = 8; // Environment variables repeated string exposed_ports = 9; // EXPOSE ports - string user = 10; // USER directive - repeated string volumes = 11; // VOLUME directives + string user = 10; // USER directive + repeated string volumes = 11; // VOLUME directives } // Build performance metrics message BuildMetrics { - int64 pull_duration_ms = 1; // Time to pull image/source - int64 extract_duration_ms = 2; // Time to extract layers - int64 build_duration_ms = 3; // Time to build rootfs + int64 pull_duration_ms = 1; // Time to pull image/source + int64 extract_duration_ms = 2; // Time to extract layers + int64 build_duration_ms = 3; // Time to build rootfs int64 optimize_duration_ms = 4; // Time for optimizations - int64 total_duration_ms = 5; // Total build time + int64 total_duration_ms = 5; // Total build time int64 original_size_bytes = 6; // Original image/source size - int64 rootfs_size_bytes = 7; // Final rootfs size - int64 compression_ratio = 8; // Size reduction percentage + int64 rootfs_size_bytes = 7; // Final rootfs size + int64 compression_ratio = 8; // Size reduction percentage int64 memory_peak_bytes = 9; // Peak memory usage int64 disk_usage_bytes = 10; // Temporary disk usage - int32 cpu_cores_used = 11; // CPU cores utilized + int32 cpu_cores_used = 11; // CPU cores utilized } // Complete build job information message BuildJob { - string build_id = 1; // Unique build identifier + string build_id = 1; // Unique build identifier BuildConfig config = 2; // Build configuration - BuildState state = 3; // Current build state + BuildState state = 3; // Current build state // Timestamps google.protobuf.Timestamp created_at = 4; @@ -307,9 +264,9 @@ message BuildJob { google.protobuf.Timestamp completed_at = 6; // Results - string rootfs_path = 7; // Path to built rootfs + string rootfs_path = 7; // Path to built rootfs int64 rootfs_size_bytes = 8; // Size of rootfs - string rootfs_checksum = 9; // SHA256 of rootfs + string rootfs_checksum = 9; // SHA256 of rootfs // Build metadata ImageMetadata image_metadata = 10; @@ -322,7 +279,7 @@ message BuildJob { // Progress information int32 progress_percent = 15; // 0-100 - string current_step = 16; // Current build step + string current_step = 16; // Current build step } // Build log entry for streaming @@ -334,26 +291,11 @@ message StreamBuildLogsResponse { map metadata = 5; } -// Tenant usage statistics -message TenantUsageStats { - int32 active_builds = 1; - int32 daily_builds_used = 2; - int64 storage_bytes_used = 3; - int64 compute_minutes_used = 4; - int32 builds_queued = 5; - int32 builds_completed_today = 6; - int32 builds_failed_today = 7; -} - -message QuotaViolation { - string quota_type = 1; // "concurrent_builds", "daily_builds", etc. - int64 current_value = 2; - int64 limit_value = 3; - string message = 4; -} // Request/Response messages -message CreateBuildRequest { BuildConfig config = 1; } +message CreateBuildRequest { + BuildConfig config = 1; +} message CreateBuildResponse { string build_id = 1; @@ -367,13 +309,14 @@ message GetBuildRequest { string tenant_id = 2; // For authorization } -message GetBuildResponse { BuildJob build = 1; } +message GetBuildResponse { + BuildJob build = 1; +} message ListBuildsRequest { - string tenant_id = 1; // Required for filtering - repeated BuildState state_filter = 2; - int32 page_size = 3; - string page_token = 4; + repeated BuildState state_filter = 1; + int32 page_size = 2; + string page_token = 3; } message ListBuildsResponse { @@ -384,7 +327,6 @@ message ListBuildsResponse { message CancelBuildRequest { string build_id = 1; - string tenant_id = 2; // For authorization } message CancelBuildResponse { @@ -394,25 +336,18 @@ message CancelBuildResponse { message DeleteBuildRequest { string build_id = 1; - string tenant_id = 2; // For authorization - bool force = 3; // Delete even if running + bool force = 2; // Delete even if running } -message DeleteBuildResponse { bool success = 1; } +message DeleteBuildResponse { + bool success = 1; +} message StreamBuildLogsRequest { string build_id = 1; - string tenant_id = 2; // For authorization - bool follow = 3; // Continue streaming new logs + bool follow = 2; // Continue streaming new logs } -message GetTenantQuotasRequest { string tenant_id = 1; } - -message GetTenantQuotasResponse { - TenantResourceLimits current_limits = 1; - TenantUsageStats current_usage = 2; - repeated QuotaViolation violations = 3; -} message GetBuildStatsRequest { string tenant_id = 1;