Skip to content

feat(cli): add 'concore clean' to remove run leftovers from a study - #691

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-clean
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-clean

Conversation

@yadavchiragg

Copy link
Copy Markdown

Why

After running a study, each node leaves concoreout.txt and concorepid, and the edge directories hold data files. Today users have to run the generated clear script, which only handles the edge directories and does not exist for every build type, or delete files by hand.

What

concore clean <study_dir>

  • removes each node's concoreout.txt and concorepid, and the data files in edge directories (the same files the generated clear script removes)
  • edge directories are found by following each node's in*/out* links, so unrelated directories (results/, src/, node folders) are never touched
  • never follows a link that points outside the study
  • --dry-run lists without deleting; asks for confirmation unless -y
  • refuses while a node's pid is alive (--force to override)

Testing

  • tests/test_clean_command.py (8 tests) incl. keeps results/ and src/, symlink-escape, running-node refusal, confirmation
  • existing CLI tests, ruff format/check clean
  • tried on a generated study

Docs

Added concore clean to concore_cli/README.md

Removes each node's concoreout.txt/concorepid and the data files in edge directories (what the generated clear script removes), with --dry-run, --yes and --force, refusing while a node is running. Tests and docs included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant