Skip to content

feat(serverless): initial command structure scaffolding - #79

Open
Ryank90 wants to merge 5 commits into
mainfrom
feat/serverless-group
Open

feat(serverless): initial command structure scaffolding#79
Ryank90 wants to merge 5 commits into
mainfrom
feat/serverless-group

Conversation

@Ryank90

@Ryank90 Ryank90 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Scaffolding out the serverless product structure.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 39dad86b-69cc-46e0-9d40-a8b321822724

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/serverless-group

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scaffolds an initial “serverless” command group in the Runware CLI, introducing a dedicated Serverless REST client, wiring the command into the root CLI, and generating initial reference docs.

Changes:

  • Added Serverless API/Dashboard base URL configuration helpers and environment overrides.
  • Introduced a new internal/api/serverless REST client and a first endpoint (ListGpuTypes) with tests.
  • Added a new runware serverless command group with initial subcommands (deploy, gpus, open) plus generated docs.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/config/config.go Adds defaults + env overrides for Serverless API and dashboard URLs.
internal/cmdutil/browser.go Adds a helper to open URLs in the default browser cross-platform.
internal/cmd/serverless/serverless.go Registers the serverless command group and its subcommands.
internal/cmd/serverless/secret.go Adds placeholder serverless apps secret command group.
internal/cmd/serverless/registry.go Adds placeholder serverless registry command group.
internal/cmd/serverless/open.go Adds serverless open command to open dashboard URLs and print the link.
internal/cmd/serverless/gpus.go Adds serverless gpus command to fetch and render GPU catalogue + pricing.
internal/cmd/serverless/deploy.go Adds serverless deploy command stub (currently unimplemented).
internal/cmd/serverless/apps.go Adds placeholder serverless apps group and wires in secret.
internal/cmd/root.go Wires serverless into the root CLI command tree.
internal/api/serverless/types.go Defines Serverless GPU-related response types.
internal/api/serverless/gpu.go Implements ListGpuTypes endpoint call.
internal/api/serverless/gpu_test.go Adds tests for ListGpuTypes and error/auth behaviors.
internal/api/serverless/errors.go Adds error parsing/mapping to shared transport.RunwareError.
internal/api/serverless/client.go Adds a minimal REST client with auth + JSON decode + debug logging.
docs/runware.md Adds runware serverless to the top-level command documentation.
docs/runware_serverless.md Adds generated docs page for the serverless command group.
docs/runware_serverless_open.md Adds generated docs page for serverless open.
docs/runware_serverless_gpus.md Adds generated docs page for serverless gpus.
docs/runware_serverless_deploy.md Adds generated docs page for serverless deploy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +31
// The launcher name is a fixed per-OS constant and the URL is passed as a
// separate argv element (not shell-interpreted), so there is no injection.
if err := exec.CommandContext(ctx, name, args...).Start(); err != nil { //nolint:gosec
return fmt.Errorf("failed to open browser: %w", err)
}
return nil
Comment on lines +17 to +23
cmd.AddCommand(
newDeployCmd(),
newGPUsCmd(logger),
newOpenCmd(),
newRegistryCmd(),
newAppsCmd(),
)
Comment on lines +22 to +25
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("not implemented yet")
},

@danmrichards danmrichards left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also have this target a new rc/serverless or something similar. We don't want to have this in a production build just yet, so merging to main would prevent us pushing out any other fixes/features. Alternatively we'd need to have some build time killswitch for these commands.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: lets not hand-roll a client for serverless, use the serverless OpenAPI spec and leverage a tool like https://github.com/oapi-codegen/oapi-codegen to generate a client instead

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: use the https://pkg.go.dev/github.com/pkg/browser package for this, it's well tested and has full cross-platform support

Long: `Deploy a new serverless application from a Python file.

The application settings come from the project
configuration created by 'runware serverless init' or the dashboard.`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I don't see any init command under serverless, coming later?

Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
id := args[0]
url := strings.TrimSuffix(config.GetDashboardURL(), "/") + "/serverless/" + id

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: escape the id param to avoid any weird concatenation

Suggested change
url := strings.TrimSuffix(config.GetDashboardURL(), "/") + "/serverless/" + id
url := strings.TrimSuffix(config.GetDashboardURL(), "/") + "/serverless/" + url.PathEscape(id)

client := serverlessapi.NewClient(config.GetAPIKey(), config.GetServerlessBaseURL(), slog.New(logger))
gpus, err := client.ListGpuTypes(cmd.Context())
if err != nil {
spin.Stop()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: both branches are stopping the spinner before any output, so should just be able to defer spin.Stop() after the spin.Start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants