diff --git a/PODMAN.md b/PODMAN.md index 8df8946..bcb5c0a 100644 --- a/PODMAN.md +++ b/PODMAN.md @@ -14,7 +14,9 @@ cd troubleshoot-mcp-server ./scripts/build.sh ``` -This will create a Podman image named `mcp-server-troubleshoot:latest`. +This will create a Podman image named `troubleshoot-mcp-server-dev:latest` for local development. + +**Note**: Local development builds use the `-dev` suffix to avoid conflicts with official production releases. The production image is named `troubleshoot-mcp-server:latest`. ## Running the Container @@ -31,7 +33,7 @@ export SBCTL_TOKEN="your_token_here" podman run -i --rm \ -v "$(pwd)/bundles:/data/bundles" \ -e SBCTL_TOKEN="$SBCTL_TOKEN" \ - mcp-server-troubleshoot:latest + troubleshoot-mcp-server-dev:latest ``` ### Command Parameters Explained @@ -92,7 +94,7 @@ To use the Podman container with MCP clients (such as Claude or other AI models) You can get the recommended configuration by running: ```bash -podman run --rm mcp-server-troubleshoot:latest --show-config +podman run --rm troubleshoot-mcp-server-dev:latest --show-config ``` The output will provide a ready-to-use configuration for MCP clients: @@ -110,7 +112,7 @@ The output will provide a ready-to-use configuration for MCP clients: "${HOME}/bundles:/data/bundles", "-e", "SBCTL_TOKEN=${SBCTL_TOKEN}", - "mcp-server-troubleshoot:latest" + "troubleshoot-mcp-server-dev:latest" ] } } @@ -143,7 +145,7 @@ In the Inspector UI: podman run -i --rm \ -v "$(pwd)/bundles:/data/bundles" \ -e SBCTL_TOKEN="$SBCTL_TOKEN" \ - mcp-server-troubleshoot:latest + troubleshoot-mcp-server-dev:latest ``` 4. Click "Save" diff --git a/README.md b/README.md index cbc49ad..d43e2ba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The easiest way to get started is using Podman: podman run -i --rm \ -v "/path/to/bundles:/data/bundles" \ -e SBCTL_TOKEN="your-token" \ - mcp-server-troubleshoot:latest + troubleshoot-mcp-server-dev:latest ``` See the [Podman documentation](PODMAN.md) for comprehensive container configuration details. @@ -58,6 +58,37 @@ export SBCTL_TOKEN=your-token uv run python -m mcp_server_troubleshoot ``` +## Container Image Variants + +This project provides two distinct container image variants: + +### Development Image: `troubleshoot-mcp-server-dev:latest` +- **Purpose**: Local development and testing +- **Built by**: `./scripts/build.sh` (default) +- **Usage**: When building from source or developing locally +- **Example**: + ```bash + ./scripts/build.sh + podman run -i --rm troubleshoot-mcp-server-dev:latest + ``` + +### Production Image: `troubleshoot-mcp-server:latest` +- **Purpose**: Official releases and production deployments +- **Built by**: CI/CD pipeline with `IMAGE_NAME=troubleshoot-mcp-server ./scripts/build.sh` +- **Usage**: In production environments or when using official releases +- **Example**: + ```bash + IMAGE_NAME=troubleshoot-mcp-server ./scripts/build.sh + podman run -i --rm troubleshoot-mcp-server:latest + ``` + +### Why Two Variants? + +The `-dev` suffix prevents conflicts between local development images and official production releases. This allows users to: +- Use official container releases without interference from local builds +- Develop and test locally without overwriting production images +- Maintain clear separation between development and production environments + ## Documentation For comprehensive documentation, see: diff --git a/docs/TESTING_STRATEGY.md b/docs/TESTING_STRATEGY.md index f9b25f1..acf0d8a 100644 --- a/docs/TESTING_STRATEGY.md +++ b/docs/TESTING_STRATEGY.md @@ -257,7 +257,7 @@ uv run pytest tests/e2e/test_direct_tool_integration.py::TestDirectToolIntegrati **Check container logs**: ```bash # Run container interactively -podman run -it --rm troubleshoot-mcp-server:latest /bin/sh +podman run -it --rm troubleshoot-mcp-server-dev:latest /bin/sh ``` ## Future Enhancements diff --git a/scripts/build.sh b/scripts/build.sh index 976068b..4b4a8cd 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -3,7 +3,7 @@ set -euo pipefail # Configuration - use environment variables if set, otherwise use defaults # This allows GitHub Actions to override these values -IMAGE_NAME=${IMAGE_NAME:-"troubleshoot-mcp-server"} +IMAGE_NAME=${IMAGE_NAME:-"troubleshoot-mcp-server-dev"} IMAGE_TAG=${IMAGE_TAG:-"latest"} # Print commands before executing them diff --git a/tasks/backlog/fix-container-name-conflicts.md b/tasks/active/fix-container-name-conflicts.md similarity index 94% rename from tasks/backlog/fix-container-name-conflicts.md rename to tasks/active/fix-container-name-conflicts.md index b91d923..7bbd8dc 100644 --- a/tasks/backlog/fix-container-name-conflicts.md +++ b/tasks/active/fix-container-name-conflicts.md @@ -1,9 +1,16 @@ # Fix Container Name Conflicts Between Development and Production -**Status**: backlog +**Status**: active **Priority**: high **Estimated Effort**: 2-4 hours **Category**: infrastructure +**Started**: 2025-07-28 + +## Progress Log +- 2025-07-28: Started task, created worktree, began implementation +- 2025-07-28: Completed core changes - updated build script and test harnesses +- 2025-07-28: Updated documentation (PODMAN.md, README.md, TESTING_STRATEGY.md) +- 2025-07-28: All tests passing, quality checks passed, PR created: #46 ## Problem Statement diff --git a/tests/conftest.py b/tests/conftest.py index 147d678..8257dd3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -174,7 +174,7 @@ def build_container_image(project_root): try: # Remove any existing image first to ensure a clean build subprocess.run( - ["podman", "rmi", "-f", "troubleshoot-mcp-server:latest"], + ["podman", "rmi", "-f", "troubleshoot-mcp-server-dev:latest"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=30, @@ -247,11 +247,17 @@ def container_image(request): pytest.skip(f"Failed to build container image: {result.stderr}") # Yield to allow tests to run - yield "troubleshoot-mcp-server:latest" + yield "troubleshoot-mcp-server-dev:latest" # Explicitly clean up any running containers containers_result = subprocess.run( - ["podman", "ps", "-q", "--filter", "ancestor=troubleshoot-mcp-server:latest"], + [ + "podman", + "ps", + "-q", + "--filter", + "ancestor=troubleshoot-mcp-server-dev:latest", + ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, diff --git a/tests/e2e/test_container_bundle_validation.py b/tests/e2e/test_container_bundle_validation.py index 654f41a..d72cf88 100644 --- a/tests/e2e/test_container_bundle_validation.py +++ b/tests/e2e/test_container_bundle_validation.py @@ -21,7 +21,7 @@ logger = logging.getLogger(__name__) # Container image name (matches build.sh defaults) -CONTAINER_IMAGE = "troubleshoot-mcp-server:latest" +CONTAINER_IMAGE = "troubleshoot-mcp-server-dev:latest" CONTAINER_RUNTIME = "podman" # Could be "docker" if preferred diff --git a/tests/e2e/test_container_production_validation.py b/tests/e2e/test_container_production_validation.py index 18d5275..b9ddd66 100644 --- a/tests/e2e/test_container_production_validation.py +++ b/tests/e2e/test_container_production_validation.py @@ -273,12 +273,12 @@ def test_production_container_mcp_protocol(): # Check if the required container image exists try: result = subprocess.run( - [runtime, "image", "exists", "troubleshoot-mcp-server:latest"], + [runtime, "image", "exists", "troubleshoot-mcp-server-dev:latest"], capture_output=True, ) if result.returncode != 0: pytest.skip( - "Container image troubleshoot-mcp-server:latest not available - build first with: MELANGE_TEST_BUILD=true ./scripts/build.sh" + "Container image troubleshoot-mcp-server-dev:latest not available - build first with: MELANGE_TEST_BUILD=true ./scripts/build.sh" ) except FileNotFoundError: pytest.skip(f"Container runtime {runtime} not found") @@ -309,7 +309,7 @@ def test_production_container_mcp_protocol(): container_name, "--rm", "-i", - "troubleshoot-mcp-server:latest", # Use the built image directly + "troubleshoot-mcp-server-dev:latest", # Use the built image directly ], input=request_json + "\n", capture_output=True,