-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[utils/common] Check only for ovos_core and ovos_messagebus #243
Conversation
…f all ovos containers
WalkthroughThe pull request modifies the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
utils/common.sh (2)
150-153
: LGTM! Consider adding error handling for Docker/Podman commands.The container name filter changes look good and align with the PR objectives. The new pattern correctly targets only the main OVOS components while maintaining support for hivemind containers.
Consider adding error handling for Docker/Podman command failures. Here's a suggested improvement:
- if [ -n "$(docker ps -a --filter="name=ovos_core|ovos_messagebus|hivemind*" -q 2>>"$LOG_FILE")" ]; then + docker_containers=$(docker ps -a --filter="name=ovos_core|ovos_messagebus|hivemind*" -q 2>>"$LOG_FILE") || docker_containers="" + if [ -n "$docker_containers" ]; then export EXISTING_INSTANCE="true" export INSTANCE_TYPE="containers" - elif [ -n "$(podman ps -a --filter="name=ovos_core|ovos_messagebus|hivemind*" -q 2>>"$LOG_FILE")" ]; then + elif podman_containers=$(podman ps -a --filter="name=ovos_core|ovos_messagebus|hivemind*" -q 2>>"$LOG_FILE") && [ -n "$podman_containers" ]; then export EXISTING_INSTANCE="true" export INSTANCE_TYPE="containers"
Line range hint
146-149
: Add function description and consider using constants.The function would benefit from a clear description of its purpose, return values, and side effects (exported variables).
Consider these improvements:
+# Detect existing OVOS installations by checking for: +# 1. Docker containers (ovos_core, ovos_messagebus, or hivemind*) +# 2. Podman containers (same pattern as Docker) +# 3. Python virtual environment at ~/.venvs/ovos +# +# Exports: +# EXISTING_INSTANCE: "true" if any installation is found, "false" otherwise +# INSTANCE_TYPE: "containers" for Docker/Podman, "virtualenv" for Python venv + +# Container name patterns +OVOS_CONTAINER_PATTERN="ovos_core|ovos_messagebus|hivemind*" + function detect_existing_instance() { echo -ne "➤ Checking for existing instance... " - if [ -n "$(docker ps -a --filter="name=ovos_core|ovos_messagebus|hivemind*" -q 2>>"$LOG_FILE")" ]; then + if [ -n "$(docker ps -a --filter="name=$OVOS_CONTAINER_PATTERN" -q 2>>"$LOG_FILE")" ]; then
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
utils/common.sh
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: shell-testing
if other containers with
ovos
in the name exists then the installer will ask for uninstall even if OVOS has been uninstalled. This might be due to containers such asovos_stt*
,ovos_tts*
, etc...Summary by CodeRabbit