Skip to content

do not merge #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
86 changes: 86 additions & 0 deletions .cursor/rules/google-style-guide.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
description:
globs:
alwaysApply: true
---
---
description: |
Enforce Google's Developer Style Guide principles for technical documentation.
These rules guide the AI to create clear, consistent, and user-friendly documentation.
globs:
- "*.md"
- "*.mdx"
- "*.txt"
---

# Google Developer Style Guide for Technical Documentation

## Document Structure
- Always use sentence case for all Markdown headings (e.g., '# This is a heading' not '# This Is A Heading').
- Begin each main section with a brief one or two sentence overview that summarizes the section's content.
- Organize content into logical sections with clear and concise headings and subheadings.
- Structure the documentation in a hierarchical manner, using heading levels (# for main titles, ## for sections, ### for subsections).

## Lists and Formatting
- Use Markdown numbered lists (1., 2., etc.) for sequential steps or ordered procedures.
- Use Markdown unordered lists (-, *, etc.) for collections of related items that don't have a specific order.
- Format code-related text using Markdown code blocks with the appropriate language identifier for syntax highlighting:

```python
def example_function():
return "Hello, world!"
```
- Format UI elements such as button labels and menu items using bold Markdown syntax (**UI Element**).
- Use italic text (*text*) sparingly, primarily for emphasis, terms, or book titles.
- Present pairs of related data (like terms and definitions) using description lists or bold terms followed by their explanations.
- Use unambiguous date formatting, preferably YYYY-MM-DD.

## Language and Tone
- Always address the reader using the second person pronoun "you" instead of "we" or "us".
- Prefer active voice in sentences. For example, instead of "The file was saved by the system," write "The system saved the file."
- Maintain a friendly, conversational, and helpful tone, similar to explaining a concept to a colleague.
- Use standard American English spelling and punctuation consistently.
- Avoid highly technical jargon without providing clear explanations or definitions.
- Be mindful of using idioms or culturally specific references that might not be universally understood.
- Avoid unnecessary repetition of adjectives and adverbs.
- Write in a clear, concise, and factual manner, avoiding overly casual or promotional language.

## Links and References
- When creating hyperlinks using Markdown, ensure the link text clearly describes the target page (e.g., [Learn more about the API](mdc:url)).
- Prioritize linking to official documentation, well-established technical websites, or academic resources.
- For fundamental concepts crucial to understanding the current topic, provide a brief explanation within the documentation rather than immediately linking externally.
- Reserve external links for more detailed or supplementary information.

## Code Examples
- Always enclose code examples in Markdown code blocks using triple backticks (```) and specify the programming language.
- Precede every code block with a brief paragraph explaining its context and purpose.
- Follow the code block with an explanation of its key parts and expected output.
- Provide substantial, real-world code examples that demonstrate complete or significant functionality rather than isolated snippets.
- If the code example pertains to a specific file or directory, mention its location relative to the project root.

## Images and Diagrams
- When including images or diagrams, use Markdown image syntax and provide descriptive alt text: ![Alt text describing the image](mdc:image.png)
- Prefer PNG format for diagrams and illustrations, and WebP format for other images where appropriate.
- Ensure all images serve a purpose and enhance understanding of the content.

## Warnings, Notes, and Important Information
- Format warnings using Markdown blockquotes with a clear prefix:
> :::warning

This action cannont be undone.

:::

- Format notes using Markdown blockquotes:
> :::warning

Additional configuration may be required for custom installations.

:::
- Keep warning, note, and important information messages brief and to the point, focusing on essential information.

## Step-by-Step Instructions
- Present step-by-step instructions using Markdown numbered lists.
- Begin each step with a clear action verb (e.g., "Click", "Open", "Enter").
- Ensure each step represents a single, actionable task.
- Provide sufficient detail for the target audience to understand and execute each action without requiring additional assumptions.
67 changes: 31 additions & 36 deletions docs/sdks/go/overview.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
---
title: Overview
sidebar_position: 1
description: "Get started with RunPod Go SDK for building web applications, server-side implementations, and automating tasks. Learn how to install, configure, and secure your API key."
---

Get started with setting up your RunPod projects using Go.
Whether you're building web applications, server-side implementations, or automating tasks, the RunPod Go SDK provides the tools you need.
This guide outlines the steps to get your development environment ready and integrate RunPod into your Go projects.
This guide helps you set up and use the RunPod Go SDK in your projects. You'll learn how to install the SDK, configure your environment, and integrate RunPod into your Go applications.

## Prerequisites

Before you begin, ensure that you have the following:
Before you begin, ensure you have:

- Go installed on your machine (version 1.16 or later)
- A RunPod account with an API key and Endpoint Id
- Go 1.16 or later installed
- A RunPod account with an API key and endpoint ID

## Install the RunPod SDK {#install}
## Install the SDK

Before integrating RunPod into your project, you'll need to install the SDK.
To install the RunPod SDK in your project:

To install the RunPod SDK, run the following `go get` command in your project directory.
1. Run this command in your project directory:
```bash
go get github.com/runpod/go-sdk
```

```command
go get github.com/runpod/go-sdk
```

This command installs the `runpod-sdk` package.
Then run the following command to install the dependencies:

```command
go mod tidy
```

For more details about the package, visit the [Go package page](https://pkg.go.dev/github.com/runpod/go-sdk/pkg/sdk) or the [GitHub repository](https://github.com/runpod/go-sdk).
2. Install dependencies:
```bash
go mod tidy
```

## Add your API key
For more details, visit:
- [Go package documentation](https://pkg.go.dev/github.com/runpod/go-sdk/pkg/sdk)
- [GitHub repository](https://github.com/runpod/go-sdk)

To use the RunPod SDK in your project, you first need to import it and configure it with your API key and endpoint ID. Ensure these values are securely stored, preferably as environment variables.
## Configure your environment

Below is a basic example of how to initialize and use the RunPod SDK in your Go project.
Set up your API key and endpoint ID in your Go application:

```go
func main() {
Expand All @@ -54,21 +50,20 @@ func main() {
}
```

This snippet demonstrates how to import the SDK, initialize it with your API key, and reference a specific endpoint using its ID.

### Secure your API key
## Secure your API key

When working with the RunPod SDK, it's essential to secure your API key.
Storing the API key in environment variables is recommended, as shown in the initialization example. This method keeps your key out of your source code and reduces the risk of accidental exposure.
Always store your API key securely:

:::note
- Use environment variables (recommended)
- Avoid storing keys in source code
- Use secure secrets management solutions

Use environment variables or secure secrets management solutions to handle sensitive information like API keys.
> **Note:** Never commit API keys to version control. Use environment variables or secure secrets management solutions to handle sensitive information.

:::
## Next steps

For more information, see the following:
For more information, see:

- [RunPod SDK Go Package](https://pkg.go.dev/github.com/runpod/go-sdk/pkg/sdk)
- [RunPod GitHub Repository](https://github.com/runpod/go-sdk)
- [Endpoints](/sdks/go/endpoints)
- [Endpoints documentation](endpoints.md)
- [Go package documentation](https://pkg.go.dev/github.com/runpod/go-sdk/pkg/sdk)
- [GitHub repository](https://github.com/runpod/go-sdk)
64 changes: 38 additions & 26 deletions docs/sdks/graphql/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,62 @@ sidebar_position: 1
description: "Configure your environment with essential arguments: containerDiskInGb, dockerArgs, env, imageName, name, and volumeInGb, to ensure correct setup and operation of your container."
---

For details on queries, mutations, fields, and inputs, see the [RunPod GraphQL Spec](https://graphql-spec.runpod.io/).
This guide explains the essential configuration arguments for your RunPod environment. For complete API details, see the [RunPod GraphQL Spec](https://graphql-spec.runpod.io/).

When configuring your environment, certain arguments are essential to ensure the correct setup and operation. Below is a detailed overview of each required argument:
## Required arguments

### `containerDiskInGb`
The following arguments are required for proper container setup and operation:

### Container disk size

`containerDiskInGb` specifies the container's disk size in gigabytes:

- **Description**: Specifies the size of the disk allocated for the container in gigabytes. This space is used for the operating system, installed applications, and any data generated or used by the container.
- **Type**: Integer
- **Example**: `10` for a 10 GB disk size.
- **Example**: `10` for a 10 GB disk
- **Use**: Operating system, applications, and container data

### `dockerArgs`
### Docker arguments

`dockerArgs` overrides the container's start command:

- **Description**: If specified, overrides the [container start command](https://docs.docker.com/engine/reference/builder/#cmd). If this argument is not provided, it will rely on the start command provided in the docker image.
- **Type**: String
- **Example**: `sleep infinity` to run the container in the background.
- **Example**: `sleep infinity` for background operation
- **Use**: Custom container startup behavior

### Environment variables

<!--
Contains additional arguments that are passed directly to Docker when starting the container. This can include mount points, network settings, or any other Docker command-line arguments.
-->
`env` sets container environment variables:

### `env`
- **Type**: Dictionary/Object
- **Example**: `{"DATABASE_URL": "postgres://user:password@localhost/dbname"}`
- **Use**: Application configuration and credentials

- **Description**: A set of environment variables to be set within the container. These can configure application settings, external service credentials, or any other configuration data required by the software running in the container.
- **Type**: Dictionary or Object
- **Example**: `{"DATABASE_URL": "postgres://user:password@localhost/dbname"}`.
### Docker image

### `imageName`
`imageName` specifies the container image:

- **Description**: The name of the Docker image to use for the container. This should include the repository name and tag, if applicable.
- **Type**: String
- **Example**: `"nginx:latest"` for the latest version of the Nginx image.
- **Example**: `"nginx:latest"`
- **Use**: Container base image and version

### `name`
### Container name

`name` identifies your container instance:

- **Description**: The name assigned to the container instance. This name is used for identification and must be unique within the context it's being used.
- **Type**: String
- **Example**: `"my-app-container"`.
- **Example**: `"my-app-container"`
- **Use**: Container identification and management

### Persistent volume

### `volumeInGb`
`volumeInGb` defines persistent storage size:

- **Description**: Defines the size of an additional persistent volume in gigabytes. This volume is used for storing data that needs to persist between container restarts or redeployments.
- **Type**: Integer
- **Example**: `5` for a 5GB persistent volume.
- **Example**: `5` for 5GB storage
- **Use**: Data persistence between restarts

## Optional arguments

Ensure that these arguments are correctly specified in your configuration to avoid errors during deployment.
Additional configuration options may be available for specific use cases. See the [RunPod GraphQL Spec](https://graphql-spec.runpod.io/) for details.

Optional arguments may also be available, providing additional customization and flexibility for your setup.
> **Note:** Ensure all required arguments are correctly specified to avoid deployment errors.
63 changes: 34 additions & 29 deletions docs/sdks/javascript/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@ sidebar_position: 1
description: "Get started with RunPod JavaScript SDK, a tool for building web apps, server-side implementations, and automating tasks. Learn how to install, integrate, and secure your API key for seamless development."
---

Get started with setting up your RunPod projects using JavaScript. Whether you're building web applications, server-side implementations, or automating tasks, the RunPod JavaScript SDK provides the tools you need.
This guide outlines the steps to get your development environment ready and integrate RunPod into your JavaScript projects.
This guide helps you set up and use the RunPod JavaScript SDK in your projects. You'll learn how to install the SDK, configure your environment, and integrate RunPod into your JavaScript applications.

## Install the RunPod SDK
## Install the SDK

Before integrating RunPod into your project, you'll need to install the SDK.
Using Node.js and npm (Node Package Manager) simplifies this process.
Ensure you have Node.js and npm installed on your system before proceeding.
To use the RunPod SDK in your project:

To install the RunPod SDK, run the following npm command in your project directory.
1. Ensure you have Node.js and npm installed on your system
2. Run one of these commands in your project directory:

```command
npm install --save runpod-sdk
# or
yarn add runpod-sdk
```
```bash
npm install --save runpod-sdk
# or
yarn add runpod-sdk
```

This installs the `runpod-sdk` package and adds it to your project's `package.json` dependencies.

For more details, visit:
- [npm package page](https://www.npmjs.com/package/runpod-sdk)
- [GitHub repository](https://github.com/runpod/js-sdk)

This command installs the `runpod-sdk` package and adds it to your project's `package.json` dependencies.
For more details about the package, visit the [npm package page](https://www.npmjs.com/package/runpod-sdk) or the [GitHub repository](https://github.com/runpod/js-sdk).
## Configure your environment

## Add your API key
To use the RunPod SDK, you need to:

To use the RunPod SDK in your project, you first need to import it and configure it with your API key and endpoint ID. Ensure these values are securely stored, preferably as environment variables.
1. Import the SDK
2. Configure it with your API key and endpoint ID
3. Store sensitive information securely

Below is a basic example of how to initialize and use the RunPod SDK in your JavaScript project.
Here's how to initialize the SDK:

```javascript
const { RUNPOD_API_KEY, ENDPOINT_ID } = process.env;
Expand All @@ -38,22 +43,22 @@ const runpod = runpodSdk(RUNPOD_API_KEY);
const endpoint = runpod.endpoint(ENDPOINT_ID);
```

This snippet demonstrates how to import the SDK, initialize it with your API key, and reference a specific endpoint using its ID.
Remember, the RunPod SDK uses the ES Module (ESM) system and supports asynchronous operations, making it compatible with modern JavaScript development practices.
The SDK uses ES Modules (ESM) and supports asynchronous operations for modern JavaScript development.

### Secure your API key
## Secure your API key

When working with the RunPod SDK, it's essential to secure your API key.
Storing the API key in environment variables is recommended, as shown in the initialization example. This method keeps your key out of your source code and reduces the risk of accidental exposure.
Always store your API key securely:

:::note
- Use environment variables (recommended)
- Avoid storing keys in source code
- Use secure secrets management solutions

Use environment variables or secure secrets management solutions to handle sensitive information like API keys.
> **Note:** Never commit API keys to version control. Use environment variables or secure secrets management solutions to handle sensitive information.

:::
## Next steps

For more information, see the following:
For more information, see:

- [RunPod SDK npm Package](https://www.npmjs.com/package/runpod-sdk)
- [RunPod GitHub Repository](https://github.com/runpod/js-sdk)
- [Endpoints](/sdks/javascript/endpoints)
- [Endpoints documentation](endpoints.md)
- [npm package documentation](https://www.npmjs.com/package/runpod-sdk)
- [GitHub repository](https://github.com/runpod/js-sdk)
Loading