Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/cmd/runtime/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func StartCmd(ch *cmdutil.Helper) *cobra.Command {
AuthIssuerURL: conf.AuthIssuerURL,
AuthAudienceURL: conf.AuthAudienceURL,
}
s, err := server.NewServer(ctx, srvOpts, rt, logger, limiter, activityClient)
s, err := server.NewServer(ctx, srvOpts, rt, logger, limiter, activityClient, nil)
if err != nil {
logger.Fatal("error: could not create server", zap.Error(err))
}
Expand Down
79 changes: 79 additions & 0 deletions cli/pkg/local/admin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package local

import (
"context"
"fmt"
"time"

"github.com/rilldata/rill/cli/pkg/cmdutil"
adminv1 "github.com/rilldata/rill/proto/gen/rill/admin/v1"
"github.com/rilldata/rill/runtime/drivers"
)

type localAdminService struct {
ch *cmdutil.Helper
root string
}

var _ drivers.AdminService = &localAdminService{}

func newLocalAdminService(ch *cmdutil.Helper, root string) drivers.AdminService {
return &localAdminService{
ch: ch,
root: root,
}
}

// GetAlertMetadata implements drivers.AdminService.
func (l *localAdminService) GetAlertMetadata(ctx context.Context, alertName string, ownerID string, emailRecipients []string, anonRecipients bool, annotations map[string]string, queryForUserID string, queryForUserEmail string) (*drivers.AlertMetadata, error) {
return nil, drivers.ErrNotImplemented
}

// GetDeploymentConfig implements drivers.AdminService.
func (l *localAdminService) GetDeploymentConfig(ctx context.Context) (*drivers.DeploymentConfig, error) {
return nil, drivers.ErrNotImplemented
}

// GetReportMetadata implements drivers.AdminService.
func (l *localAdminService) GetReportMetadata(ctx context.Context, reportName string, ownerID string, webOpenMode string, emailRecipients []string, anonRecipients bool, executionTime time.Time) (*drivers.ReportMetadata, error) {
return nil, drivers.ErrNotImplemented
}

// ProvisionConnector implements drivers.AdminService.
func (l *localAdminService) ProvisionConnector(ctx context.Context, name string, driver string, args map[string]any) (map[string]any, error) {
return nil, drivers.ErrNotImplemented
}

// ListDeployments implements drivers.AdminService.
func (l *localAdminService) ListDeployments(ctx context.Context) ([]*drivers.Deployment, error) {
client, err := l.ch.Client()
if err != nil {
return nil, err
}

projects, err := l.ch.InferProjects(ctx, l.ch.Org, l.root)
if err != nil {
return nil, err
}
if len(projects) == 0 {
return nil, fmt.Errorf("no project found in the current directory")
}
project := projects[0]

resp, err := client.ListDeployments(ctx, &adminv1.ListDeploymentsRequest{
Org: project.OrgName,
Project: project.Name,
})
if err != nil {
return nil, err
}

res := make([]*drivers.Deployment, 0, len(resp.Deployments))
for _, d := range resp.Deployments {
res = append(res, &drivers.Deployment{
Branch: d.Branch,
})
}

return res, nil
}
2 changes: 1 addition & 1 deletion cli/pkg/local/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (a *App) Serve(httpPort, grpcPort int, enableUI, openBrowser, readonly bool
AllowedOrigins: a.allowedOrigins,
ServePrometheus: true,
}
runtimeServer, err := runtimeserver.NewServer(ctx, opts, a.Runtime, runtimeServerLogger, ratelimit.NewNoop(), a.ch.Telemetry(ctx))
runtimeServer, err := runtimeserver.NewServer(ctx, opts, a.Runtime, runtimeServerLogger, ratelimit.NewNoop(), a.ch.Telemetry(ctx), newLocalAdminService(a.ch, a.ProjectPath))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/rill/admin/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ externalDocs:
info:
description: Rill Admin API enables programmatic management of Rill Cloud resources, including organizations, projects, and user access. It provides endpoints for creating, updating, and deleting these resources, as well as managing authentication and permissions.
title: Rill Admin API
version: v0.78.0
version: v0.78.2
openapi: 3.0.3
paths:
/v1/ai/complete:
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/rill/admin/v1/public.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ externalDocs:
info:
description: Rill Admin API enables programmatic management of Rill Cloud resources, including organizations, projects, and user access. It provides endpoints for creating, updating, and deleting these resources, as well as managing authentication and permissions.
title: Rill Admin API
version: v0.78.0
version: v0.78.2
openapi: 3.0.3
paths:
/v1/ai/complete: {}
Expand Down
Loading
Loading