https://github.com/datarobot-community/af-component-base
Base component for Template Studio
https://github.com/datarobot-community/af-component-base
dr-engineering
Last synced: 28 days ago
JSON representation
Base component for Template Studio
- Host: GitHub
- URL: https://github.com/datarobot-community/af-component-base
- Owner: datarobot-community
- License: apache-2.0
- Created: 2025-03-21T23:19:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-05-27T16:15:26.000Z (about 1 month ago)
- Last Synced: 2026-05-27T18:13:47.464Z (about 1 month ago)
- Topics: dr-engineering
- Language: Python
- Homepage:
- Size: 509 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Authors: AUTHORS
Awesome Lists containing this project
README
af-component-base
Homepage
·
Documentation
·
Support
The base component required for all AF built apps
`af-component-base` is a [copier](https://copier.readthedocs.io/) template that provides the foundational scaffold for every application built with the [DataRobot App Framework](https://af.datarobot.com). It is the first component applied to any new App Framework project.
When applied, it walks you through a short configuration wizard (template name, description, copyright year, and whether to include the shared `core` library), then writes the base project structure and answers file that all other App Framework components build on top of. Answers are stored in `.datarobot/answers/base.yml` and reused by subsequent `copier update` runs.
This component is intended for app developers starting a new App Framework project or bringing an existing project up to the standard structure.
# Table of contents
- [Prerequisites](#prerequisites)
- [Quick start](#quick-start)
- [Component dependencies](#component-dependencies)
- [Local development](#local-development)
- [Updating](#updating)
- [Troubleshooting](#troubleshooting)
- [Next steps and cross-links](#next-steps-and-cross-links)
- [Contributing, changelog, support, and legal](#contributing-changelog-support-and-legal)
# Prerequisites
- Python 3.11+
- [`uv`](https://docs.astral.sh/uv/) installed
- [`dr`](https://cli.datarobot.com) installed
A DataRobot account and environment are required to deploy the resulting application. See [DataRobot getting started](https://docs.datarobot.com/en/docs/get-started/) for account setup.
# Quick start
Run the following command in your project directory:
```bash
dr component add https://github.com/datarobot-community/af-component-base .
```
If you need additional control, you can run this to use copier directly:
```bash
uvx copier copy datarobot-community/af-component-base .
```
The wizard prompts for:
- **Template name**—human-readable display name (e.g. `My Sales Assistant`).
- **Template code name**—auto-derived lowercase slug; override if needed.
- **Template description**—Markdown-compatible description shown in the App Framework gallery.
- **Copyright year**—defaults to the current year.
- **Include core library**—whether to include the shared `core` package for multi-component recipes (default: yes).
# Component dependencies
`af-component-base` has no required component dependencies. It is the root of the App Framework component graph — all other components build on top of it.
## Local development
`af-component-base` is a copier template, not a runnable service. All source files live under `template/`, which copier renders into the target project directory at apply time.
The `copier.yml` at the repo root defines all template questions and their defaults. The answers file path is `.datarobot/answers/base.yml` in the target project. See [AGENTS.md](AGENTS.md) for an agent-oriented orientation to this repo.
### Prerequisites
- [`uv`](https://docs.astral.sh/uv/) — provides `uvx copier`
- [Task](https://taskfile.dev) — task runner (`brew install go-task/tap/go-task` or see [installation](https://taskfile.dev/installation/))
- [`yamlfmt`](https://github.com/google/yamlfmt) — install with `go install github.com/google/yamlfmt/cmd/yamlfmt@latest`
- [`dr`](https://cli.datarobot.com) — the DataRobot CLI (used to run the rendered project's own checks the way end users will)
### Validating a change
The repo root has a `Taskfile.yaml` that renders the template into `mytemplate/` (with the optional `core` library) and `mytemplate-no-core/`, then runs the same checks CI does. The single command to run everything is:
```bash
task validate
```
This renders both `include_core=true` and `include_core=false` variants, runs `yamlfmt -lint` on each, and then runs the rendered project's own `dr task install`, `dr task :lint-check`, and `dr task :test|unit` for the appropriate components. CI (`.github/workflows/validate-template.yaml`) runs the same command across Python 3.11, 3.12, and 3.13.
For fast iteration, run individual subtasks:
```bash
task render:with-core # render mytemplate/ with include_core=true
task render:no-core # render mytemplate-no-core/ with include_core=false
task lint:yaml # yamlfmt -lint on both rendered outputs
task validate:with-core # install + lint-check + test in mytemplate via dr task
task validate:no-core # install + lint-check + test in mytemplate-no-core via dr task
task clean # rm -rf mytemplate mytemplate-no-core
```
For a one-off render outside the Taskfile (e.g. to manually inspect generated output), copier can be invoked directly:
```bash
uvx copier copy . /tmp/my-test-app
```
## Updating
All components should be regularly updated to pick up bug fixes, new features,
and compatibility with the latest DataRobot App Framework.
For automatic updates to the latest version, run the following command in your project directory:
```bash
dr component update .datarobot/answers/base.yml
```
If you need more fine grained control and prefer using copier directly,
you can run this to have more control over the process:
```bash
uvx copier update -a .datarobot/answers/base.yml -A
```
# Troubleshooting
This section covers common issues when applying or updating the component.
**copier asks questions I already answered**
`.datarobot/answers/base.yml` may be missing or out of date. Run the update command with `-A` to skip interactive prompts and use saved answers:
```bash
uvx copier update -a .datarobot/answers/base.yml -A
```
**`dr component add` is not found**
Install or update the DataRobot CLI. See [cli.datarobot.com](https://cli.datarobot.com) for installation instructions.
**Template conflicts after `copier update`**
Copier shows a diff for any file with local modifications. Review each conflict, keep your changes where appropriate, and commit the result.
# Next steps and cross-links
After applying this component, add further functionality by layering additional App Framework components on top.
- [App Framework documentation](https://af.datarobot.com)—full component catalog, architecture guide, and deployment docs.
- [DataRobot CLI](https://cli.datarobot.com)—`dr component add`, `dr deploy`, and other workflow commands.
- [App Framework Studio (internal)](https://datarobot.atlassian.net/wiki/spaces/BOPS/pages/6542032899/App+Framework+-+Studio)—internal design and planning context.
# Contributing, changelog, support, and legal
**Contributing**: Fork the repository and open a pull request. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide, including how to report bugs and the maintainer response SLA.
**Getting help**: Open a [GitHub Issue](https://github.com/datarobot-community/af-component-base/issues) for bugs and feature requests. For security vulnerabilities, email the maintainers directly or contact [oss-community-management@datarobot.com](mailto:oss-community-management@datarobot.com).
**License**: This project is licensed under the terms in [LICENSE](LICENSE).