Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions PODMAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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"
]
}
}
Expand Down Expand Up @@ -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"

Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/TESTING_STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 9 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_container_bundle_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/test_container_production_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down