diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d6fe48..f049e58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: id: release with: release-type: go - package-name: runpodctl + package-name: runpod pull-request-title-pattern: release${component} ${version} - uses: actions/checkout@v2 @@ -30,10 +30,10 @@ jobs: - name: build if: ${{ steps.release.outputs.release_created }} run: | - env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-linux-amd64 . - env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-darwin-amd64 . - env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-darwin-arm64 . - env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-windows-amd64 . + env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpod-linux-amd64 . + env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpod-darwin-amd64 . + env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpod-darwin-arm64 . + env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpod-windows-amd64.exe . - name: upload linux amd64 release binary if: ${{ steps.release.outputs.release_created }} @@ -42,9 +42,10 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: bin/runpodctl-linux-amd - asset_name: runpodctl-linux-amd + asset_path: bin/runpod-linux-amd64 + asset_name: runpod-linux-amd64 asset_content_type: application/octet-stream + - name: upload darwin amd64 release binary if: ${{ steps.release.outputs.release_created }} uses: actions/upload-release-asset@v1.0.2 @@ -52,9 +53,10 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: bin/runpodctl-darwin-amd - asset_name: runpodctl-darwin-amd + asset_path: bin/runpod-darwin-amd64 + asset_name: runpod-darwin-amd64 asset_content_type: application/octet-stream + - name: upload darwin arm64 release binary if: ${{ steps.release.outputs.release_created }} uses: actions/upload-release-asset@v1.0.2 @@ -62,9 +64,10 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: bin/runpodctl-darwin-arm - asset_name: runpodctl-darwin-arm + asset_path: bin/runpod-darwin-arm64 + asset_name: runpod-darwin-arm64 asset_content_type: application/octet-stream + - name: upload windows amd64 release binary if: ${{ steps.release.outputs.release_created }} uses: actions/upload-release-asset@v1.0.2 @@ -72,6 +75,6 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: bin/runpodctl-win-amd - asset_name: runpodctl-win-amd + asset_path: bin/runpod-windows-amd64.exe + asset_name: runpod-windows-amd64.exe asset_content_type: application/octet-stream diff --git a/cmd/croc/croc.go b/cmd/croc/croc.go index 906431e..66a4f40 100644 --- a/cmd/croc/croc.go +++ b/cmd/croc/croc.go @@ -520,7 +520,7 @@ func (c *Client) Send(filesInfo []FileInfo, emptyFoldersToTransfer []FileInfo, t return } flags := &strings.Builder{} - fmt.Fprintf(os.Stderr, "Code is: %[1]s\nOn the other computer run\n\nrunpodctl receive %[2]s%[1]s\n", c.Options.SharedSecret, flags.String()) + fmt.Fprintf(os.Stderr, "Code is: %[1]s\nOn the other computer run\n\nrunpod receive %[2]s%[1]s\n", c.Options.SharedSecret, flags.String()) if c.Options.Ask { machid, _ := machineid.ID() fmt.Fprintf(os.Stderr, "\rYour machine ID is '%s'\n", machid) diff --git a/cmd/project/exampleDockerfile b/cmd/project/exampleDockerfile index 1c4082c..8bfa700 100644 --- a/cmd/project/exampleDockerfile +++ b/cmd/project/exampleDockerfile @@ -1,4 +1,4 @@ -# AUTOGENERATED Dockerfile using runpodctl project build +# AUTOGENERATED Dockerfile using RunPod CLI project build # Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile # DockerHub -> https://hub.docker.com/r/runpod/base/tags @@ -23,6 +23,6 @@ RUN python<> -m pip install --upgrade pip && \ # It is recommended to specify the version of Python when running your code. # Add src files (Worker Template) -ADD src . +ADD . / <> -CMD python<> -u <> \ No newline at end of file +CMD python<> -u /<> diff --git a/cmd/project/functions.go b/cmd/project/functions.go index 9732b7f..8d34fe5 100644 --- a/cmd/project/functions.go +++ b/cmd/project/functions.go @@ -284,6 +284,7 @@ func startProject(networkVolumeId string) error { venvPath, remoteProjectPath, config.GetPath([]string{"runtime", "requirements_path"}).(string)), }) //create file watcher + fmt.Println("Creating file watcher...") go sshConn.SyncDir(cwd, projectPathUuidDev) //run launch api server / hot reload loop pipReqPath := path.Join(remoteProjectPath, config.GetPath([]string{"runtime", "requirements_path"}).(string)) @@ -397,7 +398,7 @@ func deployProject(networkVolumeId string) (endpointId string, err error) { projectName := config.Get("name").(string) projectPathUuid := path.Join(projectConfig.Get("volume_mount_path").(string), projectConfig.Get("uuid").(string)) projectPathUuidProd := path.Join(projectPathUuid, "prod") - remoteProjectPath := path.Join(projectPathUuidProd, projectConfig.Get("name").(string)) + remoteProjectPath := path.Join(projectPathUuidProd, config.Get("name").(string)) //check for existing pod projectPodId, err := getProjectPod(projectId) if projectPodId == "" || err != nil { diff --git a/cmd/project/project.go b/cmd/project/project.go index d67b4ff..6437d81 100644 --- a/cmd/project/project.go +++ b/cmd/project/project.go @@ -187,12 +187,12 @@ var StartProjectCmd = &cobra.Command{ } if setDefaultNetworkVolume || networkVolumeId == "" || !cachedNetVolExists { netVolId, err := selectNetworkVolume() - networkVolumeId = netVolId - viper.Set(fmt.Sprintf("project_volumes.%s", projectId), networkVolumeId) - viper.WriteConfig() if err != nil { return } + networkVolumeId = netVolId + viper.Set(fmt.Sprintf("project_volumes.%s", projectId), networkVolumeId) + viper.WriteConfig() } startProject(networkVolumeId) }, diff --git a/cmd/project/ssh.go b/cmd/project/ssh.go index 97f93b0..98d6f67 100644 --- a/cmd/project/ssh.go +++ b/cmd/project/ssh.go @@ -9,13 +9,10 @@ import ( "os/exec" "path/filepath" "strings" - "sync" "time" - "github.com/dietsche/rfsnotify" "github.com/fatih/color" "golang.org/x/crypto/ssh" - "gopkg.in/fsnotify.v1" ) func getPodSSHInfo(podId string) (podIp string, podPort int, err error) { @@ -88,65 +85,68 @@ func (sshConn *SSHConnection) Rsync(localDir string, remoteDir string, quiet boo return nil } +// hasChanges checks if there are any modified files in localDir since lastSyncTime. +func hasChanges(localDir string, lastSyncTime time.Time) (bool, string) { + var hasModifications bool + var firstModifiedFile string + + err := filepath.Walk(localDir, func(path string, info os.FileInfo, err error) error { + if err != nil { + if os.IsNotExist(err) { + // Handle the case where a file has been removed + fmt.Printf("Detected a removed file at: %s\n", path) + hasModifications = true + return errors.New("change detected") // Stop walking + } + return err + } + + // Check if the file was modified after the last sync time + if info.ModTime().After(lastSyncTime) { + hasModifications = true + firstModifiedFile = path + return filepath.SkipDir // Skip the rest of the directory if a change is found + } + + return nil + }) + + if err != nil { + fmt.Printf("Error walking through directory: %v\n", err) + return false, "" + } + + return hasModifications, firstModifiedFile +} + func (sshConn *SSHConnection) SyncDir(localDir string, remoteDir string) { syncFiles := func() { fmt.Println("Syncing files...") sshConn.Rsync(localDir, remoteDir, true) } - // Create new watcher. - watcher, err := rfsnotify.NewWatcher() - if err != nil { - fmt.Println(err) - } - defer watcher.Close() - var mu sync.Mutex - var timer *time.Timer // Start listening for events. go func() { + lastSyncTime := time.Now() for { - select { - case event, ok := <-watcher.Events: - if !ok { - return - } - //if directory modified or created, ignore - if event.Op&fsnotify.Write == fsnotify.Write || event.Op&fsnotify.Create == fsnotify.Create { - if event.Op&fsnotify.Write == fsnotify.Write { - fmt.Println("Modified file:", event.Name) - } - if event.Op&fsnotify.Create == fsnotify.Create { - fmt.Println("Created file:", event.Name) - } - - mu.Lock() - if timer != nil { - timer.Stop() - } - timer = time.AfterFunc(500*time.Millisecond, syncFiles) - mu.Unlock() - } - case err, ok := <-watcher.Errors: - if !ok { - return - } - fmt.Println("error:", err) + time.Sleep(100 * time.Millisecond) + hasChanged, firstModifiedFile := hasChanges(localDir, lastSyncTime) + if hasChanged { + fmt.Printf("Detected changes in %s\n", firstModifiedFile) + syncFiles() + lastSyncTime = time.Now() } } }() - // Add a path. - err = watcher.AddRecursive(localDir) - if err != nil { - fmt.Println(err) - } - // Block main goroutine forever. <-make(chan struct{}) } + func (sshConn *SSHConnection) RunCommand(command string) error { return sshConn.RunCommands([]string{command}) } + func (sshConn *SSHConnection) RunCommands(commands []string) error { stdoutColor := color.New(color.FgGreen) diff --git a/cmd/project/starter_templates/default/builder/requirements.txt b/cmd/project/starter_templates/default/builder/requirements.txt index b752a48..5a3f4c6 100644 --- a/cmd/project/starter_templates/default/builder/requirements.txt +++ b/cmd/project/starter_templates/default/builder/requirements.txt @@ -6,3 +6,4 @@ # To learn more, see https://pip.pypa.io/en/stable/reference/requirements-file-format/ <> +hf_transfer diff --git a/cmd/root.go b/cmd/root.go index 1bf2a33..cbbfda7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,9 +15,10 @@ var version string // rootCmd represents the base command when called without any subcommands var RootCmd = &cobra.Command{ - Use: "runpodctl", - Short: "runpodctl for runpod.io", - Long: "runpodctl is a CLI tool to manage your pods for runpod.io", + Use: "runpod", + Aliases: []string{"runpodctl"}, + Short: "CLI for runpod.io", + Long: "CLI tool to manage your pods for runpod.io", } // Execute adds all child commands to the root command and sets flags appropriately. @@ -72,7 +73,7 @@ func initConfig() { fmt.Println("Runpod config location has moved from ~/.runpod.yaml to ~/.runpod/config.toml") fmt.Println("migrating your existing config to ~/.runpod/config.toml") } else { - fmt.Println("Runpod config file not found, please run runpodctl config to create it") + fmt.Println("Runpod config file not found, please run `runpod config` to create it") } viper.SetConfigType("toml") //make .runpod folder if not exists diff --git a/cmd/update.go b/cmd/update.go index 2d1d40a..23c37c5 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -74,21 +74,21 @@ func GetJson(url string) (*GithubApiResponse, error) { var updateCmd = &cobra.Command{ Use: "update", - Short: "runpodctl update", - Long: "runpodctl update", + Short: "update runpod cli", + Long: "update runpod cli to the latest version", Run: func(c *cobra.Command, args []string) { //fetch newest github release githubApiUrl := "https://api.github.com/repos/runpod/runpodctl/releases/latest" apiResp, err := GetJson(githubApiUrl) if err != nil { - fmt.Println("error fetching latest version info for runpodctl", err) + fmt.Println("error fetching latest version info for runpod cli", err) return } //find download link for current platform latestVersion := apiResp.Version if semver.Compare("v"+version, latestVersion) == -1 { //version < latest - newBinaryName := fmt.Sprintf("runpodctl-%s-%s", runtime.GOOS, runtime.GOARCH) + newBinaryName := fmt.Sprintf("runpod-%s-%s", runtime.GOOS, runtime.GOARCH) foundNewBinary := false var downloadLink string for _, asset := range apiResp.Assets { @@ -107,20 +107,20 @@ var updateCmd = &cobra.Command{ } exPath := filepath.Dir(ex) downloadPath := newBinaryName - destFilename := "runpodctl" + destFilename := "runpod" if runtime.GOOS == "windows" { - destFilename = "runpodctl.exe" + destFilename = "runpod.exe" } destPath := filepath.Join(exPath, destFilename) if runtime.GOOS == "windows" { fmt.Println("To get the newest version, run this command:") - fmt.Printf("wget https://github.com/runpod/runpodctl/releases/download/%s/%s -O runpodctl.exe\n", latestVersion, newBinaryName) + fmt.Printf("wget https://github.com/runpod/runpodctl/releases/download/%s/%s -O runpod.exe\n", latestVersion, newBinaryName) } - fmt.Printf("downloading runpodctl %s to %s\n", latestVersion, downloadPath) + fmt.Printf("downloading runpod %s to %s\n", latestVersion, downloadPath) file, err := DownloadFile(downloadLink, downloadPath) defer file.Close() if err != nil { - fmt.Println("error fetching the latest version of runpodctl", err) + fmt.Println("error fetching the latest version of runpod cli", err) return } //chmod +x diff --git a/cmd/version.go b/cmd/version.go index a4eb484..17ddf73 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -8,9 +8,9 @@ import ( var versionCmd = &cobra.Command{ Use: "version", - Short: "runpodctl version", - Long: "runpodctl version", + Short: "runpod cli version", + Long: "runpod cli version", Run: func(c *cobra.Command, args []string) { - fmt.Println("runpodctl " + version) + fmt.Println("runpod " + version) }, } diff --git a/doc/runpod.md b/doc/runpod.md new file mode 100644 index 0000000..868d39a --- /dev/null +++ b/doc/runpod.md @@ -0,0 +1,29 @@ +## runpod + +CLI for runpod.io + +### Synopsis + +CLI tool to manage your pods for runpod.io + +### Options + +``` + -h, --help help for runpod +``` + +### SEE ALSO + +* [runpod config](runpod_config.md) - CLI Config +* [runpod create](runpod_create.md) - create a resource +* [runpod get](runpod_get.md) - get resource +* [runpod project](runpod_project.md) - manage projects +* [runpod receive](runpod_receive.md) - receive file(s), or folder +* [runpod remove](runpod_remove.md) - remove a resource +* [runpod send](runpod_send.md) - send file(s), or folder +* [runpod start](runpod_start.md) - start a resource +* [runpod stop](runpod_stop.md) - stop a resource +* [runpod update](runpod_update.md) - update runpod cli +* [runpod version](runpod_version.md) - runpod cli version + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_config.md b/doc/runpod_config.md similarity index 59% rename from doc/runpodctl_config.md rename to doc/runpod_config.md index ebbd87d..93b2d76 100644 --- a/doc/runpodctl_config.md +++ b/doc/runpod_config.md @@ -1,4 +1,4 @@ -## runpodctl config +## runpod config CLI Config @@ -7,7 +7,7 @@ CLI Config RunPod CLI Config Settings ``` -runpodctl config [flags] +runpod config [flags] ``` ### Options @@ -20,6 +20,6 @@ runpodctl config [flags] ### SEE ALSO -* [runpodctl](runpodctl.md) - runpodctl for runpod.io +* [runpod](runpod.md) - CLI for runpod.io -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_create.md b/doc/runpod_create.md new file mode 100644 index 0000000..1587abc --- /dev/null +++ b/doc/runpod_create.md @@ -0,0 +1,21 @@ +## runpod create + +create a resource + +### Synopsis + +create a resource in runpod.io + +### Options + +``` + -h, --help help for create +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod create pod](runpod_create_pod.md) - start a pod +* [runpod create pods](runpod_create_pods.md) - create a group of pods + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_create_pod.md b/doc/runpod_create_pod.md similarity index 88% rename from doc/runpodctl_create_pod.md rename to doc/runpod_create_pod.md index 2a43832..4cbd9ee 100644 --- a/doc/runpodctl_create_pod.md +++ b/doc/runpod_create_pod.md @@ -1,4 +1,4 @@ -## runpodctl create pod +## runpod create pod start a pod @@ -7,7 +7,7 @@ start a pod start a pod from runpod.io ``` -runpodctl create pod [flags] +runpod create pod [flags] ``` ### Options @@ -34,6 +34,6 @@ runpodctl create pod [flags] ### SEE ALSO -* [runpodctl create](runpodctl_create.md) - create a resource +* [runpod create](runpod_create.md) - create a resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_create_pods.md b/doc/runpod_create_pods.md similarity index 88% rename from doc/runpodctl_create_pods.md rename to doc/runpod_create_pods.md index f2e3ece..cd2ea87 100644 --- a/doc/runpodctl_create_pods.md +++ b/doc/runpod_create_pods.md @@ -1,4 +1,4 @@ -## runpodctl create pods +## runpod create pods create a group of pods @@ -7,7 +7,7 @@ create a group of pods create a group of pods on runpod.io ``` -runpodctl create pods [flags] +runpod create pods [flags] ``` ### Options @@ -34,6 +34,6 @@ runpodctl create pods [flags] ### SEE ALSO -* [runpodctl create](runpodctl_create.md) - create a resource +* [runpod create](runpod_create.md) - create a resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_get.md b/doc/runpod_get.md new file mode 100644 index 0000000..9d36e9d --- /dev/null +++ b/doc/runpod_get.md @@ -0,0 +1,21 @@ +## runpod get + +get resource + +### Synopsis + +get resources for pods + +### Options + +``` + -h, --help help for get +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod get cloud](runpod_get_cloud.md) - get all cloud gpus +* [runpod get pod](runpod_get_pod.md) - get all pods + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_get_cloud.md b/doc/runpod_get_cloud.md similarity index 72% rename from doc/runpodctl_get_cloud.md rename to doc/runpod_get_cloud.md index c2198c1..fe45158 100644 --- a/doc/runpodctl_get_cloud.md +++ b/doc/runpod_get_cloud.md @@ -1,4 +1,4 @@ -## runpodctl get cloud +## runpod get cloud get all cloud gpus @@ -7,7 +7,7 @@ get all cloud gpus get all cloud gpus available on runpod.io ``` -runpodctl get cloud [gpuCount] [flags] +runpod get cloud [gpuCount] [flags] ``` ### Options @@ -23,6 +23,6 @@ runpodctl get cloud [gpuCount] [flags] ### SEE ALSO -* [runpodctl get](runpodctl_get.md) - get resource +* [runpod get](runpod_get.md) - get resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_get_pod.md b/doc/runpod_get_pod.md similarity index 54% rename from doc/runpodctl_get_pod.md rename to doc/runpod_get_pod.md index f97b784..90f3b9b 100644 --- a/doc/runpodctl_get_pod.md +++ b/doc/runpod_get_pod.md @@ -1,4 +1,4 @@ -## runpodctl get pod +## runpod get pod get all pods @@ -7,7 +7,7 @@ get all pods get all pods or specify pod id ``` -runpodctl get pod [podId] [flags] +runpod get pod [podId] [flags] ``` ### Options @@ -19,6 +19,6 @@ runpodctl get pod [podId] [flags] ### SEE ALSO -* [runpodctl get](runpodctl_get.md) - get resource +* [runpod get](runpod_get.md) - get resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_project.md b/doc/runpod_project.md new file mode 100644 index 0000000..be91dc7 --- /dev/null +++ b/doc/runpod_project.md @@ -0,0 +1,23 @@ +## runpod project + +manage projects + +### Synopsis + +Project management for Runpod projects + +### Options + +``` + -h, --help help for project +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod project build](runpod_project_build.md) - build Dockerfile for current project +* [runpod project deploy](runpod_project_deploy.md) - deploy current project +* [runpod project dev](runpod_project_dev.md) - start current project +* [runpod project new](runpod_project_new.md) - create a new project + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_project_build.md b/doc/runpod_project_build.md new file mode 100644 index 0000000..5417036 --- /dev/null +++ b/doc/runpod_project_build.md @@ -0,0 +1,24 @@ +## runpod project build + +build Dockerfile for current project + +### Synopsis + +build a Dockerfile for the Runpod project in the current folder + +``` +runpod project build [flags] +``` + +### Options + +``` + -h, --help help for build + --include-env include environment variables from runpod.toml in generated Dockerfile +``` + +### SEE ALSO + +* [runpod project](runpod_project.md) - manage projects + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_project_deploy.md b/doc/runpod_project_deploy.md new file mode 100644 index 0000000..e48aa7c --- /dev/null +++ b/doc/runpod_project_deploy.md @@ -0,0 +1,23 @@ +## runpod project deploy + +deploy current project + +### Synopsis + +deploy an endpoint for the Runpod project in the current folder + +``` +runpod project deploy [flags] +``` + +### Options + +``` + -h, --help help for deploy +``` + +### SEE ALSO + +* [runpod project](runpod_project.md) - manage projects + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_project_dev.md b/doc/runpod_project_dev.md new file mode 100644 index 0000000..32d92df --- /dev/null +++ b/doc/runpod_project_dev.md @@ -0,0 +1,25 @@ +## runpod project dev + +start current project + +### Synopsis + +start a development pod session for the Runpod project in the current folder + +``` +runpod project dev [flags] +``` + +### Options + +``` + -h, --help help for dev + --prefix-pod-logs prefix logs from development pod with pod id (default true) + --select-volume select a new default network volume for current project +``` + +### SEE ALSO + +* [runpod project](runpod_project.md) - manage projects + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_project_new.md b/doc/runpod_project_new.md new file mode 100644 index 0000000..9a7f606 --- /dev/null +++ b/doc/runpod_project_new.md @@ -0,0 +1,25 @@ +## runpod project new + +create a new project + +### Synopsis + +create a new Runpod project folder + +``` +runpod project new [flags] +``` + +### Options + +``` + -h, --help help for new + -i, --init use the current directory as the project directory + -n, --name string project name +``` + +### SEE ALSO + +* [runpod project](runpod_project.md) - manage projects + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_receive.md b/doc/runpod_receive.md similarity index 52% rename from doc/runpodctl_receive.md rename to doc/runpod_receive.md index 2c20178..ef0b1aa 100644 --- a/doc/runpodctl_receive.md +++ b/doc/runpod_receive.md @@ -1,4 +1,4 @@ -## runpodctl receive +## runpod receive receive file(s), or folder @@ -7,7 +7,7 @@ receive file(s), or folder receive file(s), or folder from pod or any computer ``` -runpodctl receive [code] [flags] +runpod receive [code] [flags] ``` ### Options @@ -18,6 +18,6 @@ runpodctl receive [code] [flags] ### SEE ALSO -* [runpodctl](runpodctl.md) - runpodctl for runpod.io +* [runpod](runpod.md) - CLI for runpod.io -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_remove.md b/doc/runpod_remove.md new file mode 100644 index 0000000..a34a494 --- /dev/null +++ b/doc/runpod_remove.md @@ -0,0 +1,21 @@ +## runpod remove + +remove a resource + +### Synopsis + +remove a resource in runpod.io + +### Options + +``` + -h, --help help for remove +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod remove pod](runpod_remove_pod.md) - remove a pod +* [runpod remove pods](runpod_remove_pods.md) - remove all pods using name + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_remove_pod.md b/doc/runpod_remove_pod.md new file mode 100644 index 0000000..1a262ff --- /dev/null +++ b/doc/runpod_remove_pod.md @@ -0,0 +1,23 @@ +## runpod remove pod + +remove a pod + +### Synopsis + +remove a pod from runpod.io + +``` +runpod remove pod [podId] [flags] +``` + +### Options + +``` + -h, --help help for pod +``` + +### SEE ALSO + +* [runpod remove](runpod_remove.md) - remove a resource + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_remove_pods.md b/doc/runpod_remove_pods.md similarity index 58% rename from doc/runpodctl_remove_pods.md rename to doc/runpod_remove_pods.md index a01039c..20931f6 100644 --- a/doc/runpodctl_remove_pods.md +++ b/doc/runpod_remove_pods.md @@ -1,4 +1,4 @@ -## runpodctl remove pods +## runpod remove pods remove all pods using name @@ -7,7 +7,7 @@ remove all pods using name remove all pods using name from runpod.io ``` -runpodctl remove pods [name] [flags] +runpod remove pods [name] [flags] ``` ### Options @@ -19,6 +19,6 @@ runpodctl remove pods [name] [flags] ### SEE ALSO -* [runpodctl remove](runpodctl_remove.md) - remove a resource +* [runpod remove](runpod_remove.md) - remove a resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_send.md b/doc/runpod_send.md similarity index 56% rename from doc/runpodctl_send.md rename to doc/runpod_send.md index 2889d05..6bb2c1a 100644 --- a/doc/runpodctl_send.md +++ b/doc/runpod_send.md @@ -1,4 +1,4 @@ -## runpodctl send +## runpod send send file(s), or folder @@ -7,7 +7,7 @@ send file(s), or folder send file(s), or folder to pod or any computer ``` -runpodctl send [filename(s) or folder] [flags] +runpod send [filename(s) or folder] [flags] ``` ### Options @@ -19,6 +19,6 @@ runpodctl send [filename(s) or folder] [flags] ### SEE ALSO -* [runpodctl](runpodctl.md) - runpodctl for runpod.io +* [runpod](runpod.md) - CLI for runpod.io -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_start.md b/doc/runpod_start.md new file mode 100644 index 0000000..80b991d --- /dev/null +++ b/doc/runpod_start.md @@ -0,0 +1,20 @@ +## runpod start + +start a resource + +### Synopsis + +start a resource in runpod.io + +### Options + +``` + -h, --help help for start +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod start pod](runpod_start_pod.md) - start a pod + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl_start_pod.md b/doc/runpod_start_pod.md similarity index 52% rename from doc/runpodctl_start_pod.md rename to doc/runpod_start_pod.md index b34de1e..33ce35a 100644 --- a/doc/runpodctl_start_pod.md +++ b/doc/runpod_start_pod.md @@ -1,4 +1,4 @@ -## runpodctl start pod +## runpod start pod start a pod @@ -7,7 +7,7 @@ start a pod start a pod from runpod.io ``` -runpodctl start pod [podId] [flags] +runpod start pod [podId] [flags] ``` ### Options @@ -19,6 +19,6 @@ runpodctl start pod [podId] [flags] ### SEE ALSO -* [runpodctl start](runpodctl_start.md) - start a resource +* [runpod start](runpod_start.md) - start a resource -###### Auto generated by spf13/cobra on 8-Apr-2023 +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_stop.md b/doc/runpod_stop.md new file mode 100644 index 0000000..2f1261b --- /dev/null +++ b/doc/runpod_stop.md @@ -0,0 +1,20 @@ +## runpod stop + +stop a resource + +### Synopsis + +stop a resource in runpod.io + +### Options + +``` + -h, --help help for stop +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io +* [runpod stop pod](runpod_stop_pod.md) - stop a pod + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_stop_pod.md b/doc/runpod_stop_pod.md new file mode 100644 index 0000000..e77824f --- /dev/null +++ b/doc/runpod_stop_pod.md @@ -0,0 +1,23 @@ +## runpod stop pod + +stop a pod + +### Synopsis + +stop a pod from runpod.io + +``` +runpod stop pod [podId] [flags] +``` + +### Options + +``` + -h, --help help for pod +``` + +### SEE ALSO + +* [runpod stop](runpod_stop.md) - stop a resource + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_update.md b/doc/runpod_update.md new file mode 100644 index 0000000..55d6b3b --- /dev/null +++ b/doc/runpod_update.md @@ -0,0 +1,23 @@ +## runpod update + +update runpod cli + +### Synopsis + +update runpod cli to the latest version + +``` +runpod update [flags] +``` + +### Options + +``` + -h, --help help for update +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpod_version.md b/doc/runpod_version.md new file mode 100644 index 0000000..22ffafa --- /dev/null +++ b/doc/runpod_version.md @@ -0,0 +1,23 @@ +## runpod version + +runpod cli version + +### Synopsis + +runpod cli version + +``` +runpod version [flags] +``` + +### Options + +``` + -h, --help help for version +``` + +### SEE ALSO + +* [runpod](runpod.md) - CLI for runpod.io + +###### Auto generated by spf13/cobra on 26-Jan-2024 diff --git a/doc/runpodctl.md b/doc/runpodctl.md deleted file mode 100644 index ef66a28..0000000 --- a/doc/runpodctl.md +++ /dev/null @@ -1,27 +0,0 @@ -## runpodctl - -runpodctl for runpod.io - -### Synopsis - -runpodctl is a CLI tool to manage your pods for runpod.io - -### Options - -``` - -h, --help help for runpodctl -``` - -### SEE ALSO - -* [runpodctl config](runpodctl_config.md) - CLI Config -* [runpodctl create](runpodctl_create.md) - create a resource -* [runpodctl get](runpodctl_get.md) - get resource -* [runpodctl receive](runpodctl_receive.md) - receive file(s), or folder -* [runpodctl remove](runpodctl_remove.md) - remove a resource -* [runpodctl send](runpodctl_send.md) - send file(s), or folder -* [runpodctl start](runpodctl_start.md) - start a resource -* [runpodctl stop](runpodctl_stop.md) - stop a resource -* [runpodctl version](runpodctl_version.md) - runpodctl version - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_create.md b/doc/runpodctl_create.md deleted file mode 100644 index 4bed47a..0000000 --- a/doc/runpodctl_create.md +++ /dev/null @@ -1,21 +0,0 @@ -## runpodctl create - -create a resource - -### Synopsis - -create a resource in runpod.io - -### Options - -``` - -h, --help help for create -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io -* [runpodctl create pod](runpodctl_create_pod.md) - start a pod -* [runpodctl create pods](runpodctl_create_pods.md) - create a group of pods - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_get.md b/doc/runpodctl_get.md deleted file mode 100644 index 6c61d25..0000000 --- a/doc/runpodctl_get.md +++ /dev/null @@ -1,21 +0,0 @@ -## runpodctl get - -get resource - -### Synopsis - -get resources for pods - -### Options - -``` - -h, --help help for get -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io -* [runpodctl get cloud](runpodctl_get_cloud.md) - get all cloud gpus -* [runpodctl get pod](runpodctl_get_pod.md) - get all pods - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_remove.md b/doc/runpodctl_remove.md deleted file mode 100644 index 64786e2..0000000 --- a/doc/runpodctl_remove.md +++ /dev/null @@ -1,21 +0,0 @@ -## runpodctl remove - -remove a resource - -### Synopsis - -remove a resource in runpod.io - -### Options - -``` - -h, --help help for remove -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io -* [runpodctl remove pod](runpodctl_remove_pod.md) - remove a pod -* [runpodctl remove pods](runpodctl_remove_pods.md) - remove all pods using name - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_remove_pod.md b/doc/runpodctl_remove_pod.md deleted file mode 100644 index 8d4bda2..0000000 --- a/doc/runpodctl_remove_pod.md +++ /dev/null @@ -1,23 +0,0 @@ -## runpodctl remove pod - -remove a pod - -### Synopsis - -remove a pod from runpod.io - -``` -runpodctl remove pod [podId] [flags] -``` - -### Options - -``` - -h, --help help for pod -``` - -### SEE ALSO - -* [runpodctl remove](runpodctl_remove.md) - remove a resource - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_start.md b/doc/runpodctl_start.md deleted file mode 100644 index 80859dd..0000000 --- a/doc/runpodctl_start.md +++ /dev/null @@ -1,20 +0,0 @@ -## runpodctl start - -start a resource - -### Synopsis - -start a resource in runpod.io - -### Options - -``` - -h, --help help for start -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io -* [runpodctl start pod](runpodctl_start_pod.md) - start a pod - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_stop.md b/doc/runpodctl_stop.md deleted file mode 100644 index 62d1ec1..0000000 --- a/doc/runpodctl_stop.md +++ /dev/null @@ -1,20 +0,0 @@ -## runpodctl stop - -stop a resource - -### Synopsis - -stop a resource in runpod.io - -### Options - -``` - -h, --help help for stop -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io -* [runpodctl stop pod](runpodctl_stop_pod.md) - stop a pod - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_stop_pod.md b/doc/runpodctl_stop_pod.md deleted file mode 100644 index 6604419..0000000 --- a/doc/runpodctl_stop_pod.md +++ /dev/null @@ -1,23 +0,0 @@ -## runpodctl stop pod - -stop a pod - -### Synopsis - -stop a pod from runpod.io - -``` -runpodctl stop pod [podId] [flags] -``` - -### Options - -``` - -h, --help help for pod -``` - -### SEE ALSO - -* [runpodctl stop](runpodctl_stop.md) - stop a resource - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/doc/runpodctl_version.md b/doc/runpodctl_version.md deleted file mode 100644 index 731afe3..0000000 --- a/doc/runpodctl_version.md +++ /dev/null @@ -1,23 +0,0 @@ -## runpodctl version - -runpodctl version - -### Synopsis - -runpodctl version - -``` -runpodctl version [flags] -``` - -### Options - -``` - -h, --help help for version -``` - -### SEE ALSO - -* [runpodctl](runpodctl.md) - runpodctl for runpod.io - -###### Auto generated by spf13/cobra on 8-Apr-2023 diff --git a/install.sh b/install.sh index 5c6ef33..373798e 100644 --- a/install.sh +++ b/install.sh @@ -118,7 +118,7 @@ download_url_constructor() { # ---------------------------- Download & Install ---------------------------- # download_and_install_cli() { - local cli_file_name="runpodctl" + local cli_file_name="runpod" if ! wget -q --show-progress "$DOWNLOAD_URL" -O "$cli_file_name"; then echo "Failed to download $cli_file_name." exit 1 diff --git a/makefile b/makefile index ed4bf06..1c96253 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,16 @@ .PHONY: proto +build-linux: + env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpod . + dev: - env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl . + env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpod . windows: - env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl.exe . + env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpod.exe . + +dev-amd64: + env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpod . + + lint: golangci-lint run