Skip to content

Commit e08bbc3

Browse files
authored
docs: github action and pkg docs (#172)
* docs: github action and pkg docs * chore: implement requested changes
1 parent 446db13 commit e08bbc3

File tree

3 files changed

+128
-1
lines changed

3 files changed

+128
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: pkg
3+
sidebar:
4+
order: 106
5+
---
6+
7+
:::caution
8+
This command is currently limited to python **agent workflows**.
9+
Frontend packaging is **not yet supported**.
10+
:::
11+
12+
The `pkg` command group lets you package and export your application for custom deployments.
13+
Currently it supports exporting a Dockerfile that can be built into an image with any OCI compliant image builder, such as `docker` or `podman`.
14+
15+
16+
## Usage
17+
18+
```bash
19+
llamactl pkg [COMMAND] [options]
20+
```
21+
22+
### Available Commands
23+
24+
- `container` – Generate a minimal, build-ready container file (e.g., `Dockerfile`) for your workflows.
25+
26+
27+
## Command: `container`
28+
29+
```bash
30+
llamactl pkg container [DEPLOYMENT_FILE] [options]
31+
```
32+
33+
Generates a container build file from a given deployment file and user-specified options.
34+
35+
### Options
36+
37+
38+
- `deployment_file` - Path to the deployment file. Defaults to the current directory (`.`)
39+
- `--python-version` - Python version for the base image. If not specified, it's inferred from `.python-version` or `pyproject.toml`; defaults to **3.12** if none found.
40+
- `--port <int>` - Port to expose for the API server. Defaults to 4501.
41+
- `--dockerignore-path` - Path for the generated `.dockerignore` file. Defaults to `.dockerignore`.
42+
- `--overwrite` - Overwrite any existing output files. No default value.
43+
- `--exclude <path>` - Path(s) to exclude from the build (appended to `.dockerignore`). Can be used multiple times. No default value.
44+
- `--output-file` - Path and filename for the generated container build file. Defaults to `Dockerfile`.
45+
- `--help` - Show help for this command and exit. No default value.
46+
47+
### Notes
48+
49+
- The generated `.dockerignore` file automatically excludes common Python-related directories such as:
50+
- Local virtual environments
51+
- Caches
52+
- Files that may contain sensitive data (e.g., `.env`)
53+
- The produced container file is **minimal by design**. It should work for most cases, but you may need to customize it for specific use cases.
54+
55+
### Examples
56+
57+
**1. Create default `Dockerfile` and `.dockerignore`:**
58+
```bash
59+
llamactl pkg container
60+
```
61+
62+
**2. Generate a custom container file with specific name, Python version, and port:**
63+
```bash
64+
llamactl pkg container --output-file Containerfile --python-version 3.14 --port 4502
65+
```
66+
67+
**3. Exclude certain files or directories from the build:**
68+
```bash
69+
llamactl pkg container --exclude .env.local --exclude .github/workflows/ --exclude "*.pdf"
70+
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Continuous Deployment with GitHub Actions
3+
sidebar:
4+
order: 19
5+
---
6+
:::caution
7+
LlamaAgents is currently in alpha. You can try it out locally or [request access by contacting us](https://landing.llamaindex.ai/llamaagents?utm_source=docs).
8+
:::
9+
10+
As described in the [Getting Started](/python/cloud/llamaagents/getting-started) guide, deploying a LlamaAgent to LlamaCloud requires connecting it to a `git` source (specifically, GitHub).
11+
12+
However, when you push changes to GitHub, they are not automatically applied to your LlamaAgent. To keep your deployment in sync with your `git` reference, you must manually run `llamactl deployments update`.
13+
14+
This manual approach provides fine-grained control over when changes to your production branch are deployed, but it may not fit every workflow.
15+
16+
If you prefer to automate the process using continuous deployment, you can use the `run-llama/llamactl-deploy` GitHub Action.
17+
18+
To use this action, you’ll need:
19+
20+
- A LlamaCloud API key
21+
- The Project ID associated with your LlamaAgent deployment
22+
- The ID of the deployed LlamaAgent
23+
24+
Optionally, you can specify a `git` reference for the deployment (such as a commit SHA or branch name).
25+
26+
Here’s an example workflow configuration:
27+
28+
```yaml
29+
name: Update LlamaAgent Deployment
30+
31+
on:
32+
push:
33+
branches:
34+
- main
35+
36+
jobs:
37+
update-deployment:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Update deployment
43+
uses: run-llama/[email protected]
44+
with:
45+
llama-cloud-api-key: ${{ secrets.LLAMA_CLOUD_API_KEY }}
46+
llama-cloud-project-id: ${{ secrets.LLAMA_CLOUD_PROJECT_ID }}
47+
deployment-id: "your-deployment-id"
48+
git-reference: ${{ github.sha }} # optional
49+
```
50+
51+
You can find the reference for this GitHub Action in the [dedicated repository](https://github.com/run-llama/llamactl-deploy).

docs/src/content/docs/llamaagents/llamactl/getting-started.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ When you save, LlamaAgents will verify that it has access to your repository (an
131131
After creation, the TUI will show deployment status and logs.
132132
- You can later use `llamactl deployments get` to view again.
133133
- You can add secrets or change branches with `llamactl deployments edit`.
134-
- If you update your source repo, run `llamactl deployments update` to roll a new version.
134+
- If you update your source repo, run `llamactl deployments update` to roll a new version. If you are interested in automating the deployment updates with GitHub Actions, you can read the [Continuous Deployment guide](/python/cloud/llamaagents/cd-with-github-actions)
135+
136+
## Alternative Ways to Deploy
137+
138+
If you prefer a self-hosted deployments, `llamactl` has utilities to export your workflows to container files, so that you can easily build images and deploy your agent workflow anywhere.
139+
140+
Read more about this in the [`pkg` command reference](/python/cloud/llamaagents/llamactl-reference/commands-pkg).
135141

136142
---
137143

0 commit comments

Comments
 (0)