Skip to content

feat(clp-package): Add configurable services restart policy for the Package Docker Compose project (resolves #1747).#1773

Merged
junhaoliao merged 12 commits into
y-scope:mainfrom
junhaoliao:restart
Jan 12, 2026
Merged

feat(clp-package): Add configurable services restart policy for the Package Docker Compose project (resolves #1747).#1773
junhaoliao merged 12 commits into
y-scope:mainfrom
junhaoliao:restart

Conversation

@junhaoliao

@junhaoliao junhaoliao commented Dec 15, 2025

Copy link
Copy Markdown
Member

Description

This PR adds a --restart-policy command-line option to start_clp.py, allowing users to configure Docker restart policies for CLP services. This addresses the need for automatic service recovery in production deployments.

Changes

1. Added RestartPolicyParamType to new cli_utils.py module

  • Created clp_package_utils/cli_utils.py for CLI-related utilities
  • RestartPolicyParamType validates Docker Compose restart policies
  • Supported policies:
    • no - Never restart
    • on-failure[:max-retries] - Restart only on non-zero exit code (optionally limit retries)
    • always - Always restart, including after Docker daemon restarts
    • unless-stopped - Like always, but won't restart after daemon restart if manually stopped

2. Added --restart-policy CLI option to start_clp.py

  • Default is on-failure:3 for production readiness (services restart up to 3 times on failure)

3. Updated DockerComposeController

  • Added restart_policy parameter to constructor
  • Exports CLP_RESTART_POLICY environment variable for Docker Compose

4. Updated docker-compose-all.yaml

  • Added restart: "${CLP_RESTART_POLICY:-on-failure:3}" to service defaults
  • Init containers (db-table-creator, results-cache-indices-creator) have explicit restart: "on-failure:3" to ensure they complete successfully regardless of the user-specified policy

Impact

  • New feature: Users can now configure restart policies via --restart-policy flag
  • Production ready by default: Services restart up to 3 times on failure (on-failure:3)
  • Customizable: Users can override with --restart-policy always, --restart-policy no, etc.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

task  # to rebuild the project
cd build/clp-package

# Tested --help shows the new --restart-policy option
./sbin/start-clp.sh --help
# Output includes:
#   --restart-policy RESTART-POLICY
#                                   Docker restart policy (always, no, on-
#                                   failure, unless-stopped, or on-failure:<max-
#                                   retries>).

# Tested invalid restart policies are rejected
./sbin/start-clp.sh --restart-policy invalid --setup-only
# Output: Error: Invalid value for '--restart-policy': Must be one of: always, no, on-failure, unless-stopped, or on-failure:<max-retries>.

./sbin/start-clp.sh --restart-policy on-failure:0 --setup-only
# Output: Error: Invalid value for '--restart-policy': max-retries must be a positive integer.

./sbin/start-clp.sh --restart-policy on-failure:abc --setup-only
# Output: Error: Invalid value for '--restart-policy': max-retries must be a positive integer.

./sbin/start-clp.sh --restart-policy always:3 --setup-only
# Output: Error: Invalid value for '--restart-policy': Must be one of: always, no, on-failure, unless-stopped, or on-failure:<max-retries>.

# Tested default restart policy (on-failure:3) with --setup-only mode
./sbin/start-clp.sh --setup-only
# 2026-01-02T22:53:55.761 INFO [start_clp] Completed setup. Services not started because `--setup-only` was specified.

# Verify .env file has default restart policy (on-failure:3)
grep CLP_RESTART_POLICY .env
# Output: CLP_RESTART_POLICY=on-failure:3

# Tested default restart policy applied to services (single-host deployment)
./sbin/start-clp.sh
# 2026-01-02T22:54:14.205 INFO [controller] Started CLP.

# Verify default restart policy (on-failure:3) is applied to both long-running services and init jobs
export INSTANCE_ID=$(cat var/log/instance-id)
docker inspect "clp-package-${INSTANCE_ID}-database-1" --format '{{.HostConfig.RestartPolicy.Name}}:{{.HostConfig.RestartPolicy.MaximumRetryCount}}'
# Output: on-failure:3 (long-running service)

docker inspect "clp-package-${INSTANCE_ID}-db-table-creator-1" --format '{{.HostConfig.RestartPolicy.Name}}:{{.HostConfig.RestartPolicy.MaximumRetryCount}}'
# Output: on-failure:3 (one-time initialization job)

./sbin/stop-clp.sh
# 2025-12-14T23:36:26.226 INFO [controller] Stopped CLP.

# Tested on-failure:3 behavior by temporarily modifying docker-compose-all.yaml
# to make services exit with non-zero codes
cp docker-compose-all.yaml docker-compose-all.yaml.backup

# Test 1: Modify db-table-creator (init job) to always fail
# Edit docker-compose-all.yaml and replace the db-table-creator command with:
#   command: ["sh", "-c", "exit 1"]

# Start the package - db-table-creator will fail and restart 3 times, blocking dependent services
./sbin/start-clp.sh
# Output: 
#  File "/usr/lib/python3.10/subprocess.py", line 526, in run  Error service "db-table-creator" 
#  didn't complete successfully: exit 1                                                           
# subprocess.CalledProcessError: Command '['docker', 'compose', '--project-name', 'clp-package-6fc0',
# '--file', 'docker-compose.yaml', 'up', '--detach', '--wait']' returned non-zero exit status 1.


docker inspect "clp-package-${INSTANCE_ID}-db-table-creator-1" --format 'RestartCount: {{.RestartCount}}, Status: {{.State.Status}}, ExitCode: {{.State.ExitCode}}'
# Output: RestartCount: 3, Status: exited, ExitCode: 1
# Init job restarted exactly 3 times then stopped (on-failure:3 working)

./sbin/stop-clp.sh
# 2025-12-15T01:45:33.789 INFO [controller] Stopped CLP.

# Test 2: Restore db-table-creator and modify database (long-running service) to always fail
cp docker-compose-all.yaml.backup docker-compose-all.yaml
# Edit docker-compose-all.yaml and add to the database service:
#   command: ["sh", "-c", "exit 1"]

# Start the package - database will fail and restart 3 times
./sbin/start-clp.sh
# subprocess.CalledProcessError: Command '['docker', 'compose', '--project-name', 'clp-package-6fc0',
# '--file', 'docker-compose.yaml', 'up', '--detach', '--wait']' returned non-zero exit status 1.

docker inspect "clp-package-${INSTANCE_ID}-database-1" --format 'RestartCount: {{.RestartCount}}, Status: {{.State.Status}}, ExitCode: {{.State.ExitCode}}'
# Output: RestartCount: 3, Status: exited, ExitCode: 1
# Long-running service restarted exactly 3 times then stopped (on-failure:3 working)

# Observe db-table-creator: it never started because it depends on database being healthy
docker inspect "clp-package-${INSTANCE_ID}-db-table-creator-1" --format 'RestartCount: {{.RestartCount}}, Status: {{.State.Status}}'
# Output: RestartCount: 0, Status: created
# db-table-creator was created but never started (waiting for database dependency)

./sbin/stop-clp.sh
# 2026-01-02T22:59:43.308 INFO [controller] Stopped CLP.

# Restore original docker-compose-all.yaml
cp docker-compose-all.yaml.backup docker-compose-all.yaml
rm docker-compose-all.yaml.backup

# Tested restart behavior with always policy - container restarts after crash
./sbin/start-clp.sh --restart-policy always
# 2026-01-02T23:01:26.809 INFO [controller] Started CLP.

docker inspect clp-package-${INSTANCE_ID}-webui-1 --format '{{.HostConfig.RestartPolicy.Name}}'
# Output: always

# Simulate a crash by killing the main process inside the container
docker exec clp-package-${INSTANCE_ID}-webui-1 kill 1
sleep 10

docker ps -a --filter "name=webui" --format "table {{.Names}}\t{{.Status}}"
# Output: clp-package-xxxx-webui-1   Up 9 seconds (healthy)
# Explanation: Container restarted automatically

docker inspect clp-package-${INSTANCE_ID}-webui-1 --format '{{.RestartCount}}'
# Output: 1 (confirms container was restarted)

for i in {1..4}; do
  docker exec clp-package-${INSTANCE_ID}-webui-1 kill 1
  sleep 1
done
docker inspect clp-package-${INSTANCE_ID}-webui-1 --format '{{.RestartCount}}'
# Output: 5 (confirms multiple restarts)

./sbin/stop-clp.sh
# 2025-12-14T23:37:57.571 INFO [controller] Stopped CLP.

# Tested restart behavior with no policy - container stays exited after crash
./sbin/start-clp.sh --restart-policy no
# 2026-01-02T23:05:01.611 INFO [controller] Started CLP.

docker inspect clp-package-${INSTANCE_ID}-webui-1 --format '{{.HostConfig.RestartPolicy.Name}}'
# Output: no

docker exec clp-package-${INSTANCE_ID}-webui-1 kill 1
sleep 2

docker ps -a --filter "name=webui" --format "table {{.Names}}\t{{.Status}}"
# Output: clp-package-xxxx-webui-1   Exited (0) 10 seconds ago
# Container stayed exited (no automatic restart)

./sbin/stop-clp.sh
# 2026-01-02T23:06:11.456 INFO [controller] Stopped CLP.
sleep 2

# Verify no CLP project exists after stop (containers are removed, not just stopped)
docker compose ls
# Output: NAME    STATUS    CONFIG FILES
# (empty - no running projects, so restart policy doesn't apply)

Summary by CodeRabbit

  • New Features

    • Added a --restart-policy CLI option (validates values: no, always, unless-stopped, on-failure:; default on-failure:3) and passes it to the runtime controller.
    • Runtime now exposes the chosen restart policy to container configuration and the deployment defaults use that policy.
  • Documentation

    • New and updated user docs for sbin scripts covering restart-policy usage, examples, notes, navigation and corrected relative links.

✏️ Tip: You can customize this high-level summary in your review settings.

@junhaoliao junhaoliao requested a review from a team as a code owner December 15, 2025 03:12
@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a validated Click parameter type for Docker restart policies, exposes a --restart-policy CLI option, threads the value into DockerComposeController (stored as self._restart_policy), exports it as CLP_RESTART_POLICY to container env, and uses that variable in docker‑compose defaults.

Changes

Cohort / File(s) Change Summary
CLI Parameter Validation
components/clp-package-utils/clp_package_utils/cli_utils.py
New RestartPolicyParamType (click.ParamType) and exported RESTART_POLICY. Validates no, always, unless-stopped, on-failure and on-failure:<max-retries> (positive integer).
Controller Integration
components/clp-package-utils/clp_package_utils/controller.py
DockerComposeController.__init__ gains restart_policy: str = "on-failure:3", stored as self._restart_policy; set_up_env injects CLP_RESTART_POLICY into container environment.
CLI Option & Wiring
components/clp-package-utils/clp_package_utils/scripts/start_clp.py
Added --restart-policy Click option (type RESTART_POLICY, default "on-failure:3"); main accepts restart_policy and passes it to DockerComposeController.
Docker Compose Configuration
tools/deployment/package/docker-compose-all.yaml
Uses variable substitution for default restart: restart: "${CLP_RESTART_POLICY:-on-failure:3}"; some services set explicit on-failure:3.
Docs / User Guide
docs/src/user-docs/...
Added docs for sbin scripts and restart-policy option; adjusted reference navigation and fixed relative links in admin-tools pages.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant CLI as start_clp.py
    participant Validator as RestartPolicyParamType
    participant Controller as DockerComposeController
    participant Env as Process Environment
    participant Compose as docker-compose

    User->>CLI: run CLI with --restart-policy on-failure:5
    CLI->>Validator: validate "on-failure:5"
    alt invalid
        Validator-->>CLI: raise BadParameter
        CLI-->>User: error
    else valid
        Validator-->>CLI: return "on-failure:5"
        CLI->>Controller: DockerComposeController(..., restart_policy="on-failure:5")
        Controller->>Controller: store self._restart_policy
        Controller->>Controller: set_up_env()
        Controller->>Env: export CLP_RESTART_POLICY=on-failure:5
        Controller->>Compose: run docker-compose (env provided)
        Compose->>Compose: apply restart: ${CLP_RESTART_POLICY:-on-failure:3}
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a configurable Docker restart policy feature for the CLP Package Docker Compose project.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67e6831 and b57cde8.

📒 Files selected for processing (4)
  • components/clp-package-utils/clp_package_utils/cli_utils.py (1 hunks)
  • components/clp-package-utils/clp_package_utils/controller.py (2 hunks)
  • components/clp-package-utils/clp_package_utils/scripts/start_clp.py (4 hunks)
  • tools/deployment/package/docker-compose-all.yaml (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-12-04T03:31:55.239Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1690
File: tools/deployment/package/docker-compose-all.yaml:424-427
Timestamp: 2025-12-04T03:31:55.239Z
Learning: In tools/deployment/package/docker-compose-all.yaml, the query-worker service writes to /var/data/streams (CLP_STREAM_OUTPUT_DIR_HOST mount), so this directory must remain read-write and should not be mounted with :ro flag.

Applied to files:

  • tools/deployment/package/docker-compose-all.yaml
📚 Learning: 2025-10-07T07:54:32.427Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1178
File: components/clp-py-utils/clp_py_utils/clp_config.py:47-47
Timestamp: 2025-10-07T07:54:32.427Z
Learning: In components/clp-py-utils/clp_py_utils/clp_config.py, the CONTAINER_AWS_CONFIG_DIRECTORY constant is intentionally set to pathlib.Path("/") / ".aws" (i.e., `/.aws`) rather than a user-specific home directory. This hardcoded path is part of the container orchestration design.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/start_clp.py
📚 Learning: 2025-10-20T20:19:40.504Z
Learnt from: 20001020ycx
Repo: y-scope/clp PR: 1436
File: components/clp-mcp-server/clp_mcp_server/clp_mcp_server.py:22-27
Timestamp: 2025-10-20T20:19:40.504Z
Learning: In the clp-mcp-server project (components/clp-mcp-server/clp_mcp_server/clp_mcp_server.py), the --config Click option should use exists=True to validate the configuration file path at option processing time, even though this requires the default path to exist on all machines.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/start_clp.py
🧬 Code graph analysis (1)
components/clp-package-utils/clp_package_utils/scripts/start_clp.py (1)
components/clp-package-utils/clp_package_utils/controller.py (1)
  • DockerComposeController (897-1073)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: package-image
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: build (macos-15)
  • GitHub Check: build (ubuntu-24.04)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (3)
tools/deployment/package/docker-compose-all.yaml (1)

10-10: Restart policy wiring and init-job overrides look sound

Using a global restart: "${CLP_RESTART_POLICY:-on-failure:3}" in x-service-defaults aligns with the controller’s CLP_RESTART_POLICY env var and keeps a sane default, while explicitly pinning db-table-creator and results-cache-indices-creator to restart: "on-failure:3" ensures init-style jobs don’t get stuck in unbounded restarts when users choose more aggressive policies. Also confirmed that the query-worker’s /var/data/streams bind remains read‑write (no :ro), so this change doesn’t regress the known requirement on that volume. Based on learnings, ...

Also applies to: 88-91, 213-216

components/clp-package-utils/clp_package_utils/cli_utils.py (1)

1-43: RestartPolicyParamType cleanly captures the intended restart policy space

The custom RestartPolicyParamType correctly accepts the four base policies plus on-failure:<max-retries> with a positive integer, and the failure messages are clear and helpful. Exporting a shared RESTART_POLICY instance keeps the Click wiring simple and consistent across scripts. The current lower‑case‑only handling is reasonable given Docker’s own convention.

components/clp-package-utils/clp_package_utils/scripts/start_clp.py (1)

12-12: CLI wiring for restart policy is consistent and end‑to‑end

Importing RESTART_POLICY, adding the --restart-policy option with a validated type and default "on-failure:3", threading restart_policy: str through main, and passing it into DockerComposeController ties the CLI, controller, and compose configuration together cleanly. The help text reusing RESTART_POLICY.VALID_POLICIES_STR also keeps user‑facing documentation in sync with the validator.

Also applies to: 35-40, 54-54, 105-105

Comment on lines 902 to 905
def __init__(self, clp_config: ClpConfig, instance_id: str, restart_policy: str = "on-failure:3") -> None:
self._project_name = f"clp-package-{instance_id}"
self._restart_policy = restart_policy
super().__init__(clp_config)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Controller restart policy handling is correct; consider de‑duplicating the default

The new restart_policy parameter is threaded cleanly into DockerComposeController and exposed as CLP_RESTART_POLICY in set_up_env, so the compose file can honour the CLI choice without changing existing call sites thanks to the default argument.

One thing to consider for maintainability: the default "on-failure:3" now lives in three places (this constructor default, the --restart-policy Click option, and the compose file’s ${CLP_RESTART_POLICY:-on-failure:3}). If you expect this default to evolve, it may be worth centralising the canonical value in Python (e.g., a shared constant imported by both the CLI and controller) to reduce drift risk, accepting that the compose default will still need manual sync.

Also applies to: 915-918

🤖 Prompt for AI Agents
In components/clp-package-utils/clp_package_utils/controller.py around lines
902-905 (and also 915-918), the literal default "on-failure:3" is duplicated;
create a single canonical Python constant (e.g., CLP_DEFAULT_RESTART_POLICY) in
a shared module (such as
components/clp-package-utils/clp_package_utils/constants.py), import and use
that constant as the default value for the DockerComposeController __init__
restart_policy parameter and wherever the CLI Click option defines its default,
and update set_up_env to use that constant when setting CLP_RESTART_POLICY so
the Python-side defaults are centralized (the compose file’s fallback default
can remain unchanged).

@sitaowang1998 sitaowang1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code LGTM. Should we add user doc for this change?

Comment thread components/clp-package-utils/clp_package_utils/cli_utils.py Outdated
@junhaoliao junhaoliao marked this pull request as draft December 16, 2025 06:07
@junhaoliao junhaoliao marked this pull request as ready for review January 2, 2026 23:07

@sitaowang1998 sitaowang1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM. Doc needs some improvements.

|---------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| `-c, --config PATH` | CLP package configuration file. Defaults to `etc/clp-config.yaml`. |
| `--restart-policy POLICY` | Docker restart policy for containers. See [Restart policies](#restart-policies) below. Defaults to `on-failure:3`. |
| `--setup-only` | Validate configuration and prepare directories without starting services. Useful for verifying configuration before deployment. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

setup-only sounds like we are running some setup operations. Maybe dry-run or validate? @kirkrodrigues What's your thought on this?
Also, since this is not directly related to this PR, we can open another issue on this if we decide to change.

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.

Hm, but we are only doing setup operations, no? What would you consider is not a setup operation?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we consider building the container a setup?

* Use `stop-clp.sh` to properly stop CLP.
* Initialization jobs (`db-table-creator`, `results-cache-indices-creator`) always use
`on-failure:3` regardless of this setting.
* Docker daemon restart (e.g., system reboot or `systemctl restart docker`) may cause some services

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should add instructions on how to handle the unexpected restart.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

addded

  * If services restart unexpectedly after a Docker daemon restart, run `stop-clp.sh` to clean up
    any partially started services bofore running `start-clp.sh`.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @docs/src/user-docs/reference-sbin-scripts/index.md:
- Line 56: Fix the spelling error in the sentence that currently reads "any
partially started services bofore running `start-clp.sh`" by changing "bofore"
to "before" so it reads "any partially started services before running
`start-clp.sh`".
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9532c0 and 15d3960.

📒 Files selected for processing (1)
  • docs/src/user-docs/reference-sbin-scripts/index.md
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-06-18T20:39:05.899Z
Learnt from: quinntaylormitchell
Repo: y-scope/clp PR: 968
File: docs/src/user-guide/quick-start/overview.md:73-109
Timestamp: 2025-06-18T20:39:05.899Z
Learning: The CLP project team prefers to use video content to demonstrate detailed procedural steps (like tarball extraction) rather than including every step in the written documentation, keeping the docs focused on conceptual guidance.

Applied to files:

  • docs/src/user-docs/reference-sbin-scripts/index.md
📚 Learning: 2025-08-25T06:32:48.313Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1261
File: docs/src/dev-guide/components-core/manylinux-2-28-deps-install.md:24-24
Timestamp: 2025-08-25T06:32:48.313Z
Learning: In the CLP project documentation, when linking to scripts or other files within the repository, use relative paths (e.g., components/core/tools/scripts/...) rather than commit-pinned GitHub URLs to ensure docs and referenced files always belong to the same commit and stay synchronized.

Applied to files:

  • docs/src/user-docs/reference-sbin-scripts/index.md
📚 Learning: 2025-07-01T14:52:15.217Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:6-15
Timestamp: 2025-07-01T14:52:15.217Z
Learning: For installation scripts in the CLP project, maintain consistency in command patterns across different platforms (e.g., using separate update and install commands like `apk update && apk add`, `apt update && apt install`, `yum update && yum install`) rather than platform-specific optimizations, to ensure uniform script structure and readability.

Applied to files:

  • docs/src/user-docs/reference-sbin-scripts/index.md
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • docs/src/user-docs/reference-sbin-scripts/index.md
📚 Learning: 2024-11-18T16:49:20.248Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/del_archives.py:56-65
Timestamp: 2024-11-18T16:49:20.248Z
Learning: When reviewing wrapper scripts in `components/clp-package-utils/clp_package_utils/scripts/`, note that it's preferred to keep error handling simple without adding extra complexity.

Applied to files:

  • docs/src/user-docs/reference-sbin-scripts/index.md
🪛 LanguageTool
docs/src/user-docs/reference-sbin-scripts/index.md

[uncategorized] ~56-~56: Possible missing comma found.
Context: ...to clean up any partially started services bofore runningstart-clp.sh`. ::: ---...

(AI_HYDRA_LEO_MISSING_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: check-generated
  • GitHub Check: package-image
  • GitHub Check: lint-check (macos-15)
🔇 Additional comments (5)
docs/src/user-docs/reference-sbin-scripts/index.md (5)

1-8: LGTM: Clear introduction and structure.

The introduction provides a concise overview of the sbin scripts with helpful navigation links.


11-28: LGTM: Comprehensive documentation of start-clp.sh options.

The options table clearly documents the new --restart-policy option with its default value (on-failure:3) and cross-references the detailed restart policies section below.


30-41: LGTM: Accurate restart policy documentation.

The restart policies table correctly describes the standard Docker restart policies with clear, concise descriptions. The inclusion of an example (on-failure:3) is helpful for users.


61-76: LGTM: Clear stop-clp.sh documentation.

The documentation for stop-clp.sh is clear and appropriately concise for this script.


77-83: LGTM: Proper Sphinx toctree structure.

The toctree directive correctly links to the admin-tools documentation page.

restarts containers that exited non-zero. Most CLP services exit cleanly (code 0) and won't
restart, but some may restart and eventually fail without their dependencies.
* If services restart unexpectedly after a Docker daemon restart, run `stop-clp.sh` to clean up
any partially started services bofore running `start-clp.sh`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo: "bofore" should be "before".

There's a spelling error in the note.

📝 Proposed fix
-    any partially started services bofore running `start-clp.sh`.
+    any partially started services before running `start-clp.sh`.
📝 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.

Suggested change
any partially started services bofore running `start-clp.sh`.
any partially started services before running `start-clp.sh`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~56-~56: Possible missing comma found.
Context: ...to clean up any partially started services bofore runningstart-clp.sh`. ::: ---...

(AI_HYDRA_LEO_MISSING_COMMA)

🤖 Prompt for AI Agents
In @docs/src/user-docs/reference-sbin-scripts/index.md at line 56, Fix the
spelling error in the sentence that currently reads "any partially started
services bofore running `start-clp.sh`" by changing "bofore" to "before" so it
reads "any partially started services before running `start-clp.sh`".

@junhaoliao junhaoliao merged commit 75d261a into y-scope:main Jan 12, 2026
21 checks passed
davidlion pushed a commit to davidlion/clp that referenced this pull request Jan 17, 2026
…ackage Docker Compose project (resolves y-scope#1747). (y-scope#1773)

Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com>
@junhaoliao junhaoliao deleted the restart branch May 7, 2026 19:46
junhaoliao added a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…ackage Docker Compose project (resolves y-scope#1747). (y-scope#1773)

Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com>
junhaoliao added a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…ackage Docker Compose project (resolves y-scope#1747). (y-scope#1773)

Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com>
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.

3 participants