Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go 1.25.8
- name: Setup Go 1.25.9
uses: actions/setup-go@v5
with:
go-version: 1.25.8
go-version: 1.25.9
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.8"
go-version: "1.25.9"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
50 changes: 50 additions & 0 deletions cmd/pod/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ var (
createDataCenterIDs string
createSSH bool
createNetworkVolumeID string
createMinCudaVersion string
createDockerArgs string
createRegistryAuthID string
createCountryCode string
createStopAfter string
createTerminateAfter string
createCompliance string
)

func init() {
Expand All @@ -74,6 +81,13 @@ func init() {
createCmd.Flags().StringVar(&createDataCenterIDs, "data-center-ids", "", "comma-separated list of data center ids")
createCmd.Flags().BoolVar(&createSSH, "ssh", true, "enable ssh on the pod")
createCmd.Flags().StringVar(&createNetworkVolumeID, "network-volume-id", "", "network volume id to attach")
createCmd.Flags().StringVar(&createMinCudaVersion, "min-cuda-version", "", "minimum cuda version (e.g., 12.6)")
createCmd.Flags().StringVar(&createDockerArgs, "docker-args", "", "docker cmd arguments")
createCmd.Flags().StringVar(&createRegistryAuthID, "registry-auth-id", "", "container registry auth id (from 'runpodctl registry list')")
createCmd.Flags().StringVar(&createCountryCode, "country-code", "", "limit pod to a specific country (e.g., US, DE)")
createCmd.Flags().StringVar(&createStopAfter, "stop-after", "", "auto-stop datetime (e.g., 2026-04-15T00:00:00Z)")
createCmd.Flags().StringVar(&createTerminateAfter, "terminate-after", "", "auto-terminate datetime (e.g., 2026-04-15T00:00:00Z)")
createCmd.Flags().StringVar(&createCompliance, "compliance", "", "comma-separated compliance requirements (e.g., HIPAA,SOC_2_TYPE_2)")
}

func runCreate(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -188,6 +202,34 @@ func createPodGraphQL(gpuTypeID, cloudType string, supportPublicIP bool) (map[st
}
}

if createMinCudaVersion != "" {
req.MinCudaVersion = createMinCudaVersion
}

if createDockerArgs != "" {
req.DockerArgs = createDockerArgs
}

if createRegistryAuthID != "" {
req.ContainerRegistryAuthId = createRegistryAuthID
}

if createCountryCode != "" {
req.CountryCode = createCountryCode
}

if createStopAfter != "" {
req.StopAfter = createStopAfter
}

if createTerminateAfter != "" {
req.TerminateAfter = createTerminateAfter
}

if createCompliance != "" {
req.Compliance = strings.Split(createCompliance, ",")
}

if createEnv != "" {
var envMap map[string]string
if err := json.Unmarshal([]byte(createEnv), &envMap); err != nil {
Expand Down Expand Up @@ -237,6 +279,14 @@ func createPodREST(computeType, gpuTypeID, cloudType string, supportPublicIP boo
req.DataCenterIDs = strings.Split(createDataCenterIDs, ",")
}

if createMinCudaVersion != "" {
req.MinCudaVersion = createMinCudaVersion
}

if createDockerArgs != "" {
req.DockerArgs = createDockerArgs
}

if createEnv != "" {
var env map[string]string
if err := json.Unmarshal([]byte(createEnv), &env); err != nil {
Expand Down
73 changes: 66 additions & 7 deletions cmd/serverless/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ var createCmd = &cobra.Command{
}

var (
createName string
createTemplateID string
createComputeType string
createGpuTypeID string
createGpuCount int
createWorkersMin int
createWorkersMax int
createName string
createTemplateID string
createComputeType string
createGpuTypeID string
createGpuCount int
createWorkersMin int
createWorkersMax int
createDataCenterIDs string
createNetworkVolumeID string
createMinCudaVersion string
createScaleBy string
createScaleThreshold int
createIdleTimeout int
createFlashBoot bool
createExecutionTimeout int
createNetworkVolumeIDs string
)

func init() {
Expand All @@ -40,6 +47,13 @@ func init() {
createCmd.Flags().IntVar(&createWorkersMax, "workers-max", 3, "maximum number of workers")
createCmd.Flags().StringVar(&createDataCenterIDs, "data-center-ids", "", "comma-separated list of data center ids")
createCmd.Flags().StringVar(&createNetworkVolumeID, "network-volume-id", "", "network volume id to attach")
createCmd.Flags().StringVar(&createMinCudaVersion, "min-cuda-version", "", "minimum cuda version (e.g., 12.6)")
createCmd.Flags().StringVar(&createScaleBy, "scale-by", "", "autoscale strategy: delay (seconds of queue wait) or requests (pending request count)")
createCmd.Flags().IntVar(&createScaleThreshold, "scale-threshold", -1, "trigger point for autoscaler (delay: seconds, requests: count)")
createCmd.Flags().IntVar(&createIdleTimeout, "idle-timeout", -1, "seconds before idle worker scales down (1-3600)")
createCmd.Flags().BoolVar(&createFlashBoot, "flash-boot", true, "enable flash boot")
createCmd.Flags().IntVar(&createExecutionTimeout, "execution-timeout", -1, "max seconds per request")
createCmd.Flags().StringVar(&createNetworkVolumeIDs, "network-volume-ids", "", "comma-separated network volume ids for multi-region")

createCmd.MarkFlagRequired("template-id") //nolint:errcheck
}
Expand Down Expand Up @@ -76,12 +90,57 @@ func runCreate(cmd *cobra.Command, args []string) error {
req.DataCenterIDs = strings.Split(createDataCenterIDs, ",")
}

if createMinCudaVersion != "" {
req.MinCudaVersion = createMinCudaVersion
}

if createScaleBy != "" {
switch strings.ToLower(strings.TrimSpace(createScaleBy)) {
case "delay":
req.ScalerType = "QUEUE_DELAY"
case "requests":
req.ScalerType = "REQUEST_COUNT"
default:
return fmt.Errorf("invalid --scale-by %q (use delay or requests)", createScaleBy)
}
}

if createScaleThreshold >= 0 {
req.ScalerValue = createScaleThreshold
}

if createIdleTimeout >= 0 {
if createIdleTimeout < 1 || createIdleTimeout > 3600 {
return fmt.Errorf("--idle-timeout must be between 1 and 3600 seconds")
}
req.IdleTimeout = createIdleTimeout
}

if createExecutionTimeout >= 0 {
req.ExecutionTimeoutMs = createExecutionTimeout * 1000
}

if createNetworkVolumeIDs != "" {
req.NetworkVolumeIDs = strings.Split(createNetworkVolumeIDs, ",")
}

endpoint, err := client.CreateEndpoint(req)
if err != nil {
output.Error(err)
return fmt.Errorf("failed to create endpoint: %w", err)
}

// rest create ignores flashboot=false, so patch immediately after create
if !createFlashBoot {
fb := false
_, err := client.UpdateEndpoint(endpoint.ID, &api.EndpointUpdateRequest{Flashboot: &fb})
if err != nil {
output.Error(err)
return fmt.Errorf("endpoint created but failed to disable flashboot: %w", err)
}
endpoint.Flashboot = &fb
}

format := output.ParseFormat(cmd.Flag("output").Value.String())
return output.Print(endpoint, &output.Config{Format: format})
}
7 changes: 5 additions & 2 deletions cmd/serverless/serverless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ func TestUpdateCmd_Flags(t *testing.T) {
if flags.Lookup("idle-timeout") == nil {
t.Error("expected --idle-timeout flag")
}
if flags.Lookup("scaler-type") == nil {
t.Error("expected --scaler-type flag")
if flags.Lookup("scale-by") == nil {
t.Error("expected --scale-by flag")
}
if flags.Lookup("scale-threshold") == nil {
t.Error("expected --scale-threshold flag")
}
}

Expand Down
24 changes: 16 additions & 8 deletions cmd/serverless/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package serverless

import (
"fmt"
"strings"

"github.com/runpod/runpodctl/internal/api"
"github.com/runpod/runpodctl/internal/output"
Expand All @@ -22,17 +23,17 @@ var (
updateWorkersMin int
updateWorkersMax int
updateIdleTimeout int
updateScalerType string
updateScalerValue int
updateScaleBy string
updateScaleThreshold int
)

func init() {
updateCmd.Flags().StringVar(&updateName, "name", "", "new endpoint name")
updateCmd.Flags().IntVar(&updateWorkersMin, "workers-min", -1, "new minimum number of workers")
updateCmd.Flags().IntVar(&updateWorkersMax, "workers-max", -1, "new maximum number of workers")
updateCmd.Flags().IntVar(&updateIdleTimeout, "idle-timeout", -1, "new idle timeout in seconds")
updateCmd.Flags().StringVar(&updateScalerType, "scaler-type", "", "scaler type (QUEUE_DELAY or REQUEST_COUNT)")
updateCmd.Flags().IntVar(&updateScalerValue, "scaler-value", -1, "scaler value")
updateCmd.Flags().StringVar(&updateScaleBy, "scale-by", "", "autoscale strategy: delay (seconds of queue wait) or requests (pending request count)")
updateCmd.Flags().IntVar(&updateScaleThreshold, "scale-threshold", -1, "trigger point for autoscaler (delay: seconds, requests: count)")
}

func runUpdate(cmd *cobra.Command, args []string) error {
Expand All @@ -58,11 +59,18 @@ func runUpdate(cmd *cobra.Command, args []string) error {
if updateIdleTimeout >= 0 {
req.IdleTimeout = updateIdleTimeout
}
if updateScalerType != "" {
req.ScalerType = updateScalerType
if updateScaleBy != "" {
switch strings.ToLower(strings.TrimSpace(updateScaleBy)) {
case "delay":
req.ScalerType = "QUEUE_DELAY"
case "requests":
req.ScalerType = "REQUEST_COUNT"
default:
return fmt.Errorf("invalid --scale-by %q (use delay or requests)", updateScaleBy)
}
}
if updateScalerValue >= 0 {
req.ScalerValue = updateScalerValue
if updateScaleThreshold >= 0 {
req.ScalerValue = updateScaleThreshold
}

endpoint, err := client.UpdateEndpoint(endpointID, req)
Expand Down
21 changes: 0 additions & 21 deletions docs/github-issue-notes.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/runpodctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ deprecated
* [runpodctl user](runpodctl_user.md) - show account info
* [runpodctl version](runpodctl_version.md) - print the version

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ view billing history for pods, serverless, and network volumes
* [runpodctl billing pods](runpodctl_billing_pods.md) - view pod billing history
* [runpodctl billing serverless](runpodctl_billing_serverless.md) - view serverless billing history

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_billing_network-volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runpodctl billing network-volume [flags]

* [runpodctl billing](runpodctl_billing.md) - view billing history

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_billing_pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ runpodctl billing pods [flags]

* [runpodctl billing](runpodctl_billing.md) - view billing history

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_billing_serverless.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ runpodctl billing serverless [flags]

* [runpodctl billing](runpodctl_billing.md) - view billing history

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ runpodctl completion [flags]

* [runpodctl](runpodctl.md) - cli for runpod.io

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_datacenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ list datacenters and their gpu availability
* [runpodctl](runpodctl.md) - cli for runpod.io
* [runpodctl datacenter list](runpodctl_datacenter_list.md) - list all datacenters

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_datacenter_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ runpodctl datacenter list [flags]

* [runpodctl datacenter](runpodctl_datacenter.md) - list datacenters

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_doctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ runpodctl doctor [flags]

* [runpodctl](runpodctl.md) - cli for runpod.io

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ list available gpu types and their availability
* [runpodctl](runpodctl.md) - cli for runpod.io
* [runpodctl gpu list](runpodctl_gpu_list.md) - list available gpu types

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_gpu_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ runpodctl gpu list [flags]

* [runpodctl gpu](runpodctl_gpu.md) - list available gpu types

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ manage models in the runpod model repository
* [runpodctl model list](runpodctl_model_list.md) - list models
* [runpodctl model remove](runpodctl_model_remove.md) - remove a model

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_model_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ runpodctl model add [flags]

* [runpodctl model](runpodctl_model.md) - manage model repository

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_model_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runpodctl model list [flags]

* [runpodctl model](runpodctl_model.md) - manage model repository

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_model_remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ runpodctl model remove [flags]

* [runpodctl model](runpodctl_model.md) - manage model repository

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_network-volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ manage network volumes on runpod
* [runpodctl network-volume list](runpodctl_network-volume_list.md) - list all network volumes
* [runpodctl network-volume update](runpodctl_network-volume_update.md) - update a network volume

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_network-volume_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runpodctl network-volume create [flags]

* [runpodctl network-volume](runpodctl_network-volume.md) - manage network volumes

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
2 changes: 1 addition & 1 deletion docs/runpodctl_network-volume_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ runpodctl network-volume delete <volume-id> [flags]

* [runpodctl network-volume](runpodctl_network-volume.md) - manage network volumes

###### Auto generated by spf13/cobra on 23-Mar-2026
###### Auto generated by spf13/cobra on 13-Apr-2026
Loading
Loading