Loading...
Loading...
Sets up GitOps CI/CD pipelines for TrueFoundry using tfy apply. Supports GitHub Actions, GitLab CI, and Bitbucket Pipelines.
npx skill4agent add truefoundry/tfy-deploy-skills truefoundry-gitops<objective>Routing note: For ambiguous user intents, use the shared clarification templates in references/intent-clarification.md.
tfy applytfy applydeployllm-deployapplicationshelmstatusTFY_BASE_URLTFY_API_KEY.envtfyreferences/prerequisites.mdstatustfy apply --dry-runtfy applytruefoundry-configs/
├── clusters/
│ └── my-cluster/
│ ├── dev-workspace/
│ │ ├── my-api-service.yaml
│ │ ├── my-worker.yaml
│ │ └── my-llm.yaml
│ ├── staging-workspace/
│ │ ├── my-api-service.yaml
│ │ └── my-worker.yaml
│ └── prod-workspace/
│ ├── my-api-service.yaml
│ └── my-worker.yaml
├── integrations/
│ └── custom-integration.yaml
├── teams/
│ └── my-team.yaml
└── virtualaccounts/
└── my-account.yamlnametype: service
name: my-api-service
image:
type: image
image_uri: my-registry/my-app:latest
command: uvicorn main:app --host 0.0.0.0 --port 8000
ports:
- port: 8000
expose: true
protocol: TCP
app_protocol: http
host: my-api-dev.ml.example.truefoundry.cloud
workspace_fqn: my-cluster:dev-workspace
env:
APP_ENV: development
LOG_LEVEL: debug
replicas:
min: 1
max: 3
resources:
cpu_request: 0.5
cpu_limit: 1.0
memory_request: 512
memory_limit: 1024| Setting | Dev | Staging | Prod |
|---|---|---|---|
| 1 | 1 | 2+ |
| 1 | 3 | 10+ |
| 0.25 | 0.5 | 1.0+ |
| 256 | 512 | 1024+ |
| debug | info | warn |
| | | |
| | | |
clusters/my-cluster/
├── dev-workspace/
│ └── my-service.yaml # min resources, 1 replica, debug logging
├── staging-workspace/
│ └── my-service.yaml # moderate resources, autoscaling, info logging
└── prod-workspace/
└── my-service.yaml # full resources, HA replicas, warn loggingtfy applytfy apply# Install TrueFoundry CLI (pin exact version to prevent supply-chain attacks)
pip install 'truefoundry==0.5.3'
# Authenticate (uses TFY_HOST and TFY_API_KEY env vars)
# TFY_HOST is the TrueFoundry platform URL (same as TFY_BASE_URL)
# Dry run — validate without deploying
tfy apply --file path/to/spec.yaml --dry-run
# Apply — deploy the spec
tfy apply --file path/to/spec.yaml# Apply each changed YAML file
while IFS= read -r file; do
[ -z "$file" ] && continue
case "$file" in
*.yaml) ;;
*) echo "Skipping non-yaml path: $file"; continue ;;
esac
# Keep apply scope constrained to your config tree
case "$file" in
truefoundry-configs/*) ;;
*) echo "Skipping out-of-scope path: $file"; continue ;;
esac
echo "Applying $file..."
tfy apply --file "$file"
done < <(git diff --name-only HEAD~1 HEAD -- '*.yaml')# Warn about deleted files
while IFS= read -r file; do
[ -z "$file" ] && continue
echo "WARNING: $file was deleted. Remove the resource manually from the TrueFoundry dashboard."
done < <(git diff --name-only --diff-filter=D HEAD~1 HEAD -- '*.yaml')TFY_HOSTTFY_API_KEYTFY_API_KEYstatusTFY_HOSTTFY_API_KEYtfy apply --dry-runtfy applyTFY_HOSTTFY_API_KEYstatusworkspacesapplicationsllm-deploysecretslogstfy apply returned a validation error.
Check:
- YAML syntax is valid (no tabs, proper indentation)
- Required fields are present (type, name, workspace_fqn)
- Resource references exist (workspace, secrets, etc.)
Run: tfy apply --file spec.yaml --dry-run401 Unauthorized from tfy apply.
Check:
- TFY_HOST is set correctly (the platform URL, e.g., https://your-org.truefoundry.cloud)
- TFY_API_KEY is valid and not expired
- Secrets are configured correctly in your CI providerWorkspace FQN in the spec does not exist.
Check:
- workspace_fqn field matches an existing workspace
- Use the workspaces skill to list available workspacesWorkflow not running on push/PR.
Check:
- File path filters match your YAML file locations
- Branch filters match your default branch name
- CI provider secrets are set (TFY_HOST, TFY_API_KEY)The YAML filename should match the 'name' field inside the spec.
Example: my-service.yaml should contain name: my-service
This is a convention for clarity — tfy apply uses the internal name, not the filename.