Adding Profiles¶
Profiles are regular Python classes that inherit from a base profile family and register themselves into profile_registry.
1. Pick the right family¶
Use an existing family when the runtime behavior already matches your app:
BaseCoderProfileBaseRemoteDesktopProfileBaseJupyterLabProfile
Only create a new family if you need a new set of shared defaults or hooks.
2. Add the profile class¶
Example:
Required class attributes:
slugdisplay_namedescriptionimage
Common optional attributes:
cpu_guarantee,cpu_limitmem_guarantee,mem_limitdefault_urlbash_login_pathbashrc_pathinit_script_path
3. Place the profile in the correct package¶
Built-in profiles live under configurator/apps/<family>/.
Typical pattern:
- add the class to
coder_profiles.py,remote_desktop_profiles.py, orjupyterlab_profiles.py - export it from the package
__init__.py - register it in that same
__init__.py
Example registration in configurator/apps/coder/__init__.py:
4. Add supporting files if needed¶
The codebase uses file-backed assets for shell setup and manifests.
Common locations:
configurator/apps/<family>/config_maps/...configurator/apps/<family>/manifests/...
Profiles reference these assets through explicit paths in Python, for example:
There is no automatic convention-based loading. If you add a file, you must wire it in from Python.
5. Override hooks only when needed¶
Most profiles should override a small subset of hooks:
get_default_volumes()for additional storageget_manifests()for structured Kubernetes resourcesget_config_maps()for extra mounted filesget_pod_env_vars()for environment variablesget_extra_resource_limits()for GPU or other extended resources
Do not override build() unless you are changing the output contract itself.
6. Add tests¶
At minimum, add or extend tests for:
- successful CLI generation with the new slug
- any profile-specific overrides
- manifests if the profile emits them
- plugin loading if the profile is meant to be external
Useful test files to mirror:
tests/test_cli_dump_config.pytests/test_cli_overrides.pytests/test_cli_manifests_dumping.pytests/test_external_profiles.py
External profiles¶
For site-specific or experimental profiles, prefer external plugin modules loaded with --profiles-dir.
Behavior today:
- every top-level Python module/package inside the provided folder is imported
- imported modules are expected to register into
profile_registry - duplicate slugs fail fast
Minimal external profile example: