Skip to content

Commit

Permalink
Merge pull request #73 from justinmerrell/add-ctl
Browse files Browse the repository at this point in the history
fix: readme rename
  • Loading branch information
DireLines authored Jan 28, 2024
2 parents 9406cef + aa8fc48 commit d2b2e03
Show file tree
Hide file tree
Showing 46 changed files with 378 additions and 378 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: release
with:
release-type: go
package-name: runpod
package-name: runpodctl
pull-request-title-pattern: release${component} ${version}

- uses: actions/checkout@v2
Expand All @@ -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/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 .
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.exe .
- name: upload linux amd64 release binary
if: ${{ steps.release.outputs.release_created }}
Expand All @@ -42,8 +42,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpod-linux-amd64
asset_name: runpod-linux-amd64
asset_path: bin/runpodctl-linux-amd64
asset_name: runpodctl-linux-amd64
asset_content_type: application/octet-stream

- name: upload darwin amd64 release binary
Expand All @@ -53,8 +53,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpod-darwin-amd64
asset_name: runpod-darwin-amd64
asset_path: bin/runpodctl-darwin-amd64
asset_name: runpodctl-darwin-amd64
asset_content_type: application/octet-stream

- name: upload darwin arm64 release binary
Expand All @@ -64,8 +64,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpod-darwin-arm64
asset_name: runpod-darwin-arm64
asset_path: bin/runpodctl-darwin-arm64
asset_name: runpodctl-darwin-arm64
asset_content_type: application/octet-stream

- name: upload windows amd64 release binary
Expand All @@ -75,6 +75,6 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpod-windows-amd64.exe
asset_name: runpod-windows-amd64.exe
asset_path: bin/runpodctl-windows-amd64.exe
asset_name: runpodctl-windows-amd64.exe
asset_content_type: application/octet-stream
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# RunPod CLI

The CLI tool to automate / manage GPU pods for [runpod.io](https://runpod.io).
runpodctl is the CLI tool to automate / manage GPU pods for [runpod.io](https://runpod.io).

*Note: All pods automatically come with runpod cli installed with a pod-scoped API key.*
*Note: All pods automatically come with runpodctl installed with a pod-scoped API key.*

</div>

Expand Down Expand Up @@ -40,27 +40,27 @@ wget cli.runpod.net | sudo bash

```bash
# Using homebrew
brew tap runpod/runpod
brew install runpod
brew tap runpod/runpodctl
brew install runpodctl
```

#### Windows PowerShell

```powershell
wget https://github.com/runpod/runpodctl/releases/download/v1.9.0/runpod-windows-amd64.exe -O runpod.exe
wget https://github.com/runpod/runpodctl/releases/download/v1.9.0/runpodctl-windows-amd64.exe -O runpodctl.exe
```

## Tutorial

Please checkout this [video tutorial](https://www.youtube.com/watch?v=QN1vdGhjcRc) for a detailed walkthrough of runpod cli.
Please checkout this [video tutorial](https://www.youtube.com/watch?v=QN1vdGhjcRc) for a detailed walkthrough of runpodctl.

**Video Chapters:**

- [Installing the latest version of RunPod CLI](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=1384s)
- [Installing the latest version of runpodctl](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=1384s)
- [Uploading large datasets](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=2068s)
- [File transfers from PC to RunPod](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=2106s)
- [Downloading folders from RunPod](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=2549s)
- [Adding RunPod CLI to your environment path](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=2589s)
- [Adding runpodctl to your environment path](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=2589s)
- [Downloading model files](https://www.youtube.com/watch?v=QN1vdGhjcRc&t=4871s)

## Transferring Data (file send/receive)
Expand All @@ -72,7 +72,7 @@ Run the following on the computer that has the file you want to send
### To send a file

```bash
runpod send data.txt
runpodctl send data.txt
```

*Example output:*
Expand All @@ -82,13 +82,13 @@ Sending 'data.txt' (5 B)
Code is: 8338-galileo-collect-fidel
On the other computer run

runpod receive 8338-galileo-collect-fidel
runpodctl receive 8338-galileo-collect-fidel
```

### To receive a file

```bash
runpod receive 8338-galileo-collect-fidel
runpodctl receive 8338-galileo-collect-fidel
```

*Example output:*
Expand All @@ -114,23 +114,23 @@ Before using pod commands, configure the API key obtained from your [RunPod acco

```bash
# configure API key
runpod config --apiKey={key}
runpodctl config --apiKey={key}

# Get all pods
runpod get pod
runpodctl get pod

# Get a pod
runpod get pod {podId}
runpodctl get pod {podId}

# Start an ondemand pod.
runpod start pod {podId}
runpodctl start pod {podId}

# Start a spot pod with bid.
# The bid price you set is the price you will pay if not outbid:
runpod start pod {podId} --bid=0.3
runpodctl start pod {podId} --bid=0.3

# Stop a pod
runpod stop pod {podId}
runpodctl stop pod {podId}
```

For a comprehensive list of commands, visit [RunPod CLI documentation](doc/runpod.md).
Expand Down
2 changes: 1 addition & 1 deletion cmd/croc/croc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\nrunpod 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\nrunpodctl 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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/project/exampleDockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AUTOGENERATED Dockerfile using RunPod CLI project build
# AUTOGENERATED Dockerfile using runpodctl project build

# Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile
# DockerHub -> https://hub.docker.com/r/runpod/base/tags
Expand Down
4 changes: 2 additions & 2 deletions cmd/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Project Summary:
pythonVersion, modelType, modelName, initCurrentDir)
fmt.Printf("Project %s created successfully!", projectName)
fmt.Println()
fmt.Println("From your project root run `runpod project dev` to start a development pod.")
fmt.Println("From your project root run `runpodctl project dev` to start a development pod.")
},
}

Expand Down Expand Up @@ -228,7 +228,7 @@ var BuildProjectCmd = &cobra.Command{
Use: "build",
Args: cobra.ExactArgs(0),
Short: "build Dockerfile for current project",
Long: "build a Dockerfile for the Runpod project in the current folder",
Long: "build a Dockerfile for the RunPod project in the current folder",
Run: func(cmd *cobra.Command, args []string) {
buildProjectDockerfile()
// config := loadProjectConfig()
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ var version string

// rootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "runpod",
Aliases: []string{"runpodctl"},
Use: "runpodctl",
Aliases: []string{"runpod"},
Short: "CLI for runpod.io",
Long: "CLI tool to manage your pods for runpod.io",
}
Expand Down Expand Up @@ -73,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 `runpod config` to create it")
fmt.Println("Runpod config file not found, please run `runpodctl config` to create it")
}
viper.SetConfigType("toml")
//make .runpod folder if not exists
Expand Down
16 changes: 8 additions & 8 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ func GetJson(url string) (*GithubApiResponse, error) {

var updateCmd = &cobra.Command{
Use: "update",
Short: "update runpod cli",
Long: "update runpod cli to the latest version",
Short: "update runpodctl",
Long: "update runpodctl 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 runpod cli", err)
fmt.Println("error fetching latest version info for runpodctl", err)
return
}
//find download link for current platform
latestVersion := apiResp.Version
if semver.Compare("v"+version, latestVersion) == -1 {
//version < latest
newBinaryName := fmt.Sprintf("runpod-%s-%s", runtime.GOOS, runtime.GOARCH)
newBinaryName := fmt.Sprintf("runpodctl-%s-%s", runtime.GOOS, runtime.GOARCH)
foundNewBinary := false
var downloadLink string
for _, asset := range apiResp.Assets {
Expand All @@ -107,20 +107,20 @@ var updateCmd = &cobra.Command{
}
exPath := filepath.Dir(ex)
downloadPath := newBinaryName
destFilename := "runpod"
destFilename := "runpodctl"
if runtime.GOOS == "windows" {
destFilename = "runpod.exe"
destFilename = "runpodctl.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 runpod.exe\n", latestVersion, newBinaryName)
fmt.Printf("wget https://github.com/runpod/runpodctl/releases/download/%s/%s -O runpodctl.exe\n", latestVersion, newBinaryName)
}
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 runpod cli", err)
fmt.Println("error fetching the latest version of runpodctl", err)
return
}
//chmod +x
Expand Down
6 changes: 3 additions & 3 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

var versionCmd = &cobra.Command{
Use: "version",
Short: "runpod cli version",
Long: "runpod cli version",
Short: "runpodctl version",
Long: "runpodctl version",
Run: func(c *cobra.Command, args []string) {
fmt.Println("runpod " + version)
fmt.Println("runpodctl " + version)
},
}
29 changes: 0 additions & 29 deletions doc/runpod.md

This file was deleted.

21 changes: 0 additions & 21 deletions doc/runpod_create.md

This file was deleted.

21 changes: 0 additions & 21 deletions doc/runpod_get.md

This file was deleted.

23 changes: 0 additions & 23 deletions doc/runpod_project.md

This file was deleted.

Loading

0 comments on commit d2b2e03

Please sign in to comment.