-
Notifications
You must be signed in to change notification settings - Fork 578
Publish to Docker Hub #468
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
Conversation
Removes the publish-to-testpypi job from the GitHub Actions workflow to streamline the publishing process and only publish to production PyPI.
Reviewer's GuideAdds a manual GitHub Actions workflow to build and publish a Docker image for the MCP for Unity server to Docker Hub, documents how to use the Docker image, and simplifies the existing Python publishing workflow by removing the TestPyPI job. Sequence diagram for manual Docker publish workflowsequenceDiagram
actor Developer
participant GitHubRepo
participant WorkflowPublishDocker
participant GitHubActionsRunner as GitHub_Actions_Runner
participant DockerHub
Developer->>GitHubRepo: Push tags or changes (optional)
Developer->>WorkflowPublishDocker: Trigger workflow_dispatch
WorkflowPublishDocker->>GitHubActionsRunner: Start job push_to_registry
GitHubActionsRunner->>GitHubRepo: actions/checkout@v6
GitHubRepo-->>GitHubActionsRunner: Source code (including Server/Dockerfile)
GitHubActionsRunner->>DockerHub: docker/login-action@v3 using secrets
DockerHub-->>GitHubActionsRunner: Authenticated session
GitHubActionsRunner->>GitHubActionsRunner: docker/metadata-action@v5
GitHubActionsRunner-->>GitHubActionsRunner: tags and labels (semver, branch, sha)
GitHubActionsRunner->>GitHubActionsRunner: docker/setup-buildx-action@v3
GitHubActionsRunner->>DockerHub: docker/build-push-action@v6
activate DockerHub
DockerHub-->>GitHubActionsRunner: Image mcp-for-unity-server stored with tags
deactivate DockerHub
GitHubActionsRunner-->>Developer: Job success, Docker image available
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded@msanatan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 27 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughIntroduces a new GitHub Actions workflow for publishing Docker images to Docker Hub, removes TestPyPI publishing from the existing PyPI workflow, and adds documentation for the Docker image quick start and configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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. Comment |
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.
Hey - I've found 2 issues, and left some high level feedback:
- The Docker workflow uses
${{ secrets.DOCKER_USERNAME }}/mcp-for-unity-serverwhile the README hard-codesmsanatan/mcp-for-unity-server; consider aligning these (or clearly documenting the expected Docker Hub namespace) so the published image name always matches the instructions. - In
.github/workflows/publish-docker.yml, thepackages: writepermission appears unused since the workflow only interacts with Docker Hub; you can likely drop it to keep permissions minimal.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Docker workflow uses `${{ secrets.DOCKER_USERNAME }}/mcp-for-unity-server` while the README hard-codes `msanatan/mcp-for-unity-server`; consider aligning these (or clearly documenting the expected Docker Hub namespace) so the published image name always matches the instructions.
- In `.github/workflows/publish-docker.yml`, the `packages: write` permission appears unused since the workflow only interacts with Docker Hub; you can likely drop it to keep permissions minimal.
## Individual Comments
### Comment 1
<location> `.github/workflows/publish-docker.yml:10-14` </location>
<code_context>
+ push_to_registry:
+ name: Push Docker image to Docker Hub
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
</code_context>
<issue_to_address>
**🚨 suggestion (security):** The `packages: write` permission appears unnecessary for pushing directly to Docker Hub.
Since this job only logs in to Docker Hub and doesn’t touch GitHub Packages, `packages: write` is redundant. Consider removing it—or the whole `permissions` block if nothing needs elevation—to follow least-privilege best practices.
```suggestion
steps:
```
</issue_to_address>
### Comment 2
<location> `Server/DOCKER_OVERVIEW.md:51` </location>
<code_context>
+
+## Configuration
+
+The server connects to Unity Editor automatically when both are running. No additional configuration needed.
+
+**Environment Variables:**
</code_context>
<issue_to_address>
**nitpick (typo):** Consider making the sentence more grammatically complete.
For example: "The server connects to the Unity Editor automatically when both are running. No additional configuration is needed." Adding "the" and "is" is optional but improves readability.
```suggestion
The server connects to the Unity Editor automatically when both are running. No additional configuration is needed.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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: 2
🧹 Nitpick comments (1)
.github/workflows/publish-docker.yml (1)
38-45: Consider enabling Docker layer caching for faster builds.Docker layer caching can significantly speed up subsequent builds by reusing unchanged layers.
🔎 Proposed enhancement to enable layer caching
- name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . file: Server/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=maxThis uses GitHub Actions cache to store and reuse Docker layers between builds.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/publish-docker.yml(1 hunks).github/workflows/publish-pypi.yml(1 hunks)Server/DOCKER_OVERVIEW.md(1 hunks)
⏰ 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). (1)
- GitHub Check: Sourcery review
🔇 Additional comments (3)
.github/workflows/publish-pypi.yml (1)
1-52: LGTM! Workflow simplification is clean.The removal of TestPyPI publishing streamlines the workflow appropriately. The remaining PyPI publishing job is correctly configured with proper gating (
startsWith(github.ref, 'refs/tags/')), environment, and permissions.Server/DOCKER_OVERVIEW.md (2)
66-88: Well-structured documentation with helpful examples.The example prompts and documentation links provide clear guidance for users getting started with the Docker image.
55-56: Remove or fix the LOG_LEVEL environment variable documentation—it is not implemented in the server code.The
DISABLE_TELEMETRYvariable is correctly implemented and supported (Server/src/core/telemetry.py:189-191). However,LOG_LEVEL=DEBUGis documented but not implemented. The server has a hardcoded log level default of "INFO" in config.py with no environment variable override. Either implement LOG_LEVEL support or remove it from the documentation.Likely an incorrect or invalid review comment.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
it should be Ubuntu's default but just in case
|
So many AI comments for a simple PR lol. They're very useful though. Let's go Docker Hub! |
An optional action to update DockerHub
Again, just more options for developers: https://hub.docker.com/r/msanatan/mcp-for-unity-server
Users can get the MCP server via uvx, pypi, and now through Docker
Summary by Sourcery
Add optional Docker Hub publishing workflow and Docker usage docs while simplifying Python package publishing.
New Features:
Enhancements:
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.