Skip to content

Add GitHub build arguments documentation #252

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

Closed
wants to merge 4 commits into from
Closed
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
52 changes: 52 additions & 0 deletions docs/serverless/workers/github-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,58 @@ To deploy a worker from a GitHub repository:

RunPod will build your Docker image and deploy it to your endpoint automatically. You'll be redirected to the endpoint details page when complete.

## GitHub build arguments

When deploying a worker from a GitHub repo, you can use specify build arguments for your Dockerfile using `ARG`, allowing you to parameterize values in your Dockerfile instructions. Unlike environment variables, these variables do not persist into the final container, so they won't affect your handler function code.

You can specify build arguments either in your Dockerfile, or using the RunPod UI.

:::note

For comprehensive information about using `ARG`, refer to the [official Docker documention](https://docs.docker.com/build/building/variables/).

:::

### Using build arguments in your Dockerfile

To use build arguments in your Dockerfile, declare variables using the `ARG` keyword, then reference them using `$` syntax.

For example:

```dockerfile
# Base image from RunPod's container registry
ARG CUDA_VERSION=11.8.0
ARG BASE_VERSION=0.6.3

# Use build arguments to specify the base image version
FROM runpod/base:${BASE_VERSION}-cuda${CUDA_VERSION}
```

You must declare an ARG in your Dockerfile before you can reference it, even if you've defined it in the RunPod UI.

For example, you could declare variables using the UI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like an odd sentence

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for catching, that was supposed to be deleted (and is now)


### Setting build arguments in the RunPod UI

To customize your build arguments without modifying your Dockerfile, you can specify them using the RunPod console.

When [deploying a worker](#deploying-from-github) from GitHub:

1. During the endpoint configuration process, find the **Build Args** section (below **Public Environment Variables**).
2. Enter key-value pairs for your build arguments.
3. These will be passed to your Docker build process.

You must declare an `ARG` in your Dockerfile before you can reference it, even if you've defined it in the RunPod UI:

```dockerfile
# Build arguments defined in the UI must still be declared in your Dockerfile
ARG CUDA_VERSION
ARG BASE_VERSION

# Use build arguments to specify the base image version
FROM runpod/base:${BASE_VERSION}-cuda${CUDA_VERSION}
```

## Monitoring build status

You can monitor your build status in the **Builds** tab of your endpoint detail page. Builds progress through these statuses:
Expand Down