Repository navigation
feat(container): persistent container component kind + compositions - #2645
Conversation
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
|
CodeRabbit (@coderabbitai) full review |
✅ Action performedFull review finished. |
34cad75 to
a934dc5
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds first-class ChangesContainer component type and composition validation
Sequence Diagram(s)sequenceDiagram
participant User
participant AtmosContainer as atmos container up
participant ContainerProvider as ContainerComponentProvider
participant Runtime as container runtime
User->>AtmosContainer: up api -s local
AtmosContainer->>ContainerProvider: Execute(up, stack, component)
ContainerProvider->>Runtime: ImageInspect
Runtime-->>ContainerProvider: image state
ContainerProvider->>Runtime: Build/Create/Start
Runtime-->>ContainerProvider: container result
ContainerProvider-->>AtmosContainer: status output
AtmosContainer-->>User: command result
sequenceDiagram
participant User
participant CompositionCmd as atmos composition validate
participant CompositionExecutor as ExecuteValidate
participant CompositionPackage as pkg/composition
participant UI as UI output
User->>CompositionCmd: validate storefront -s dev
CompositionCmd->>CompositionExecutor: buildConfigAndStacksInfo
CompositionExecutor->>CompositionPackage: collectMembers
CompositionPackage-->>CompositionExecutor: members
CompositionExecutor->>CompositionPackage: Validate
CompositionPackage-->>CompositionExecutor: Report
CompositionExecutor->>UI: renderReport
UI-->>User: fulfilled / not provided / unknown
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 20
🧹 Nitpick comments (5)
website/docs/cli/commands/container/usage.mdx (1)
23-23: 💤 Low valueUse curly quotes for quoted phrases in prose.
LanguageTool suggests using typographic (smart) quotes in
"your own Compose"instead of straight quotes. Update to"your own Compose"for consistency with professional documentation style.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/docs/cli/commands/container/usage.mdx` at line 23, Replace the straight quotes around the phrase "your own Compose" with curly quotes (typographic smart quotes) to match professional documentation standards. The phrase currently uses straight double quotes and should be changed to use opening and closing curly quotes instead.pkg/composition/composition_test.go (1)
22-37: ⚡ Quick winConvert this multi-scenario test to a table-driven structure.
This block currently mixes four scenarios in one flow; table-driven cases will make failures sharper and future cases cheaper to add.
As per coding guidelines, "
**/*_test.go: Use table-driven tests for testing multiple scenarios in Go."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/composition/composition_test.go` around lines 22 - 37, The TestValidateMembership function currently mixes four test scenarios in a single linear flow, making it harder to identify which specific case fails and harder to add new test cases. Refactor this function to use a table-driven test pattern by defining a slice of test case structs (each containing inputs like serviceName, compositionName, and expectedError, along with a descriptive name), then iterate through each case using t.Run to execute the ValidateMembership call and verify the expected error condition. This will make individual test failures sharper and make it cheaper to add future test cases.Source: Coding guidelines
pkg/component/container/executor_test.go (1)
211-223: ⚡ Quick winAdd the complementary restart test for a non-running container.
You verify the stop-then-start branch; please also verify the branch where stop does not run when status is not running.
As per coding guidelines: “Include negative-path tests for recovery logic … verify the recovery does NOT trigger when condition X is absent.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/executor_test.go` around lines 211 - 223, Add a complementary test function to verify the negative-path behavior of ExecuteRestart when the container is not running. Create a new test that sets up a mock Runtime with a non-running container status (by calling runningInfo() with appropriate parameters or a different status), and then verify the gomock.InOrder expectations that List is called first, Stop is NOT called, and Start is called directly. This ensures the restart logic correctly skips the stop operation when the container is not already running, complementing the existing TestExecuteRestart_StopsThenStarts test.Source: Coding guidelines
cmd/container/container_test.go (1)
10-56: ⚡ Quick winInitialize command tests with
cmd.NewTestKit(t)for RootCmd-state hygiene.Please add the standard test kit setup in these command tests to align with the repo’s command-test isolation pattern.
As per coding guidelines: “
cmd/**/*_test.go: ALWAYS usecmd.NewTestKit(t)for cmd tests to auto-clean RootCmd state.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/container/container_test.go` around lines 10 - 56, The command tests TestContainerCommandProvider, TestContainerCommandStructure, TestContainerSubcommandsRequireComponent, and TestStackFlagIsPersistent are missing the standard test kit initialization that ensures proper RootCmd state isolation between tests. Add cmd.NewTestKit(t) at the beginning of each of these test functions to follow the repository's command-test isolation pattern and ensure proper cleanup of shared state.Source: Coding guidelines
pkg/component/container/executor.go (1)
3-3: Pinmockgento v0.6.0 to match the rest of the codebase.The directive uses
@latest, which makes generated mocks non-reproducible. Most of the repository pins to@v0.6.0; align this file to that version.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/executor.go` at line 3, The go:generate directive in the executor.go file uses `@latest` for the mockgen version, which causes non-reproducible builds and is inconsistent with the rest of the codebase. Replace `@latest` with `@v0.6.0` in the mockgen go:generate comment to match the pinned version used elsewhere in the repository and ensure reproducible mock generation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/composition/composition.go`:
- Around line 91-93: The current implementation of the stack flag resolution at
lines 91-93 only checks the direct Cobra flag value, causing it to miss stack
values from environment variables and configuration files. Implement the full
configuration precedence chain by first attempting to resolve stack from the
Cobra flag, then falling back to environment variables if the flag is empty,
then to configuration file sources, and finally to defaults. Ensure the
info.Stack field is properly populated following the flags > environment
variables > config file > defaults precedence order.
In `@cmd/container/completions.go`:
- Around line 57-62: The container completion function is fetching all stacks
and all component types by passing empty strings to ExecuteDescribeStacks and
FilterAndListComponents, which allows it to suggest components from wrong stacks
or non-container types. Instead of passing an empty string as the second
parameter to ExecuteDescribeStacks, pass the actual stack name from the
completion context. Similarly, instead of passing an empty string as the first
parameter to FilterAndListComponents, pass "container" or the appropriate
component kind to ensure only matching components are returned for suggestions.
In `@cmd/container/verbs.go`:
- Around line 42-57: The help text for the container command definitions
(buildCmd, pushCmd, pullCmd, runCmd, upCmd) currently reference legacy key paths
using the `vars.*` notation which conflicts with the current container config
model. Update the long description strings for all these command definitions to
use first-class keys from the current container config model instead of
referencing `vars.build`, `vars.image`, and `vars.run`, removing the legacy
`vars.` prefix while maintaining the descriptive intent of each command's
documentation.
- Around line 18-20: Remove the FParseErrWhitelist configuration that allows
unknown flags from the newVerbCmd() function where it is currently set globally
for all commands. Instead, add this FParseErrWhitelist setting only to the
execCmd where it is actually needed to support passing arbitrary flags through
to the container after the `--` separator. This ensures that flag validation
remains active for other commands like build, push, pull, and run to catch typos
and invalid flags.
In `@cmd/list/components.go`:
- Around line 235-259: The enrichContainerRunningStatus function currently uses
context.Background() which ignores CLI cancellation and deadlines. Modify the
function signature to accept context.Context as the first parameter, then
replace the context.Background() call with the passed context parameter. Update
the function call to enrichContainerRunningStatus (near line 235) to pass the
command context instead of creating a new background context inside the
function.
In `@examples/compositions/README.md`:
- Around line 74-77: In the documentation text spanning lines 74-77, locate the
section with "component commands" and the semicolon before "`atmos list
components` shows their running state." Add a comma before the clause that
begins with "`atmos list`" to improve the readability and flow of the sentence,
making it grammatically clearer where the thought transition occurs.
In `@internal/exec/stack_processor_custom_inheritance_test.go`:
- Around line 35-41: The test in the block starting with the comment "Inherited
run.ports from the base" verifies that the ports slice has length 1, but does
not assert the actual values of the elements within it. After the require.Len
assertion on the ports variable, add additional assertions to verify the content
of at least the first element in the ports slice by checking its actual value
against the expected content. This ensures the merged slice contains not just
the correct cardinality but also the correct data.
In `@internal/exec/stack_processor_process_stacks.go`:
- Around line 874-877: The customComponentInheritsBases function currently
returns no bases when metadata.inherits is malformed or not a list, masking
validation errors. Modify customComponentInheritsBases to validate that
metadata.inherits is a list when present, and return an error if it is not
properly formatted. Update the call sites (around lines 874-877 and lines
912-922) to check the returned error and return it immediately instead of
silently ignoring validation failures, ensuring malformed inheritance
configurations are properly reported rather than silently skipped.
In `@pkg/component/container/container_test.go`:
- Around line 83-92: Update the ValidateComponent test cases to match the new
first-class key contract for the container schema. In the test cases where
vars.image and vars.build are currently nested under vars, move these properties
to be top-level keys in the component configuration map. The test calls at lines
85-88 and 89-92 should be updated so that image and build are direct properties
of the map passed to ValidateComponent, not nested within a vars sub-map.
In `@pkg/component/container/container.go`:
- Around line 90-98: The ValidateComponent function is checking for the legacy
schema where image and build are nested under the vars key (vars.image and
vars.build), but the new schema places these keys at the top level of the
config. Remove the vars extraction and validation logic, and instead check
directly in the config map for the presence of top-level "image" and "build"
keys using the same type assertion and existence checking pattern, ensuring the
error message accurately reflects that the component requires either a top-level
image or build configuration.
In `@pkg/component/container/executor_test.go`:
- Around line 63-65: The test verifies that c.Ports has exactly one element
using require.Len(t, c.Ports, 1), but it does not assert the actual content of
that port binding, allowing regressions to go undetected. After the len check
for c.Ports, add an assertion that validates the actual port binding value or
configuration at c.Ports[0] (or appropriate accessor based on the Ports
structure), similar to how the test asserts the values of c.Env["PORT"] and
c.Labels[ctr.LabelInstance]. This ensures both that the correct number of ports
exist and that their values are as expected.
In `@pkg/component/container/executor.go`:
- Around line 124-125: Update the error message on lines 124-125 in the
container executor to reference the first-class key `build` instead of the
legacy path `vars.build`. Change the error text from mentioning `vars.build` to
simply `build`. Apply the same change to the similar error messages at lines
467-471 to ensure consistency across all error messages that reference
configuration keys, replacing all references to `vars.build` and `vars.image`
with their first-class equivalents `build` and `image`.
- Around line 452-455: In the ImageInspect error handling block in the
executor.go file around line 452-455, the current logic treats all errors from
runtime.ImageInspect as "image not found" and falls through to build. Instead,
differentiate between error types: check if the error is specifically an
image-not-found error and only then fall through to the build logic; for all
other errors (transport, auth, runtime failures), return the error immediately.
Preserve the existing behavior where no error means the image exists locally and
nil is returned.
In `@pkg/composition/executor.go`:
- Around line 18-111: Add dedicated unit tests in
pkg/composition/composition_test.go to cover the new executor functions:
ExecuteValidate, collectMembers, collectStackMembers, claimsComposition, and
renderReport. These tests should verify stack traversal and data structure
handling, deduplication and sorting behavior in collectMembers, type assertion
safety in collectStackMembers and claimsComposition, and UI output formatting in
renderReport. Include test cases for edge cases such as missing sections,
invalid data types, and empty results to meet the minimum 80% test coverage
requirement.
In `@pkg/container/lifecycle.go`:
- Around line 123-126: The issue is that when runtime.Start fails in the
container lifecycle code, the cleanup attempt via runtime.Remove silently
discards any error it might encounter, potentially leaving an orphan container
without visibility into the failure. Capture the error returned from the
runtime.Remove call instead of discarding it with the blank identifier, then use
errors.Join to combine both the Start error and the Remove error if it occurs,
and include the combined error information in the fmt.Errorf return statement to
ensure operators can see both failures.
In `@pkg/datafetcher/schema/atmos/manifest/1.0.json`:
- Around line 461-474: The composition object schema currently permits empty
compositions without declaring the required service set. Add a required array to
the composition object definition that includes "services" to enforce that each
composition must explicitly declare which services may claim membership. This
ensures the validator cannot pass validation without the essential service set
configuration.
- Around line 417-421: The container_component_manifest definition in the schema
currently does not support the !include directive, while other
*_component_manifest definitions in this same schema file do support it. Update
the container_component_manifest definition to add !include support by using a
oneOf pattern that allows it to be either the object definition (with type and
additionalProperties) or a reference pattern matching how other component
manifests in the file support !include directives. This will make the schema
consistent across all component manifest types.
In `@website/docs/cli/commands/container/usage.mdx`:
- Around line 54-55: In the documentation text describing the up and run
commands, update the references to use the correct top-level component
configuration paths instead of nested under vars. Replace `vars.build` with
`build:` and replace `vars.image` with `image:` to match the actual YAML schema
structure where build and image are first-class sibling sections alongside
composition and env, not nested properties under vars.
In `@website/docs/components/components-overview.mdx`:
- Around line 105-113: The components-overview.mdx file now includes Container
as a supported component type in the table alongside Terraform/OpenTofu,
Helmfile, Packer, and Ansible. However, the "Next Steps" navigation section on
the same page does not include a link to the Container component documentation,
creating an inconsistency in navigation. Add a link entry for the Container
component in the "Next Steps" section of the page to match the structure and
provide consistent navigation for all five component types introduced in the
main table.
In `@website/docs/components/container.mdx`:
- Around line 56-62: The line containing `atmos container ps|logs|exec api -s
dev` uses shorthand notation that is not directly copy/paste executable and may
confuse users. Replace this single line with three separate, explicit command
lines showing each operation independently: one for `atmos container ps api -s
dev`, one for `atmos container logs api -s dev`, and one for `atmos container
exec api -s dev`. This ensures users can copy and paste each command directly
without interpretation errors.
---
Nitpick comments:
In `@cmd/container/container_test.go`:
- Around line 10-56: The command tests TestContainerCommandProvider,
TestContainerCommandStructure, TestContainerSubcommandsRequireComponent, and
TestStackFlagIsPersistent are missing the standard test kit initialization that
ensures proper RootCmd state isolation between tests. Add cmd.NewTestKit(t) at
the beginning of each of these test functions to follow the repository's
command-test isolation pattern and ensure proper cleanup of shared state.
In `@pkg/component/container/executor_test.go`:
- Around line 211-223: Add a complementary test function to verify the
negative-path behavior of ExecuteRestart when the container is not running.
Create a new test that sets up a mock Runtime with a non-running container
status (by calling runningInfo() with appropriate parameters or a different
status), and then verify the gomock.InOrder expectations that List is called
first, Stop is NOT called, and Start is called directly. This ensures the
restart logic correctly skips the stop operation when the container is not
already running, complementing the existing TestExecuteRestart_StopsThenStarts
test.
In `@pkg/component/container/executor.go`:
- Line 3: The go:generate directive in the executor.go file uses `@latest` for the
mockgen version, which causes non-reproducible builds and is inconsistent with
the rest of the codebase. Replace `@latest` with `@v0.6.0` in the mockgen
go:generate comment to match the pinned version used elsewhere in the repository
and ensure reproducible mock generation.
In `@pkg/composition/composition_test.go`:
- Around line 22-37: The TestValidateMembership function currently mixes four
test scenarios in a single linear flow, making it harder to identify which
specific case fails and harder to add new test cases. Refactor this function to
use a table-driven test pattern by defining a slice of test case structs (each
containing inputs like serviceName, compositionName, and expectedError, along
with a descriptive name), then iterate through each case using t.Run to execute
the ValidateMembership call and verify the expected error condition. This will
make individual test failures sharper and make it cheaper to add future test
cases.
In `@website/docs/cli/commands/container/usage.mdx`:
- Line 23: Replace the straight quotes around the phrase "your own Compose" with
curly quotes (typographic smart quotes) to match professional documentation
standards. The phrase currently uses straight double quotes and should be
changed to use opening and closing curly quotes instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d994bf78-dcc7-4789-8c8f-eb4eef9b1b7d
📒 Files selected for processing (57)
.claude/skills/atmos-components.claude/skills/atmos-core-component-development/SKILL.mdcmd/composition/composition.gocmd/container/completions.gocmd/container/container.gocmd/container/container_test.gocmd/container/flags.gocmd/container/verbs.gocmd/list/components.gocmd/root.godocs/prd/container-components.mderrors/errors.goexamples/compositions/README.mdexamples/compositions/atmos.yamlexamples/compositions/stacks/deploy/dev.yamlexamples/compositions/stacks/deploy/local.yamlexamples/container-component/Dockerfileexamples/container-component/README.mdexamples/container-component/atmos.yamlexamples/container-component/stacks/deploy/local.yamlinternal/exec/describe_component.gointernal/exec/describe_stacks.gointernal/exec/describe_stacks_component_processor.gointernal/exec/stack_processor_custom_inheritance_test.gointernal/exec/stack_processor_process_stacks.gopkg/component/container/config.gopkg/component/container/config_test.gopkg/component/container/container.gopkg/component/container/container_test.gopkg/component/container/executor.gopkg/component/container/executor_test.gopkg/component/container/mock_runtime_test.gopkg/composition/composition.gopkg/composition/composition_test.gopkg/composition/executor.gopkg/config/const.gopkg/container/common.gopkg/container/identity.gopkg/container/identity_test.gopkg/container/lifecycle.gopkg/container/lifecycle_test.gopkg/container/runtime.gopkg/container/sandbox.gopkg/datafetcher/schema/atmos/manifest/1.0.jsonpkg/list/extract/components.gopkg/list/extract/mock_runtime_test.gopkg/list/extract/running_status.gopkg/list/extract/running_status_test.gopkg/schema/container_config.gopkg/schema/schema.gotests/snapshots/TestCLICommands_atmos_--help.stdout.goldentests/snapshots/TestCLICommands_atmos_--help_config_aliases_section.stdout.goldentests/snapshots/TestCLICommands_help_flag_works.stdout.goldenwebsite/docs/cli/commands/container/_category_.jsonwebsite/docs/cli/commands/container/usage.mdxwebsite/docs/components/components-overview.mdxwebsite/docs/components/container.mdx
💤 Files with no reviewable changes (1)
- .claude/skills/atmos-components
Apply CodeRabbit review fixes for PR #2645 (container component type + compositions) and fix the failing Acceptance Tests. First-class image/build contract: - ValidateComponent and its tests check top-level image/build (not vars.*) - executor error text and verb help/usage docs use first-class keys Correctness/robustness: - lifecycle.Up joins the cleanup error when Start fails (no orphan masking) - ensureImage only builds on a genuine missing image; export and reuse IsImageMissingError so transport/auth/daemon errors surface - composition + container resolve stack via viper (flag > env > config) - container component completion filters by stack and container type - scope FParseErrWhitelist to `exec` only so other verbs catch typos - customComponentInheritsBases errors on malformed metadata.inherits Schema: - container_component_manifest accepts !include via oneOf - compositions require non-empty, unique services - classify ContainerSectionName in the schema-coverage ratchet Tests/docs: - assert port-binding values (not just length); add composition executor unit tests and a negative-path inherits test; docstrings on new exports - doc fixes (comma, explicit ps/logs/exec commands, Next Steps link) CI: - regenerate TestCLICommands/atmos_non-existent snapshot to include the new composition and container commands Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2645 +/- ##
==========================================
+ Coverage 80.25% 80.30% +0.05%
==========================================
Files 1372 1387 +15
Lines 129684 131357 +1673
==========================================
+ Hits 104081 105492 +1411
- Misses 19835 20007 +172
- Partials 5768 5858 +90
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏 |
|
💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏 |
Add a stack-scoped, Atmos-native `container` component kind: one component is one persistent service. Atmos owns the image artifact (build/push/pull) and a long-running named container lifecycle (list/up/ps/logs/exec/restart/stop/rm/down), discovered by labels derived from the canonical component instance address (`<stack>/container/<component>`) rather than local state files. - pkg/container: identity (canonical labels, RuntimeName, DiscoveryFilter) + named lifecycle (Up/Down/FindInstance), sharing the sanitizer with sandbox.go. - pkg/component/container: provider + executor for the verbs; first-class config (`image`/`build`/`run` reuse the workflow container-step structs, NOT `vars`); build-before-start; abstract components rejected. - cmd/container + cmd/composition: thin CommandProvider command groups. - `atmos container list` shows per-instance running state (label discovery). The generic `atmos list components` lists containers as a component type uniformly, without container-specific status (consistent with terraform/ansible). - compositions: first-class `composition:` membership + `compositions:` section; hard error on undeclared membership; `atmos composition validate` soft report. - Custom-component fallback now runs metadata.inherits inheritance + generic deep-merge of all top-level keys, so container honors catalog/abstract defaults. - describe component auto-detect + describe/list type whitelist extended for container (and the pre-existing ansible gap in list components). - Examples (container-component, compositions), docs, JSON schema, and a new atmos-core-component-development contributor skill. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Apply CodeRabbit review fixes for PR #2645 (container component type + compositions) and fix the failing Acceptance Tests. First-class image/build contract: - ValidateComponent and its tests check top-level image/build (not vars.*) - executor error text and verb help/usage docs use first-class keys Correctness/robustness: - lifecycle.Up joins the cleanup error when Start fails (no orphan masking) - ensureImage only builds on a genuine missing image; export and reuse IsImageMissingError so transport/auth/daemon errors surface - composition + container resolve stack via viper (flag > env > config) - container component completion filters by stack and container type - scope FParseErrWhitelist to `exec` only so other verbs catch typos - customComponentInheritsBases errors on malformed metadata.inherits Schema: - container_component_manifest accepts !include via oneOf - compositions require non-empty, unique services - classify ContainerSectionName in the schema-coverage ratchet Tests/docs: - assert port-binding values (not just length); add composition executor unit tests and a negative-path inherits test; docstrings on new exports - doc fixes (comma, explicit ps/logs/exec commands, Next Steps link) CI: - regenerate TestCLICommands/atmos_non-existent snapshot to include the new composition and container commands Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the two legacy label namespaces (com.cloudposse.atmos.* for container-component instances and com.atmos.* for workflow sandboxes, container steps, and devcontainers) with a single tools.atmos.* namespace so the label vocabulary is consistent repo-wide. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add multi-component and interactive operation to the container component lifecycle, mirroring docker compose, plus several UX fixes. Bulk operation: - build/push/pull/up/start/restart/stop/rm/down accept no component and operate on --all (optionally --stack-scoped) or via an interactive picker (stack, then multi-select of components). Continue-on-error with an aggregated summary; teardown verbs (down/stop/rm) run in reverse order. - Reuse describeStacks + collectContainerInstances for target discovery; per-target dispatch reuses the existing single-component executors. logs --all / --follow: - logs takes an optional component plus --all/--follow/--tail. Multi-follow streams concurrently with a colored, centered, uppercased per-component label (log-level-badge style via pkg/ui/theme.ComponentLabelStyle), built on pkg/io.NewLinePrefixWriterRaw; degrades to [NAME] without color. - Ctrl-C stops gracefully: suspends Atmos's global interrupt-exit (pkg/signals) and prints a friendly closing line instead of exiting 130. start verb: - Add `start` to resume an existing stopped container in place (inverse of stop; unlike up it never creates/recreates), restoring up/down + start/stop symmetry. ps + list: - `ps` no longer requires a component; with none it lists all components' running state (like `list`, optionally --stack-filtered). - Fix list/ps column alignment: render the colored status dot outside tabwriter (its ANSI codes inflated the byte-counted column width). Other: - Spinners on lifecycle ops (build/push/pull/up/start/restart/stop/rm/down), matching the devcontainer UX. - Fix the --stack flag being dropped for single-component invocations by rebinding the executing command's flags to Viper in runVerb. - Give --tail a no-opt default so bare `--tail` does not swallow the next flag. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`atmos container push <component>` (and `push --all`) now pushes every entry in `build.tags` instead of only the single top-level `image`. Because the build already applies each tag to the image locally, listing registry-qualified tags in `build.tags` ships the image to multiple registries in one operation. Pushes run in order and fail fast; with no `build.tags`, push falls back to `image` (unchanged behavior). - pkg/component/container/config.go: ContainerSpec.PushRefs() returns the deduped, order-preserving build tags, else the single image. - pkg/component/container/executor.go: ExecutePush fans out over PushRefs() (per-ref spinner, fail-fast, dry-run lists each ref). - docs: dedicated "Push to multiple registries" section in the container usage page, plus Usage/Configuration/Examples mentions. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add Docker-Compose-style `run.healthcheck` and `run.restart` as first-class
container component properties, so users no longer need the raw `run.run_args`
passthrough. Health status is now surfaced in `atmos container ps`/`list`.
- `restart: { policy, max_retries }` -> docker/podman --restart=<policy>[:<n>]
- `healthcheck:` mirrors Compose (test string/list with NONE|CMD|CMD-SHELL,
interval/timeout/retries/start_period/start_interval/disable) -> --health-*
/ --no-healthcheck
- ps/list gain a HEALTH column, parsed for free from the existing ps .Status
string (no extra runtime call) in both docker and podman paths
- restart policy and healthcheck durations validated up front with friendly
errors instead of opaque runtime failures
- JSON manifest schema, the container-component example, and the usage docs
document the new settings
Adding the Health field to container.Info / instanceRow grew those structs, so
a few existing by-value range/param copies are switched to indexing/pointers to
satisfy gocritic (sandbox.go, podman.go, logs.go).
Plumbing mirrors the existing ports/mounts flow: schema.ContainerRunStep ->
ContainerSpec mappers/ValidateRun -> NamedConfig -> CreateConfig ->
addHealthAndRestart flag emitter.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Apply still-valid CodeRabbit findings; skip the rest with rationale. Correctness/robustness: - container: IsContainerRunning tokenizes status (no false match on "not running"); identity labels are now authoritative over caller labels in buildNamedCreateConfig (label-based discovery stays intact) - container: CommandArgs tokenizes run.command with google/shlex so quoted args survive in ExecuteUp; errors on malformed quoting - container logs: only "no running container" is skippable (new ErrNoRunningContainer sentinel); real discovery failures aggregate and surface; follow errors wrap a static sentinel - ui: guard negative index in FormatComponentLabel and ComponentLabelStyle to avoid a negative-modulus panic - stacks: non-string metadata.inherits items now error instead of being silently dropped - schema: compositions accepts !include like peer sections Tests/docs/cleanup: - fail-loud fixture check; "not running" regression case; both-direction label isolation; ShellOptions IO propagation; ShellOptions test names; table-driven composition arg test; push stub Shell fails loudly; pin mockgen to v0.6.0; correct stale describe_stacks comment; e.g., Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
66ed85e to
9175f6a
Compare
|
Warning Release Documentation RequiredThis PR is labeled
|
|
Warning Release Documentation RequiredThis PR is labeled
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/component/container/config.go`:
- Line 9: Replace the legacy mapstructure import statement in the config.go
file. Change the import path from "github.com/mitchellh/mapstructure" to
"github.com/go-viper/mapstructure/v2" to align with the rest of the codebase.
This ensures consistency across all imports since both versions are already in
go.mod and have compatible APIs.
In `@pkg/component/container/executor.go`:
- Around line 320-331: The ExecuteDown function and related destructive
lifecycle functions (ExecuteRestart, ExecuteStart, ExecuteStop, ExecuteRm) do
not check the r.dryRun flag before executing container mutations, unlike build,
push, pull, run, and up functions which already handle this. Add an early-return
pattern at the beginning of each of these destructive lifecycle functions:
immediately after getting the runtime and config (after the r2 call), check if
r.dryRun is true and return nil early to prevent any actual container changes.
This should be applied consistently to ExecuteDown, ExecuteRestart,
ExecuteStart, ExecuteStop, and ExecuteRm.
- Around line 94-117: The runtime method is passing only r.envList to the SetEnv
call, which causes the host environment variables to be completely replaced
instead of merged when applyCommandEnv processes the command environment. To fix
this, in the runtime method where setter.SetEnv(r.envList) is called, merge
r.envList with the host OS environment variables (obtainable via os.Environ())
so that component-specific environment variables are combined with essential
host variables like HOME, DOCKER_HOST, and proxy settings, then pass the merged
environment list to setter.SetEnv instead of just r.envList alone.
In `@pkg/component/container/list.go`:
- Around line 109-110: The inline comment on the continue statement in the
isAbstractComponent check is missing a period at the end. Add a period to the
end of the comment "abstract components are blueprints, not deployable
instances" to comply with Go coding guidelines that require all comments to end
with periods.
In `@pkg/runner/step/container_push_test.go`:
- Around line 17-73: The pushRuntime struct in container_push_test.go is a
hand-written test double that should be replaced with a generated mock. Remove
the entire pushRuntime struct definition and all its method implementations
(Build, Create, Start, Stop, Remove, Inspect, List, Exec, Shell, Attach, Pull,
Tag, Push, ImageInspect, Logs, Info). Instead, add a //go:generate directive at
the top of the file to use mockgen from go.uber.org/mock to generate a mock for
the container runtime interface, then update the test code to use the generated
mock with explicit expectations for the Tag and Push methods rather than relying
on manual call tracking.
In `@pkg/schema/workflow.go`:
- Around line 10-12: The ErrInvalidWorkflowContainer error is currently defined
locally in the schema package but must be moved to the central error registry
for consistency with the coding guidelines. Remove the
ErrInvalidWorkflowContainer variable declaration from workflow.go and add it to
the central errors registry file, then update any usages in workflow.go to
import and reference the error from the central registry instead of the local
definition.
- Around line 108-121: The ContainerHealthCheck struct has a Test field typed as
[]string with standard YAML tags, but the documentation indicates it should
accept both scalar strings and sequences. Implement a custom UnmarshalYAML
method for the ContainerHealthCheck struct (following the pattern used in the
existing WorkflowContainer.UnmarshalYAML) that handles unmarshaling the Test
field as either a scalar string or a sequence, converting scalar values into
single-element slices before assignment. Additionally, add regression tests that
verify both scalar (bare string) and list forms of the test field unmarshal
correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bfb1e0b7-d7b0-42e1-a5af-afef1bd2cba1
📒 Files selected for processing (101)
.claude/skills/atmos-components.claude/skills/atmos-core-component-development/SKILL.mdagent-skills/skills/atmos-devcontainer/SKILL.mdcmd/composition/composition.gocmd/composition/composition_test.gocmd/container/completions.gocmd/container/completions_fixture_test.gocmd/container/completions_test.gocmd/container/container.gocmd/container/container_test.gocmd/container/dispatch_test.gocmd/container/flags.gocmd/container/verbs.gocmd/root.godocs/prd/container-components.mddocs/prd/devcontainer-command.mddocs/prd/devcontainer-naming-convention.mderrors/errors.goexamples/compositions/README.mdexamples/compositions/atmos.yamlexamples/compositions/stacks/deploy/dev.yamlexamples/compositions/stacks/deploy/local.yamlexamples/container-component/Dockerfileexamples/container-component/README.mdexamples/container-component/atmos.yamlexamples/container-component/stacks/deploy/local.yamlgo.modinternal/exec/describe_component.gointernal/exec/describe_stacks.gointernal/exec/describe_stacks_component_processor.gointernal/exec/stack_processor_custom_inheritance_test.gointernal/exec/stack_processor_process_stacks.gopkg/component/container/bulk.gopkg/component/container/bulk_test.gopkg/component/container/config.gopkg/component/container/config_test.gopkg/component/container/container.gopkg/component/container/container_test.gopkg/component/container/executor.gopkg/component/container/executor_extra_test.gopkg/component/container/executor_start_test.gopkg/component/container/executor_test.gopkg/component/container/health_restart_test.gopkg/component/container/list.gopkg/component/container/list_test.gopkg/component/container/logs.gopkg/component/container/logs_test.gopkg/component/container/mock_runtime_test.gopkg/component/container/push_test.gopkg/composition/composition.gopkg/composition/composition_test.gopkg/composition/executor.gopkg/composition/executor_test.gopkg/composition/executor_validate_test.gopkg/config/const.gopkg/container/common.gopkg/container/common_test.gopkg/container/docker.gopkg/container/docker_test.gopkg/container/ephemeral.gopkg/container/ephemeral_test.gopkg/container/health_restart_test.gopkg/container/identity.gopkg/container/identity_test.gopkg/container/lifecycle.gopkg/container/lifecycle_extra_test.gopkg/container/lifecycle_test.gopkg/container/mock_runtime_test.gopkg/container/podman.gopkg/container/podman_test.gopkg/container/runtime.gopkg/container/sandbox.gopkg/container/sandbox_test.gopkg/datafetcher/schema/atmos/manifest/1.0.jsonpkg/datafetcher/schema_section_coverage_test.gopkg/devcontainer/lifecycle_attach.gopkg/devcontainer/lifecycle_attach_test.gopkg/devcontainer/mock_runtime_test.gopkg/devcontainer/naming.gopkg/flags/interactive.gopkg/flags/interactive_test.gopkg/io/line_prefix_writer.gopkg/io/line_prefix_writer_test.gopkg/list/extract/components.gopkg/runner/step/container_push_test.gopkg/runner/step/container_run.gopkg/schema/container_config.gopkg/schema/schema.gopkg/schema/workflow.gopkg/ui/formatter.gopkg/ui/formatter_test.gopkg/ui/theme/log_styles.gopkg/ui/theme/log_styles_test.gotests/snapshots/TestCLICommands_atmos_--help.stdout.goldentests/snapshots/TestCLICommands_atmos_--help_config_aliases_section.stdout.goldentests/snapshots/TestCLICommands_atmos_non-existent.stderr.goldentests/snapshots/TestCLICommands_help_flag_works.stdout.goldenwebsite/docs/cli/commands/container/_category_.jsonwebsite/docs/cli/commands/container/usage.mdxwebsite/docs/components/components-overview.mdxwebsite/docs/components/container.mdx
💤 Files with no reviewable changes (9)
- tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
- .claude/skills/atmos-components
- website/docs/cli/commands/container/category.json
- tests/snapshots/TestCLICommands_atmos_--help_config_aliases_section.stdout.golden
- tests/snapshots/TestCLICommands_atmos_non-existent.stderr.golden
- website/docs/components/container.mdx
- tests/snapshots/TestCLICommands_help_flag_works.stdout.golden
- website/docs/components/components-overview.mdx
- website/docs/cli/commands/container/usage.mdx
✅ Files skipped from review due to trivial changes (13)
- examples/container-component/atmos.yaml
- pkg/container/sandbox_test.go
- cmd/container/completions_test.go
- pkg/container/ephemeral_test.go
- pkg/io/line_prefix_writer_test.go
- agent-skills/skills/atmos-devcontainer/SKILL.md
- examples/container-component/README.md
- examples/compositions/atmos.yaml
- pkg/runner/step/container_run.go
- docs/prd/devcontainer-naming-convention.md
- docs/prd/devcontainer-command.md
- pkg/config/const.go
- pkg/component/container/mock_runtime_test.go
🚧 Files skipped from review as they are similar to previous changes (62)
- pkg/devcontainer/mock_runtime_test.go
- examples/compositions/stacks/deploy/dev.yaml
- cmd/container/flags.go
- examples/container-component/Dockerfile
- pkg/schema/container_config.go
- pkg/list/extract/components.go
- pkg/composition/executor_validate_test.go
- pkg/ui/formatter.go
- pkg/ui/theme/log_styles_test.go
- cmd/root.go
- pkg/flags/interactive_test.go
- pkg/container/ephemeral.go
- pkg/devcontainer/lifecycle_attach.go
- pkg/devcontainer/naming.go
- pkg/devcontainer/lifecycle_attach_test.go
- cmd/container/completions_fixture_test.go
- pkg/component/container/bulk.go
- cmd/composition/composition_test.go
- internal/exec/describe_stacks_component_processor.go
- pkg/datafetcher/schema_section_coverage_test.go
- cmd/container/container_test.go
- pkg/component/container/executor_start_test.go
- examples/compositions/stacks/deploy/local.yaml
- pkg/component/container/container_test.go
- pkg/ui/theme/log_styles.go
- internal/exec/stack_processor_custom_inheritance_test.go
- cmd/container/completions.go
- pkg/container/sandbox.go
- pkg/io/line_prefix_writer.go
- pkg/flags/interactive.go
- pkg/composition/composition_test.go
- pkg/component/container/push_test.go
- pkg/composition/executor.go
- cmd/container/container.go
- cmd/container/verbs.go
- pkg/composition/executor_test.go
- pkg/component/container/list_test.go
- pkg/container/runtime.go
- pkg/component/container/executor_extra_test.go
- cmd/composition/composition.go
- internal/exec/describe_stacks.go
- pkg/container/docker_test.go
- pkg/container/lifecycle_test.go
- pkg/component/container/config_test.go
- cmd/container/dispatch_test.go
- pkg/ui/formatter_test.go
- pkg/schema/schema.go
- pkg/component/container/logs_test.go
- pkg/component/container/container.go
- pkg/datafetcher/schema/atmos/manifest/1.0.json
- pkg/container/mock_runtime_test.go
- pkg/component/container/bulk_test.go
- pkg/container/lifecycle.go
- pkg/composition/composition.go
- pkg/container/identity.go
- internal/exec/describe_component.go
- pkg/container/identity_test.go
- pkg/container/podman_test.go
- pkg/component/container/logs.go
- pkg/container/common_test.go
- internal/exec/stack_processor_process_stacks.go
- pkg/component/container/executor_test.go
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/component/container/config.go`:
- Line 9: Replace the legacy mapstructure import statement in the config.go
file. Change the import path from "github.com/mitchellh/mapstructure" to
"github.com/go-viper/mapstructure/v2" to align with the rest of the codebase.
This ensures consistency across all imports since both versions are already in
go.mod and have compatible APIs.
In `@pkg/component/container/executor.go`:
- Around line 320-331: The ExecuteDown function and related destructive
lifecycle functions (ExecuteRestart, ExecuteStart, ExecuteStop, ExecuteRm) do
not check the r.dryRun flag before executing container mutations, unlike build,
push, pull, run, and up functions which already handle this. Add an early-return
pattern at the beginning of each of these destructive lifecycle functions:
immediately after getting the runtime and config (after the r2 call), check if
r.dryRun is true and return nil early to prevent any actual container changes.
This should be applied consistently to ExecuteDown, ExecuteRestart,
ExecuteStart, ExecuteStop, and ExecuteRm.
- Around line 94-117: The runtime method is passing only r.envList to the SetEnv
call, which causes the host environment variables to be completely replaced
instead of merged when applyCommandEnv processes the command environment. To fix
this, in the runtime method where setter.SetEnv(r.envList) is called, merge
r.envList with the host OS environment variables (obtainable via os.Environ())
so that component-specific environment variables are combined with essential
host variables like HOME, DOCKER_HOST, and proxy settings, then pass the merged
environment list to setter.SetEnv instead of just r.envList alone.
In `@pkg/component/container/list.go`:
- Around line 109-110: The inline comment on the continue statement in the
isAbstractComponent check is missing a period at the end. Add a period to the
end of the comment "abstract components are blueprints, not deployable
instances" to comply with Go coding guidelines that require all comments to end
with periods.
In `@pkg/runner/step/container_push_test.go`:
- Around line 17-73: The pushRuntime struct in container_push_test.go is a
hand-written test double that should be replaced with a generated mock. Remove
the entire pushRuntime struct definition and all its method implementations
(Build, Create, Start, Stop, Remove, Inspect, List, Exec, Shell, Attach, Pull,
Tag, Push, ImageInspect, Logs, Info). Instead, add a //go:generate directive at
the top of the file to use mockgen from go.uber.org/mock to generate a mock for
the container runtime interface, then update the test code to use the generated
mock with explicit expectations for the Tag and Push methods rather than relying
on manual call tracking.
In `@pkg/schema/workflow.go`:
- Around line 10-12: The ErrInvalidWorkflowContainer error is currently defined
locally in the schema package but must be moved to the central error registry
for consistency with the coding guidelines. Remove the
ErrInvalidWorkflowContainer variable declaration from workflow.go and add it to
the central errors registry file, then update any usages in workflow.go to
import and reference the error from the central registry instead of the local
definition.
- Around line 108-121: The ContainerHealthCheck struct has a Test field typed as
[]string with standard YAML tags, but the documentation indicates it should
accept both scalar strings and sequences. Implement a custom UnmarshalYAML
method for the ContainerHealthCheck struct (following the pattern used in the
existing WorkflowContainer.UnmarshalYAML) that handles unmarshaling the Test
field as either a scalar string or a sequence, converting scalar values into
single-element slices before assignment. Additionally, add regression tests that
verify both scalar (bare string) and list forms of the test field unmarshal
correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bfb1e0b7-d7b0-42e1-a5af-afef1bd2cba1
📒 Files selected for processing (101)
.claude/skills/atmos-components.claude/skills/atmos-core-component-development/SKILL.mdagent-skills/skills/atmos-devcontainer/SKILL.mdcmd/composition/composition.gocmd/composition/composition_test.gocmd/container/completions.gocmd/container/completions_fixture_test.gocmd/container/completions_test.gocmd/container/container.gocmd/container/container_test.gocmd/container/dispatch_test.gocmd/container/flags.gocmd/container/verbs.gocmd/root.godocs/prd/container-components.mddocs/prd/devcontainer-command.mddocs/prd/devcontainer-naming-convention.mderrors/errors.goexamples/compositions/README.mdexamples/compositions/atmos.yamlexamples/compositions/stacks/deploy/dev.yamlexamples/compositions/stacks/deploy/local.yamlexamples/container-component/Dockerfileexamples/container-component/README.mdexamples/container-component/atmos.yamlexamples/container-component/stacks/deploy/local.yamlgo.modinternal/exec/describe_component.gointernal/exec/describe_stacks.gointernal/exec/describe_stacks_component_processor.gointernal/exec/stack_processor_custom_inheritance_test.gointernal/exec/stack_processor_process_stacks.gopkg/component/container/bulk.gopkg/component/container/bulk_test.gopkg/component/container/config.gopkg/component/container/config_test.gopkg/component/container/container.gopkg/component/container/container_test.gopkg/component/container/executor.gopkg/component/container/executor_extra_test.gopkg/component/container/executor_start_test.gopkg/component/container/executor_test.gopkg/component/container/health_restart_test.gopkg/component/container/list.gopkg/component/container/list_test.gopkg/component/container/logs.gopkg/component/container/logs_test.gopkg/component/container/mock_runtime_test.gopkg/component/container/push_test.gopkg/composition/composition.gopkg/composition/composition_test.gopkg/composition/executor.gopkg/composition/executor_test.gopkg/composition/executor_validate_test.gopkg/config/const.gopkg/container/common.gopkg/container/common_test.gopkg/container/docker.gopkg/container/docker_test.gopkg/container/ephemeral.gopkg/container/ephemeral_test.gopkg/container/health_restart_test.gopkg/container/identity.gopkg/container/identity_test.gopkg/container/lifecycle.gopkg/container/lifecycle_extra_test.gopkg/container/lifecycle_test.gopkg/container/mock_runtime_test.gopkg/container/podman.gopkg/container/podman_test.gopkg/container/runtime.gopkg/container/sandbox.gopkg/container/sandbox_test.gopkg/datafetcher/schema/atmos/manifest/1.0.jsonpkg/datafetcher/schema_section_coverage_test.gopkg/devcontainer/lifecycle_attach.gopkg/devcontainer/lifecycle_attach_test.gopkg/devcontainer/mock_runtime_test.gopkg/devcontainer/naming.gopkg/flags/interactive.gopkg/flags/interactive_test.gopkg/io/line_prefix_writer.gopkg/io/line_prefix_writer_test.gopkg/list/extract/components.gopkg/runner/step/container_push_test.gopkg/runner/step/container_run.gopkg/schema/container_config.gopkg/schema/schema.gopkg/schema/workflow.gopkg/ui/formatter.gopkg/ui/formatter_test.gopkg/ui/theme/log_styles.gopkg/ui/theme/log_styles_test.gotests/snapshots/TestCLICommands_atmos_--help.stdout.goldentests/snapshots/TestCLICommands_atmos_--help_config_aliases_section.stdout.goldentests/snapshots/TestCLICommands_atmos_non-existent.stderr.goldentests/snapshots/TestCLICommands_help_flag_works.stdout.goldenwebsite/docs/cli/commands/container/_category_.jsonwebsite/docs/cli/commands/container/usage.mdxwebsite/docs/components/components-overview.mdxwebsite/docs/components/container.mdx
💤 Files with no reviewable changes (9)
- tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
- .claude/skills/atmos-components
- website/docs/cli/commands/container/category.json
- tests/snapshots/TestCLICommands_atmos_--help_config_aliases_section.stdout.golden
- tests/snapshots/TestCLICommands_atmos_non-existent.stderr.golden
- website/docs/components/container.mdx
- tests/snapshots/TestCLICommands_help_flag_works.stdout.golden
- website/docs/components/components-overview.mdx
- website/docs/cli/commands/container/usage.mdx
✅ Files skipped from review due to trivial changes (13)
- examples/container-component/atmos.yaml
- pkg/container/sandbox_test.go
- cmd/container/completions_test.go
- pkg/container/ephemeral_test.go
- pkg/io/line_prefix_writer_test.go
- agent-skills/skills/atmos-devcontainer/SKILL.md
- examples/container-component/README.md
- examples/compositions/atmos.yaml
- pkg/runner/step/container_run.go
- docs/prd/devcontainer-naming-convention.md
- docs/prd/devcontainer-command.md
- pkg/config/const.go
- pkg/component/container/mock_runtime_test.go
🚧 Files skipped from review as they are similar to previous changes (62)
- pkg/devcontainer/mock_runtime_test.go
- examples/compositions/stacks/deploy/dev.yaml
- cmd/container/flags.go
- examples/container-component/Dockerfile
- pkg/schema/container_config.go
- pkg/list/extract/components.go
- pkg/composition/executor_validate_test.go
- pkg/ui/formatter.go
- pkg/ui/theme/log_styles_test.go
- cmd/root.go
- pkg/flags/interactive_test.go
- pkg/container/ephemeral.go
- pkg/devcontainer/lifecycle_attach.go
- pkg/devcontainer/naming.go
- pkg/devcontainer/lifecycle_attach_test.go
- cmd/container/completions_fixture_test.go
- pkg/component/container/bulk.go
- cmd/composition/composition_test.go
- internal/exec/describe_stacks_component_processor.go
- pkg/datafetcher/schema_section_coverage_test.go
- cmd/container/container_test.go
- pkg/component/container/executor_start_test.go
- examples/compositions/stacks/deploy/local.yaml
- pkg/component/container/container_test.go
- pkg/ui/theme/log_styles.go
- internal/exec/stack_processor_custom_inheritance_test.go
- cmd/container/completions.go
- pkg/container/sandbox.go
- pkg/io/line_prefix_writer.go
- pkg/flags/interactive.go
- pkg/composition/composition_test.go
- pkg/component/container/push_test.go
- pkg/composition/executor.go
- cmd/container/container.go
- cmd/container/verbs.go
- pkg/composition/executor_test.go
- pkg/component/container/list_test.go
- pkg/container/runtime.go
- pkg/component/container/executor_extra_test.go
- cmd/composition/composition.go
- internal/exec/describe_stacks.go
- pkg/container/docker_test.go
- pkg/container/lifecycle_test.go
- pkg/component/container/config_test.go
- cmd/container/dispatch_test.go
- pkg/ui/formatter_test.go
- pkg/schema/schema.go
- pkg/component/container/logs_test.go
- pkg/component/container/container.go
- pkg/datafetcher/schema/atmos/manifest/1.0.json
- pkg/container/mock_runtime_test.go
- pkg/component/container/bulk_test.go
- pkg/container/lifecycle.go
- pkg/composition/composition.go
- pkg/container/identity.go
- internal/exec/describe_component.go
- pkg/container/identity_test.go
- pkg/container/podman_test.go
- pkg/component/container/logs.go
- pkg/container/common_test.go
- internal/exec/stack_processor_process_stacks.go
- pkg/component/container/executor_test.go
🛑 Comments failed to post (7)
pkg/component/container/config.go (1)
9-9: 🎯 Functional Correctness | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Imports in config.go:" rg -n '"github.com/(mitchellh/mapstructure|go-viper/mapstructure/v2)"' pkg/component/container/config.go echo echo "Declared mapstructure modules:" rg -n 'mapstructure' go.mod go.sumRepository: cloudposse/atmos
Length of output: 879
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "All mapstructure imports in codebase:" rg -n 'github\.com/(mitchellh/mapstructure|go-viper/mapstructure)' --type go | head -20 echo "" echo "Files importing mapstructure by version:" rg 'github\.com/(mitchellh/mapstructure|go-viper/mapstructure)' --type go -l | while read file; do echo "File: $file" rg 'github\.com/(mitchellh/mapstructure|go-viper/mapstructure)' "$file" | head -1 doneRepository: cloudposse/atmos
Length of output: 192
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Searching for all mapstructure imports:" rg 'mapstructure' --type go -l echo "" echo "Count of files mentioning mapstructure:" rg 'mapstructure' --type go -l | wc -lRepository: cloudposse/atmos
Length of output: 202
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Direct grep for mapstructure in Go files:" grep -r "mapstructure" --include="*.go" . 2>/dev/null | grep -E "import|github.com" | head -10 echo "" echo "Check if config.go actually uses mapstructure (not just imports):" grep -A 20 "mapstructure" pkg/component/container/config.go | head -15Repository: cloudposse/atmos
Length of output: 1627
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Check for actual mapstructure usage in config.go:" grep -E "mapstructure\." pkg/component/container/config.go echo "" echo "Line count and full imports section of config.go:" head -20 pkg/component/container/config.goRepository: cloudposse/atmos
Length of output: 850
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "Lines in config.go where mapstructure is actually used:" grep -n "mapstructure\." pkg/component/container/config.go echo "" echo "Check mapstructure API between v1 and v2:" echo "V1 path: github.com/mitchellh/mapstructure" echo "V2 path: github.com/go-viper/mapstructure/v2" echo "" echo "Import style check - how v2 is used in other files:" grep -A 2 "github.com/go-viper/mapstructure/v2" ./internal/exec/stack_processor_utils.go | head -10Repository: cloudposse/atmos
Length of output: 649
Update the
mapstructureimport to match the rest of the codebase.The file imports the legacy
github.com/mitchellh/mapstructurev1 path, but every other file in the codebase (errors/, internal/exec/, etc.) has migrated togithub.com/go-viper/mapstructure/v2. Since both versions are ingo.modand the API is compatible, update line 9 to importgithub.com/go-viper/mapstructure/v2for consistency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/config.go` at line 9, Replace the legacy mapstructure import statement in the config.go file. Change the import path from "github.com/mitchellh/mapstructure" to "github.com/go-viper/mapstructure/v2" to align with the rest of the codebase. This ensures consistency across all imports since both versions are already in go.mod and have compatible APIs.pkg/component/container/executor.go (2)
94-117: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Preserve the host environment for Docker/Podman subprocesses.
Line 116 passes only
r.envListto the runtime. SinceapplyCommandEnvreplacescmd.Envwhen non-empty, any component withenv:drops host values likeHOME,DOCKER_HOST, proxy vars, or runtime auth env from the Docker/Podman CLI process.Suggested fix
import ( "context" "fmt" + "os" "strings" "time" @@ if setter, ok := runtime.(ctr.EnvSetter); ok { - setter.SetEnv(r.envList) + setter.SetEnv(append(os.Environ(), r.envList...)) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/executor.go` around lines 94 - 117, The runtime method is passing only r.envList to the SetEnv call, which causes the host environment variables to be completely replaced instead of merged when applyCommandEnv processes the command environment. To fix this, in the runtime method where setter.SetEnv(r.envList) is called, merge r.envList with the host OS environment variables (obtainable via os.Environ()) so that component-specific environment variables are combined with essential host variables like HOME, DOCKER_HOST, and proxy settings, then pass the merged environment list to setter.SetEnv instead of just r.envList alone.
320-331: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Honor dry-run before destructive lifecycle actions.
r.dryRunis handled forbuild,push,pull,run, andup, butdown,restart,start,stop, andrmstill call runtime stop/start/remove paths. A dry-run should not mutate containers, and ideally should not require runtime discovery.Suggested pattern
func ExecuteDown(ctx context.Context, info *schema.ConfigAndStacksInfo) error { defer perf.Track(nil, "container.ExecuteDown")() - r, runtime, err := r2(ctx, info) + r, err := prepare(info) if err != nil { return err } + if r.dryRun { + ui.Infof("[dry-run] down %s", r.component) + return nil + } + runtime, err := r.runtime(ctx) + if err != nil { + return err + } return spinner.ExecWithSpinner(Apply the same early-return pattern to
restart,start,stop, andrm.Also applies to: 388-467
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/executor.go` around lines 320 - 331, The ExecuteDown function and related destructive lifecycle functions (ExecuteRestart, ExecuteStart, ExecuteStop, ExecuteRm) do not check the r.dryRun flag before executing container mutations, unlike build, push, pull, run, and up functions which already handle this. Add an early-return pattern at the beginning of each of these destructive lifecycle functions: immediately after getting the runtime and config (after the r2 call), check if r.dryRun is true and return nil early to prevent any actual container changes. This should be applied consistently to ExecuteDown, ExecuteRestart, ExecuteStart, ExecuteStop, and ExecuteRm.pkg/component/container/list.go (1)
109-110: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the inline comment punctuation.
Line 110 should end with a period.
Suggested fix
- continue // abstract components are blueprints, not deployable instances + continue // Abstract components are blueprints, not deployable instances.As per coding guidelines, all Go comments must end with periods.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.if isAbstractComponent(compData) { continue // Abstract components are blueprints, not deployable instances.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/component/container/list.go` around lines 109 - 110, The inline comment on the continue statement in the isAbstractComponent check is missing a period at the end. Add a period to the end of the comment "abstract components are blueprints, not deployable instances" to comply with Go coding guidelines that require all comments to end with periods.Source: Coding guidelines
pkg/runner/step/container_push_test.go (1)
17-73: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Replace manual
pushRuntimewith a generated mock.This hand-written test double is likely to drift and can mask unexpected method calls. Please switch to a
mockgen-generated runtime mock and explicit expectations.As per coding guidelines, "Generate mocks with
go.uber.org/mock/mockgenusing//go:generatedirectives. Never manual mocks."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/runner/step/container_push_test.go` around lines 17 - 73, The pushRuntime struct in container_push_test.go is a hand-written test double that should be replaced with a generated mock. Remove the entire pushRuntime struct definition and all its method implementations (Build, Create, Start, Stop, Remove, Inspect, List, Exec, Shell, Attach, Pull, Tag, Push, ImageInspect, Logs, Info). Instead, add a //go:generate directive at the top of the file to use mockgen from go.uber.org/mock to generate a mock for the container runtime interface, then update the test code to use the generated mock with explicit expectations for the Tag and Push methods rather than relying on manual call tracking.Source: Coding guidelines
pkg/schema/workflow.go (2)
10-12: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Move
ErrInvalidWorkflowContainerto the central error registry.This sentinel is declared locally in
pkg/schema; policy requires static errors to live inerrors/errors.goand be wrapped from there for consistency.As per coding guidelines, "All errors MUST be wrapped using static errors defined in
errors/errors.go... NEVER use dynamic errors directly."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/schema/workflow.go` around lines 10 - 12, The ErrInvalidWorkflowContainer error is currently defined locally in the schema package but must be moved to the central error registry for consistency with the coding guidelines. Remove the ErrInvalidWorkflowContainer variable declaration from workflow.go and add it to the central errors registry file, then update any usages in workflow.go to import and reference the error from the central registry instead of the local definition.Source: Coding guidelines
108-121: 🎯 Functional Correctness | 🔴 Critical
🧩 Analysis chain
🌐 Web query:
In gopkg.in/yaml.v3, when unmarshalling YAML into a struct field of type []string, does a scalar value liketest: "curl -f http://localhost || exit 1"decode successfully or return an error?💡 Result:
In gopkg.in/yaml.v3, unmarshalling a YAML scalar value (such as a string) into a struct field of type []string will return an error [1][2]. The library expects a YAML sequence (e.g.,
[item1, item2]or block format) when unmarshalling into a slice type [3][2]. If you provide a single scalar value instead of a sequence, the unmarshaller will fail because it cannot decode the scalar into the slice [2]. For instance, if your YAML istest: "curl -f http://localhost || exit 1", and the corresponding struct field isTest []string, the operation will report a type mismatch error (e.g., "cannot unmarshal!!str into []string") [1][2]. To successfully decode both single values and sequences into the same struct field, you would need to implement the Unmarshaler interface for that field or type, allowing custom logic to handle both scalar and sequence nodes manually [1].Citations:
- 1: https://github.com/go-yaml/yaml/blob/v3/yaml.go
- 2: https://stackoverflow.com/questions/75153219/error-when-parsing-yaml-file-on-golang-when-theres-a-dash-before-the-square-bra
- 3: https://github.com/go-yaml/yaml/blob/v3/decode_test.go
🏁 Script executed:
# Search for ContainerHealthCheck in the codebase to find its definition and any custom unmarshaling rg -A 20 "type ContainerHealthCheck" pkg/schema/workflow.go # Search for UnmarshalYAML or Unmarshaler implementations for this type rg -B 5 -A 15 "func.*ContainerHealthCheck.*Unmarshal" pkg/schema/ # Search for test files related to workflow.go or healthcheck fd -e test.go -e _test.go pkg/schema/ | head -20Repository: cloudposse/atmos
Length of output: 2802
🏁 Script executed:
# Search for test cases involving healthcheck and "test" field rg -i "healthcheck|test.*:" pkg/schema/ -A 3 -B 3 --type go | head -100Repository: cloudposse/atmos
Length of output: 6427
🏁 Script executed:
# Look for any YAML processing or custom decoding logic in schema package ast-grep outline pkg/schema/workflow.go | grep -i healthRepository: cloudposse/atmos
Length of output: 355
🏁 Script executed:
# Search for UnmarshalYAML method on ContainerHealthCheck rg "func.*ContainerHealthCheck.*UnmarshalYAML" pkg/schema/ -A 10 # Also search for any custom unmarshaling on the Test field rg "func.*Test.*UnmarshalYAML" pkg/schema/ -A 10 # Search more broadly for Unmarshaler implementations in workflow.go rg "UnmarshalYAML|Unmarshal" pkg/schema/workflow.go -B 2 -A 10Repository: cloudposse/atmos
Length of output: 14792
🏁 Script executed:
# Check workflow_container_test.go for healthcheck tests wc -l pkg/schema/workflow_container_test.go head -100 pkg/schema/workflow_container_test.goRepository: cloudposse/atmos
Length of output: 1941
🏁 Script executed:
# Search for actual healthcheck test YAML with test field rg -A 5 "healthcheck:" pkg/schema/workflow_container_test.goRepository: cloudposse/atmos
Length of output: 154
🏁 Script executed:
# Read the full workflow_container_test.go to see all tests cat -n pkg/schema/workflow_container_test.goRepository: cloudposse/atmos
Length of output: 2376
🏁 Script executed:
# Search for healthcheck in all test files rg "healthcheck" pkg/schema/ -i --type goRepository: cloudposse/atmos
Length of output: 855
🏁 Script executed:
# Check if there's any custom unmarshaling logic for healthcheck or the Test field ast-grep outline pkg/schema/workflow.go --match "ContainerHealthCheck"Repository: cloudposse/atmos
Length of output: 301
🏁 Script executed:
# Check if mapstructure is used for decoding and if it has different behavior rg "mapstructure" pkg/schema/workflow.go -B 2 -A 2 # Search for any preprocessing or custom decoding of workflow data rg "ContainerHealthCheck" pkg/ --type go -B 3 -A 3 # Look for any mapstructure-based decoding in the codebase fd -e "*.go" -x grep -l "mapstructure.*Decode\|mapstructure.*UnmarshalYAML" {} \;Repository: cloudposse/atmos
Length of output: 30576
🏁 Script executed:
# Check if there are integration tests or examples using healthcheck fd -e "*.yaml" -e "*.yml" . | xargs grep -l "healthcheck" 2>/dev/null | head -5Repository: cloudposse/atmos
Length of output: 154
🏁 Script executed:
# Look for any UnmarshalYAML on the Test field or in neighboring code rg "UnmarshalYAML" pkg/schema/workflow.go -B 5 -A 20 # Also check if there's mapstructure customization rg "DecodeHook\|TextUnmarshaler\|UnmarshalText" pkg/schema/ -i --type go # Check the container component for any custom decoding cat -n pkg/component/container/config.go | head -50Repository: cloudposse/atmos
Length of output: 3157
🏁 Script executed:
# Test creating a simple YAML with scalar test field to verify behavior python3 << 'PY' import subprocess import tempfile import os # Create a minimal Go test to check actual behavior test_code = '''package main import ( "fmt" "gopkg.in/yaml.v3" ) type ContainerHealthCheck struct { Test []string `yaml:"test"` } func main() { // Test 1: scalar value yamlScalar := `+"`test: \"curl -f http://localhost || exit 1\"`"+` var hc1 ContainerHealthCheck err1 := yaml.Unmarshal([]byte(yamlScalar), &hc1) if err1 != nil { fmt.Printf("Scalar test FAILED: %v\n", err1) } else { fmt.Printf("Scalar test PASSED: %v\n", hc1.Test) } // Test 2: list value yamlList := `+"`test: [\"curl\", \"-f\", \"http://localhost\"]`"+` var hc2 ContainerHealthCheck err2 := yaml.Unmarshal([]byte(yamlList), &hc2) if err2 != nil { fmt.Printf("List test FAILED: %v\n", err2) } else { fmt.Printf("List test PASSED: %v\n", hc2.Test) } } ''' # Write to a temp file and try to run (this will fail in sandbox, but we can see the code) print("Test code that would verify scalar vs list decoding:") print(test_code) PYRepository: cloudposse/atmos
Length of output: 929
Add custom
UnmarshalYAMLto handle scalar healthcheck.test values.The comment documents that
testmay be a bare string, but the field is typed as[]stringwith standard yaml tags. Without custom unmarshaling logic, yaml.v3 will fail when given a scalar (e.g.,test: "curl -f http://localhost || exit 1"). The codebase already demonstrates this pattern withWorkflowContainer.UnmarshalYAML. Implement the same forContainerHealthCheckto accept both scalar and sequence forms, converting scalars to single-element slices. Add regression tests for both scalar and list input.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/schema/workflow.go` around lines 108 - 121, The ContainerHealthCheck struct has a Test field typed as []string with standard YAML tags, but the documentation indicates it should accept both scalar strings and sequences. Implement a custom UnmarshalYAML method for the ContainerHealthCheck struct (following the pattern used in the existing WorkflowContainer.UnmarshalYAML) that handles unmarshaling the Test field as either a scalar string or a sequence, converting scalar values into single-element slices before assignment. Additionally, add regression tests that verify both scalar (bare string) and list forms of the test field unmarshal correctly.
…tone PR #2645 is labeled `minor`, so the release-docs gate requires a changelog entry and a roadmap update for the user-facing container component kind + compositions feature. - Add website/blog/2026-06-23-container-components.mdx (slug: container-components) - Mark the "Container components with component-instance lifecycle" and "Atmos compositions as system boundaries" milestones as shipped in the Container Composition & Local Development initiative (pr: 2645, changelog: container-components); recompute progress 29% -> 57% Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
website/src/data/roadmap.js (1)
314-316: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winAdd PR 2645 to the initiative-level
prslist.Two shipped milestones now reference
pr: 2645, but this initiative’sprsarray still only contains2607. Keeping these in sync avoids metadata drift in roadmap rendering.Suggested fix
prs: [ { number: 2607, title: 'feat: native Kubernetes components with GitOps deployment-repo delivery' }, + { number: 2645, title: 'feat: container components and compositions support' }, ],🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/data/roadmap.js` around lines 314 - 316, The prs array in this initiative currently only contains PR 2607, but two shipped milestones reference PR 2645. Add PR 2645 as a new object entry to the prs array alongside the existing 2607 entry, including the PR number and an appropriate title, to keep the metadata synchronized and prevent drift in roadmap rendering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@website/src/data/roadmap.js`:
- Around line 314-316: The prs array in this initiative currently only contains
PR 2607, but two shipped milestones reference PR 2645. Add PR 2645 as a new
object entry to the prs array alongside the existing 2607 entry, including the
PR number and an appropriate title, to keep the metadata synchronized and
prevent drift in roadmap rendering.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c14d22c8-b28c-410b-bd8d-64c14c518dbd
📒 Files selected for processing (2)
website/blog/2026-06-23-container-components.mdxwebsite/src/data/roadmap.js
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Warning Release Documentation RequiredThis PR is labeled
|
|
These changes were released in v1.222.0-rc.9. |
what
Adds a stack-scoped, Atmos-native
containercomponent kind — one component is one persistent service — plus first-class compositions membership.atmos container <verb> <component> -s <stack>):build,push,pull,run,up,ps,logs,exec,restart,stop,rm,down. Long-running containers are discovered by labels derived from the canonical instance address<stack>/container/<component>(nameatmos-<stack>-container-<component>), not local state files.up/runbuild the image first whenvars.build-stylebuild:is set and the image is missing.image,build,runare top-level component sections (reusing the workflow container-step structsContainerBuildStep/ContainerRunStep), not nested undervars. Container app env comes from the componentenv:section.atmos container listshows per-instance running state (running/stopped/unknown), discovered by label. The genericatmos list componentslists containers as a component type without container-specific status — consistent with terraform/ansible (there is noatmos terraform list/atmos ansible list).composition:membership field + a top-levelcompositions:section (closed for membership, open for fulfillment). Operating a component with undeclared membership is a hard error;atmos composition validate <name> -s <stack>reports fulfilled vs. not-provided services.metadata.inheritsinheritance + generic deep-merge of all top-level keys, so container honors catalog/abstract defaults like built-in kinds. Abstract components are rejected for execution and filtered from listings.container(and fixes the pre-existingansiblegap inlist components).why
Containers should be first-class, addressable component instances like terraform/helmfile/packer/ansible, and
atmos list componentsshould show whether each is running. A set of container components grouped by acompositionis "our own Compose" with nocompose.yaml. Implementsdocs/prd/container-components.md.references
docs/prd/container-components.md,docs/prd/compositions.mdexamples/container-component/,examples/compositions/website/docs/cli/commands/container/,website/docs/components/container.mdx.claude/skills/atmos-core-component-development/Note
Stacked on
osterman/container-step-prd(the container step), notmain. Changelog/roadmap are not required for this base (the gate is main-only); they'll go on the PR that brings the container feature tomain.🤖 Generated with Claude Code