Skip to content

Add documentation on Cleanup options#2623

Merged
clayandgen merged 4 commits intomainfrom
documentation/cleanup
Dec 12, 2025
Merged

Add documentation on Cleanup options#2623
clayandgen merged 4 commits intomainfrom
documentation/cleanup

Conversation

@clayandgen
Copy link
Copy Markdown
Contributor

closes #2601

@clayandgen clayandgen added the documentation Improvements or additions to documentation label Dec 12, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.08%. Comparing base (c1f3d25) to head (c7e4338).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2623      +/-   ##
==========================================
- Coverage   79.08%   79.08%   -0.01%     
==========================================
  Files         661      661              
  Lines       51995    51995              
  Branches      734      734              
==========================================
- Hits        41120    41119       -1     
- Misses      10795    10796       +1     
  Partials       80       80              
Flag Coverage Δ
python 81.04% <ø> (-0.02%) ⬇️
ruby-api 84.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcosgriff
Copy link
Copy Markdown
Contributor

I added a bunch of help on the individual commands that might be helpful.

❯ ./openc3.sh cleanup --help
Usage: ./openc3.sh cleanup [local] [force]

Remove all COSMOS Core docker volumes and data.

WARNING: This is a destructive operation that removes ALL COSMOS Core data!

Arguments:
  local    Also remove local plugin files in plugins/DEFAULT/
  force    Skip confirmation prompt

Examples:
  ./openc3.sh cleanup              # Remove volumes (with confirmation)
  ./openc3.sh cleanup force        # Remove volumes (no confirmation)
  ./openc3.sh cleanup local        # Remove volumes and local plugins
  ./openc3.sh cleanup local force  # Remove volumes and local plugins (no confirmation)

Options:
  -h, --help    Show this help message

❯ ./openc3.sh stop --help
Usage: ./openc3.sh stop

Stop all COSMOS Core containers gracefully.

This command:
  1. Stops operator, script-runner-api, and cmd-tlm-api containers
  2. Waits 5 seconds
  3. Runs docker compose down with 30 second timeout

Options:
  -h, --help    Show this help message

❯ ./openc3.sh run --help
Usage: ./openc3.sh run

Run all COSMOS Core containers in detached mode.

Containers will start in the background using docker compose up -d.

After starting, check status with:
  docker compose ps                   # Show running containers
  docker compose logs -f              # Follow all logs
  docker compose logs -f SERVICE      # Follow specific service logs

Access COSMOS Core:
  http://localhost:2900               # COSMOS Core web interface

Common services:
  openc3-operator                     Main orchestration service
  openc3-cosmos-cmd-tlm-api          Command/Telemetry API
  openc3-cosmos-script-runner-api    Script execution service
  openc3-redis                        Redis database
  openc3-minio                        Object storage

Options:
  -h, --help    Show this help message

Copy link
Copy Markdown
Contributor

@mcosgriff mcosgriff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--help added to those commands could be useful

Copy link
Copy Markdown
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome but reminds me that we don't really have a page for the base openc3.sh commands: start, stop, build, run. You've documented cleanup and basically stop and run but I almost feel like this whole section should be part of https://docs.openc3.com/docs/getting-started/cli and maybe we reference it here? Thoughts?


#### To remove Docker networks, volumes, data, and Local Mode changes

If you're running COSMOS in Local Mode, you may notice that modified files and newly created files are added to your host machine, under the `plugins` directory in your repository. Files are synced between server and local file system, which eliminates the need for rebuilding & re-uploading a plugin for development. If you want these local changes to also be cleaned up, run the following:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link "Local Mode" to the page https://docs.openc3.com/docs/guides/local-mode and change the text to "If you're running COSMOS with Local Mode ...". It's not really a mode per say and that can be confusing to people. Like I'm in not in Local Mode what mode am I in? Remote Mode?

docker images | grep openc3inc | awk '{print $3}' | xargs docker rmi
```

Or to remove all unused Docker images:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add this:
:::warning Docker image prune -a removes all unused images
With -a flag: The command docker image prune -a is more aggressive and removes all unused images, meaning any image that is not currently associated with a running or stopped container. Use this with caution, as it might remove base images you want to keep.
:::

@jmthomas
Copy link
Copy Markdown
Member

Actually it looks like we do document run in the installation page so maybe this does make sense to add there.

One other thing I noticed: The existing page has ALL CAPS headers. Yours are camelcase which I prefer and I believe matches all the rest of our docs. Please update the existing page to be camelcase.

@clayandgen clayandgen merged commit f335100 into main Dec 12, 2025
26 of 28 checks passed
@clayandgen clayandgen deleted the documentation/cleanup branch December 12, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation on how to tear down COSMOS

3 participants