Skip to content
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

feat: Docker volume migration - OSS improvements Part 2 #6962

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

prashant-shahi
Copy link
Member

@prashant-shahi prashant-shahi commented Jan 29, 2025

Summary

This is the second part of the OSS installation and improvement PR.

Users must run the migration script to migrate an existing SigNoz installation from Docker Standalone or Docker Swarm.

Related Issues / PR's

NA

Screenshots

NA

Affected Areas and Manually Tested Areas

NA


Important

Introduces a migration script and updates Docker Compose files to transition SigNoz installations from bind mounts to Docker volumes.

  • Migration Script:
    • Adds migrate.sh in scripts/volume-migration to migrate data from bind mounts to Docker volumes.
    • Supports standalone and swarm deployments.
    • Handles components: clickhouse, zookeeper, signoz, alertmanager.
    • Includes migrate() and post_migrate() functions for data migration and cleanup.
  • Docker Compose Updates:
    • Updates docker-compose.yaml, docker-compose.ha.yaml, docker-compose.testing.yaml to use named volumes instead of bind mounts for clickhouse, zookeeper, alertmanager, and sqlite.
    • Adds volume definitions for signoz-clickhouse, signoz-zookeeper-1, etc.
  • Deprecation Notice:
    • Adds .deprecated file in deploy/docker/clickhouse-setup indicating the deprecation of the old data directory and instructing users to use the migration script.

This description was created by Ellipsis for ab46dd2. It will automatically update as commits are pushed.

Signed-off-by: Prashant Shahi <prashant@signoz.io>
@prashant-shahi prashant-shahi requested a review from a team as a code owner January 29, 2025 07:21
@github-actions github-actions bot added enhancement New feature or request docs required labels Jan 29, 2025
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@prashant-shahi prashant-shahi changed the title feat: project and volume migration for Docker/Swarm feat: project and Docker volume migration - OSS improvements Part 2 Jan 29, 2025
@prashant-shahi prashant-shahi changed the title feat: project and Docker volume migration - OSS improvements Part 2 feat: Docker volume migration - OSS improvements Part 2 Jan 29, 2025
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to dcc8906 in 2 minutes and 1 seconds

More details
  • Looked at 880 lines of code in 7 files
  • Skipped 1 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. scripts/volume-migration/migrate.sh:350
  • Draft comment:
    Check if the volume already exists before creating it to avoid conflicts or data overwrites.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
  1. Docker volume create is idempotent - it safely handles the case where a volume already exists. 2. The command is already handling errors by redirecting output. 3. Adding an explicit check would be redundant and add complexity without benefit. 4. The current implementation is following Docker best practices.
    The comment might be concerned about race conditions or concurrent migrations that could cause data corruption.
    Docker handles volume creation atomically and safely - there's no risk of data corruption from concurrent creation attempts. The existing code is actually the safer approach.
    Delete the comment. The current implementation using Docker's idempotent volume create is the correct and safe approach.
2. deploy/docker-swarm/docker-compose.yaml:85
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other similar instances in this PR.
  • Reason this comment was not posted:
    Comment was on unchanged code.
3. deploy/docker/docker-compose.ha.yaml:92
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other similar instances in this PR.
  • Reason this comment was not posted:
    Marked as duplicate.
4. deploy/docker/docker-compose.testing.yaml:88
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other similar instances in this PR.
  • Reason this comment was not posted:
    Marked as duplicate.
5. deploy/docker/docker-compose.yaml:88
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other similar instances in this PR.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_c1HgCsaMby72Y6HM


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

scripts/volume-migration/migrate.sh Show resolved Hide resolved
scripts/volume-migration/migrate.sh Show resolved Hide resolved
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 360e0b8 in 29 seconds

More details
  • Looked at 138 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. scripts/volume-migration/migrate.sh:362
  • Draft comment:
    Consider adding error handling for the docker run command to ensure Docker is installed and running. This will prevent misleading error messages if Docker is not available.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. scripts/volume-migration/migrate.sh:385
  • Draft comment:
    Consider adding error handling for the docker run command to ensure Docker is installed and running. This will prevent misleading error messages if Docker is not available.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_LCuhjl2sVmpLJFrf


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Signed-off-by: Prashant Shahi <prashant@signoz.io>
grandwizard28
grandwizard28 previously approved these changes Jan 29, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on ab46dd2 in 14 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. scripts/volume-migration/migrate.sh:518
  • Draft comment:
    Changing return 1 to exit 1 is appropriate here to ensure the script terminates on invalid options, preventing further execution with incorrect input.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from return 1 to exit 1 in the parse_args function is appropriate because the script should terminate if there's an error in parsing arguments. This ensures that the script does not proceed with invalid or incomplete input.

Workflow ID: wflow_XsjNz6TUzeCyhVdl


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@prashant-shahi prashant-shahi merged commit 36f91d1 into main Jan 29, 2025
16 checks passed
@prashant-shahi prashant-shahi deleted the chore/oss-improvements-p2 branch January 29, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants