Skip to content

Commit 53ed2b2

Browse files
Merge branch 'main' into promptless/serverless-pricing-worker-states-edits
2 parents 88f403c + e8d2460 commit 53ed2b2

9 files changed

Lines changed: 422 additions & 70 deletions

File tree

docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"tutorials/pods/run-your-first",
355355
"tutorials/pods/comfyui",
356356
"tutorials/pods/run-ollama",
357-
"tutorials/pods/build-docker-images"
357+
"tutorials/pods/build-docker-images"
358358
]
359359
},
360360
{

release-notes.mdx

Lines changed: 166 additions & 59 deletions
Large diffs are not rendered by default.

serverless/endpoints/endpoint-configurations.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ Number of GPUs assigned to each worker instance. Default is 1. Generally priorit
7777

7878
How long a worker stays active after completing a request before shutting down. You're billed during idle time, but the worker remains warm for immediate processing. Default: 5 seconds.
7979

80+
### Idle endpoint scale-down
81+
82+
Runpod automatically scales down endpoints that go a long time without any requests, so unused endpoints don't keep consuming your account balance.
83+
* After 3 days with no requests, the endpoint's max workers is reduced to 2 and Runpod sends you an email notification.
84+
* After 7 days with no requests, max workers is set to 0.
85+
86+
This scale-down is automatic and system-driven, and the timer is based on request activity, so any incoming request resets it.
87+
88+
Once an endpoint has been scaled down this way, it stays at its reduced max workers until you raise the value yourself. To use the endpoint again, increase its max workers in the Runpod console. To prevent an endpoint from scaling down in the first place, make sure it continues to receive requests.
89+
8090
### Execution timeout
8191

8292
Maximum duration for a single job. When exceeded, the job fails and the worker stops. Keep enabled to prevent runaway jobs. Default: 600s (10 min). Range: 5s to 7 days.

serverless/endpoints/overview.mdx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ Before creating an endpoint, ensure you have a [handler function](/serverless/wo
4444
<Tab title="Web">
4545

4646
1. Navigate to the [Serverless section](https://www.console.runpod.io/serverless) and click **New Endpoint**.
47-
2. Choose your deployment source:
48-
- **Import Git Repository**: See [Deploy from GitHub](/serverless/workers/github-integration)
49-
- **Import from Docker Registry**: See [Deploy from Docker Hub](/serverless/workers/deploy)
50-
- **Ready-to-Deploy Repos**: Select a preconfigured endpoint
51-
3. Configure your endpoint:
52-
- **Endpoint Name** and **Type** (Queue-based or Load balancer)
53-
- **GPU Configuration** and worker settings
47+
2. Choose your deployment path:
48+
- **Hello World**: Runpod forks a starter worker template into a new GitHub repo in your account. Choose Queue-based or Load balancing, then click **Deploy**.
49+
- **Hugging Face LLM**: Search for any text-generation model on Hugging Face (for example, type "Gemma" to find Gemma 4), select it, and click **Create Endpoint**. Runpod deploys a vLLM endpoint for you.
50+
- **Docker**: Deploy from a container image. Select a saved Serverless template to fill in the container configuration automatically, or skip the template and enter an image name manually. See [Deploy from Docker](/serverless/workers/deploy).
51+
- **GitHub**: Select a repository, filtering by code owner if needed. Runpod checks for a Dockerfile and runs a background check on your handler: queue-based endpoints check for handler files, and load balancing endpoints check for a `/ping` path. See [Deploy from GitHub](/serverless/workers/github-integration).
52+
- **Hub**: Opens the Hub browser, where you can browse and deploy prebuilt workers. This replaces the previous "Ready-to-Deploy Repos" option. See [Hub overview](/hub/overview).
53+
- **Flash**: A guided setup flow for [Flash](/flash/overview) that walks you through installing the SDK, initializing your project, and sending your first command. Steps complete automatically as you progress.
54+
3. For the GitHub, Docker, and Hello World paths, configure your endpoint before deploying:
55+
- **Endpoint name** and **type** ([Queue-based](/flash/create-endpoints#queue-based-endpoints) or [Load balancing](/flash/create-endpoints#load-balanced-endpoints))
56+
- **GPU** configuration and worker scaling
5457
- **Model** (optional): Enter a Hugging Face URL for [cached models](/serverless/endpoints/model-caching)
55-
- **Environment Variables**: See [environment variables](/serverless/development/environment-variables)
58+
- **Environment variables** and container configuration. See [environment variables](/serverless/development/environment-variables).
5659
4. Click **Deploy Endpoint**.
5760

5861
</Tab>

serverless/troubleshooting.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ Check the job status response for error details. Common causes:
5151
- **OOM (Out of Memory)**: Model or batch size exceeds GPU memory. Reduce batch size or use a larger GPU.
5252
- **Timeout**: Job exceeded execution timeout. Increase timeout or optimize processing.
5353

54+
## Endpoint scaling issues
55+
56+
### My endpoint was scaled down unexpectedly
57+
58+
If your endpoint's max workers dropped without any change on your end, Runpod scaled the endpoint down automatically. This happens in two situations:
59+
60+
- **Prolonged inactivity**: When an endpoint receives no requests for 3 days, its max workers is reduced to 2, and after 7 days its max workers is set to 0. Runpod emails you when the first reduction happens. For more details, see [idle endpoint scale-down](/serverless/endpoints/endpoint-configurations#idle-endpoint-scale-down).
61+
- **Repeated unhealthy workers**: When an endpoint consistently produces unhealthy (crashing) workers, Runpod scales it down to stop billing and reduce thrashing, and sends you an email.
62+
63+
To bring the endpoint back, increase its max workers in the [Runpod console](https://www.console.runpod.io/serverless). If the scale-down was caused by unhealthy workers, fix the underlying problem first, or the endpoint may be scaled down again. Check the [logs](/serverless/development/logs) for crash errors, and verify your worker using [local testing](/serverless/development/local-testing).
64+
5465
## Cold start issues
5566

5667
### Slow cold starts

serverless/workers/deploy.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Versioning best practices:
7676
* Document the specific image version or SHA in your deployment documentation.
7777
* Keep images as small as possible for faster startup times.
7878

79+
Runpod validates your image name when you create an endpoint, and a reference that doesn't resolve to a published image is rejected at creation time. For example, `runpod/pytorch:latest` is rejected because `:latest` is not a published tag for Runpod's base images. When you deploy a Runpod base image, specify a tag that actually exists. You can browse the available tags for each image on [Docker Hub](https://hub.docker.com/u/runpod). For your own worker images, use a specific version or SHA tag as described above rather than `:latest`.
80+
7981
## Deploy an endpoint
8082

8183
<Tip>

serverless/workers/overview.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ The system may also spin up **extra workers** during traffic spikes when Docker
5656
| **Outdated** | Marked for replacement after update | Yes (while processing) |
5757
| **Unhealthy** | Crashed; auto-retries for up to 7 days | No |
5858

59+
<Note>
60+
If an endpoint repeatedly produces unhealthy workers, Runpod automatically scales it down; see [My endpoint was scaled down unexpectedly](/serverless/troubleshooting#my-endpoint-was-scaled-down-unexpectedly).
61+
</Note>
62+
5963
View worker states in the **Workers** tab of your endpoint in the [Runpod console](https://www.console.runpod.io/serverless).
6064

6165
## Max worker limits
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
---
2+
title: "Use private AWS ECR images"
3+
sidebarTitle: "Private ECR images"
4+
description: "Pull container images from private AWS ECR repositories using cross-account delegation."
5+
tag: "BETA"
6+
hidden: true
7+
---
8+
9+
<Note>
10+
ECR image support is currently in beta. [Join our Discord](https://discord.gg/cUpRmau42V) to provide feedback and get support.
11+
</Note>
12+
13+
import { PodTooltip } from "/snippets/tooltips.jsx";
14+
15+
This tutorial shows how to deploy <PodTooltip />s using container images stored in private AWS Elastic Container Registry (ECR) repositories. You configure cross-account IAM delegation so Runpod can pull images on your behalf — no credential sharing required, and no expiring tokens to manage.
16+
17+
<Note>
18+
This tutorial covers ECR integration for Pods. If you're deploying Serverless workers from ECR, see [Deploying from AWS ECR](/serverless/workers/deploy#deploying-from-aws-ecr) — Serverless endpoints use a different credential mechanism.
19+
</Note>
20+
21+
## What you'll learn
22+
23+
- How to build and push a Docker image to a private ECR repository.
24+
- How to configure an AWS ECR repository policy for cross-account access.
25+
- How to add an ECR credential in the Runpod console.
26+
- How to deploy a <PodTooltip /> using your private ECR image.
27+
28+
## Requirements
29+
30+
- A Runpod account with credits.
31+
- An AWS account with ECR enabled.
32+
- An AWS IAM user or role with `ecr:SetRepositoryPolicy` permission on the repository.
33+
- Your AWS Account ID — a 12-digit number found in the top-right dropdown of the AWS Console.
34+
- Docker installed on your local machine.
35+
- AWS CLI installed (required to push images; optional if your image is already in ECR).
36+
37+
## Step 1: Push your image to ECR
38+
39+
Skip this step if your image is already in ECR.
40+
41+
### Configure AWS CLI credentials
42+
43+
Run the following command and enter your access key, secret key, and session token when prompted:
44+
45+
```bash
46+
aws configure
47+
```
48+
49+
You can find these credentials under **IAM → Security credentials** in the AWS Console.
50+
51+
### Create a private ECR repository
52+
53+
1. Open the [Amazon ECR console](https://console.aws.amazon.com/ecr/).
54+
2. Under **Private registry**, select **Repositories** and click **Create repository**.
55+
3. Enter a name and click **Create repository**.
56+
4. Note the **URI** shown for your new repository — you'll use it in the following steps.
57+
58+
### Build, tag, and push your image
59+
60+
Authenticate Docker with ECR, then build and push your image:
61+
62+
```bash
63+
# Authenticate Docker to your ECR registry
64+
aws ecr get-login-password --region YOUR_REGION | docker login \
65+
--username AWS \
66+
--password-stdin YOUR_ACCOUNT_ID.dkr.ecr.YOUR_REGION.amazonaws.com
67+
68+
# Build your image
69+
docker build -t YOUR_REPOSITORY_NAME .
70+
71+
# Tag it with your ECR URI
72+
docker tag YOUR_REPOSITORY_NAME:latest \
73+
YOUR_ACCOUNT_ID.dkr.ecr.YOUR_REGION.amazonaws.com/YOUR_REPOSITORY_NAME:latest
74+
75+
# Push it
76+
docker push \
77+
YOUR_ACCOUNT_ID.dkr.ecr.YOUR_REGION.amazonaws.com/YOUR_REPOSITORY_NAME:latest
78+
```
79+
80+
Replace `YOUR_ACCOUNT_ID`, `YOUR_REGION`, and `YOUR_REPOSITORY_NAME` with your values.
81+
82+
<Warning>
83+
Avoid using the `latest` tag in production. Runpod warns against it during template creation because `latest` tags are considered unstable. Use a specific version tag for production deployments.
84+
</Warning>
85+
86+
## Step 2: Configure your ECR repository policy
87+
88+
To pull images from your private ECR repository, Runpod needs cross-account access. You grant this by adding an IAM policy to your repository.
89+
90+
1. Open the [Amazon ECR console](https://console.aws.amazon.com/ecr/).
91+
2. Select the repository containing your container image.
92+
3. In the left navigation, select **Permissions**.
93+
4. Click **Edit policy JSON** and add the following policy statement:
94+
95+
```json
96+
{
97+
"Version": "2012-10-17",
98+
"Statement": [
99+
{
100+
"Sid": "AllowRunpodPull",
101+
"Effect": "Allow",
102+
"Principal": "*",
103+
"Action": [
104+
"ecr:GetAuthorizationToken",
105+
"ecr:BatchCheckLayerAvailability",
106+
"ecr:GetDownloadUrlForLayer",
107+
"ecr:BatchGetImage"
108+
],
109+
"Condition": {
110+
"StringEquals": {
111+
"aws:PrincipalArn": "arn:aws:iam::550005742258:role/prod-us-east-1-deployment-role"
112+
}
113+
}
114+
}
115+
]
116+
}
117+
```
118+
119+
5. Click **Save**.
120+
121+
<Note>
122+
The `aws:PrincipalArn` value (`arn:aws:iam::550005742258:role/prod-us-east-1-deployment-role`) is Runpod's fixed AWS deployment role — not something you create or manage. `550005742258` is Runpod's AWS account ID, and this ARN is the same for all Runpod users. Do not modify it. Its permissions are intentionally limited to pulling images only, so Runpod cannot access any other part of your AWS account.
123+
</Note>
124+
125+
<Note>
126+
`ecr:GetAuthorizationToken` is an account-level AWS action, not repository-scoped. If your organization uses Service Control Policies (SCPs), confirm this action is not blocked at the org level.
127+
</Note>
128+
129+
### Alternative: Configure via AWS CLI
130+
131+
```bash
132+
aws ecr set-repository-policy \
133+
--repository-name YOUR_REPOSITORY_NAME \
134+
--policy-text '{
135+
"Version": "2012-10-17",
136+
"Statement": [
137+
{
138+
"Sid": "AllowRunpodPull",
139+
"Effect": "Allow",
140+
"Principal": "*",
141+
"Action": [
142+
"ecr:GetAuthorizationToken",
143+
"ecr:BatchCheckLayerAvailability",
144+
"ecr:GetDownloadUrlForLayer",
145+
"ecr:BatchGetImage"
146+
],
147+
"Condition": {
148+
"StringEquals": {
149+
"aws:PrincipalArn": "arn:aws:iam::550005742258:role/prod-us-east-1-deployment-role"
150+
}
151+
}
152+
}
153+
]
154+
}'
155+
```
156+
157+
Replace `YOUR_REPOSITORY_NAME` with the name of your ECR repository.
158+
159+
## Step 3: Add your ECR credential to Runpod
160+
161+
1. Navigate to [Settings](https://www.runpod.io/console/user/settings) in the Runpod console.
162+
2. Scroll down to **Container Registry Authentication** and click **Add Credential**.
163+
3. Select **AWS ECR** as the registry type.
164+
4. Enter a **Name** for this credential (for example, `my-ecr-repo`).
165+
5. Enter the **ECR Image URI** in the format `ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/REPOSITORY_NAME:TAG`. You must include the tag (for example, `:latest` or `:v1.0.0`). Runpod requires the tag to store the delegation.
166+
6. Click **Create**.
167+
168+
<Warning>
169+
Credential creation fails if the ECR repository policy from Step 2 is not correctly configured. Runpod validates the delegation at registration time — if the policy is missing, the credential is rejected. Set up the policy before proceeding.
170+
</Warning>
171+
172+
## Step 4: Deploy a <PodTooltip /> with your private image
173+
174+
You can deploy using a template or directly from the <PodTooltip /> deploy page.
175+
176+
### Option A: Deploy directly
177+
178+
1. Navigate to [Pods](https://www.runpod.io/console/pods) and select **Deploy**.
179+
2. Choose your GPU configuration.
180+
3. Under **Container Image**, enter your full ECR image URI (for example, `123456789012.dkr.ecr.us-east-2.amazonaws.com/my-app:latest`).
181+
4. Configure any additional settings such as environment variables or exposed ports.
182+
5. Click **Deploy**.
183+
184+
### Option B: Deploy via a template
185+
186+
1. Navigate to [Templates](https://www.runpod.io/console/user/templates).
187+
2. Create a new template or update an existing one.
188+
3. Set the **Container Image** to your ECR image URI.
189+
4. Save the template, then deploy a <PodTooltip /> from it.
190+
191+
Runpod uses the registered credential to authenticate and pull your private image. To confirm the pull succeeded, open your <PodTooltip />'s logs — you should see layer download entries from your ECR registry.
192+
193+
<Check>
194+
You've configured cross-account ECR delegation and deployed a <PodTooltip /> using a private container image.
195+
</Check>
196+
197+
## Troubleshooting
198+
199+
**Credential creation fails:**
200+
- Confirm the repository policy JSON is saved: ECR console → your repository → **Permissions** tab.
201+
- Check that the `aws:PrincipalArn` value matches exactly — no trailing spaces or modified characters.
202+
- Verify your IAM user has `ecr:SetRepositoryPolicy` permission.
203+
204+
**<PodTooltip /> fails to start with an image pull error:**
205+
- Confirm the ECR image URI in the <PodTooltip /> or template matches the one registered in Step 3.
206+
- Check that the image tag exists in your ECR repository.
207+
- Verify the repository policy is applied to the correct repository.
208+
209+
## Next steps
210+
211+
- Learn how to [create custom templates](/pods/templates/create-custom-template) from your container images.
212+
- Explore [environment variables](/pods/templates/environment-variables) for configuring your containers.
213+
- Set up [network volumes](/storage/network-volumes) for persistent storage.

tutorials/serverless/generate-sdxl-turbo.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ async function generateImage() {
248248
if (data && data.output && data.output.images && data.output.images.length > 0) {
249249
const imageBase64 = data.output.images[0].image;
250250
const imageUrl = `data:image/png;base64,${imageBase64}`;
251-
document.getElementById("imageResult").innerHTML =
252-
`<img src="${imageUrl}" alt="Generated Image" />`;
251+
const img = document.createElement("img");
252+
img.src = imageUrl;
253+
img.alt = "Generated Image";
254+
document.getElementById("imageResult").replaceChildren(img);
253255
} else if (data && data.error) {
254256
alert(`Error: ${data.error}`);
255257
} else {

0 commit comments

Comments
 (0)