Skip to content

Minor changes Apple silicon dev#30

Closed
photocyte wants to merge 2 commits intoLabAutomationAndScreening:mainfrom
photocyte:apple-silicon-dev
Closed

Minor changes Apple silicon dev#30
photocyte wants to merge 2 commits intoLabAutomationAndScreening:mainfrom
photocyte:apple-silicon-dev

Conversation

@photocyte
Copy link

@photocyte photocyte commented Aug 14, 2025

Link to Issue or Message thread

(No explicit issue, describing issue below)

Why is this change necessary?

Makes it easier to onboard devs using Docker Desktop on Apple Silicon devices (even when using the dev-containers).

How does this change address the issue?

Was a necesarry change in my hands to get started with the dev-container .

What side effects does this change have?

There may be subtleties with how it intersects with cloud deployment targets (in other repos?), if the deployment targets do not use amd64 platform. I think amd64 is a reasonable explicit default for cloud deployment, because I'd assume it's 99% of available cloud resources even with the impressive efficiency advantages of arm cloud resources.

How is this change tested?

I haven't tested this change beyond my 1st pass through.

Other

Feedback on any cleanliness from commit messages to PR, always good!

Summary by CodeRabbit

  • Chores
    • Configured the development container to target the linux/amd64 platform for consistent local setups.
    • Added ignore patterns for macOS system files (e.g., .DS_Store) to prevent committing OS artifacts.
    • Changes are limited to development workflow and repository hygiene; no impact on application behavior or production builds.

Relevant error:
docker pull mcr.microsoft.com/devcontainers/universal:2.13.1-focal
  2.13.1-focal: Pulling from devcontainers/universal
  no matching manifest for linux/arm64/v8 in the manifest list entries
@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Walkthrough

Updates devcontainer configuration to target linux/amd64 and extends .gitignore with macOS-specific DS_Store exclusions. No code, runtime, build, or test logic changed.

Changes

Cohort / File(s) Summary of Changes
Devcontainer Configuration
.devcontainer/docker-compose.yml
Added platform setting linux/amd64 under the devcontainer service; no other modifications.
Git Ignore Rules
.gitignore
Added macOS DS_Store ignore patterns (*.DS_Store, .DS_Store) under a macOS-specific section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I nudged the ship to amd64 seas,
And swept Mac crumbs with tidy ease.
No code to chase, no tests to tame—
Just cleaner decks for our devgame.
Thump-thump, my paws approve this lore,
Onward we hop—no DS_Store! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.gitignore (1)

79-82: Deduplicate DS_Store ignores; one pattern is sufficient.

Both patterns match the same files; keeping one is cleaner. Optionally ignore AppleDouble resource forks too.

 # macOS dev cleanliness
-*.DS_Store
 .DS_Store
+# Optionally also ignore AppleDouble resource forks
+# ._*
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 29645d8 and 324761e.

📒 Files selected for processing (2)
  • .devcontainer/docker-compose.yml (1 hunks)
  • .gitignore (1 hunks)

@@ -1,5 +1,6 @@
services:
devcontainer:
platform: linux/amd64
Copy link

@coderabbitai coderabbitai bot Aug 14, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Pinning platform to linux/amd64 may cause build/run platform mismatches; make it overridable and verify Dockerfile honors TARGETPLATFORM.

On Apple Silicon this fixes devcontainers by forcing x86 emulation, but when the service is built locally (build: context: .), Compose can error if the built image is arm64 while the service requests amd64. Suggest making the platform opt-in via env var (keeps your default) and ensure the Dockerfile uses ARG TARGETPLATFORM or FROM --platform to build the correct arch.

Apply this small improvement so developers can override without editing the file:

-    platform: linux/amd64
+    platform: ${DEVCONTAINER_PLATFORM:-linux/amd64}

To verify your build path won’t mismatch, run this in the repo to check Dockerfiles for platform-awareness:


🏁 Script executed:

#!/bin/bash
# Look for Dockerfiles and check for TARGETPLATFORM/BUILDPLATFORM hints
fd -HI -t f -g 'Dockerfile*' | while read -r f; do
  echo "=== $f ==="
  rg -n --color=never -e '^\s*FROM(\s+--platform=\S+)?\s' -e '\bARG\s+(TARGETPLATFORM|BUILDPLATFORM)\b' "$f" || true
done

# Also check for devcontainer.json that may set runArgs/compose files
fd -HI -t f -g 'devcontainer.json' | xargs -I{} sh -c 'echo "=== {} ==="; cat "{}"' 2>/dev/null || true

Length of output: 3272


Make devcontainer platform configurable and remove the hard amd64 pin in the Dockerfile

I ran the check — .devcontainer/Dockerfile contains a hard pin (line 4: FROM --platform=linux/amd64) and devcontainer.json uses docker-compose.yml. Please make these changes so the platform can be overridden and the Dockerfile honors TARGETPLATFORM.

Files to change

  • .devcontainer/docker-compose.yml — make platform overridable
  • .devcontainer/Dockerfile — stop hard-pinning platform; use ARG TARGETPLATFORM

Suggested diffs

For .devcontainer/docker-compose.yml:

-    platform: linux/amd64
+    platform: ${DEVCONTAINER_PLATFORM:-linux/amd64}

For .devcontainer/Dockerfile (replace the pinned FROM):

-FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/universal:2.13.1-focal
+ARG TARGETPLATFORM=linux/amd64
+FROM --platform=$TARGETPLATFORM mcr.microsoft.com/devcontainers/universal:2.13.1-focal

Note: using ARG in FROM requires BuildKit / recent Docker; if you cannot rely on that, consider removing the --platform flag from the Dockerfile and controlling platform via the compose env var instead.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
platform: linux/amd64
platform: ${DEVCONTAINER_PLATFORM:-linux/amd64}
🤖 Prompt for AI Agents
.devcontainer/docker-compose.yml around line 3 and .devcontainer/Dockerfile
(replace the pinned FROM at line 4): the compose file currently hard-codes
platform: linux/amd64 — make it overridable by replacing the literal with an
environment variable (e.g. use a ${PLATFORM:-linux/amd64} or
${TARGETPLATFORM:-linux/amd64} substitution so callers can set the platform),
and in the Dockerfile remove the hard --platform=linux/amd64 pin and either (a)
use an ARG TARGETPLATFORM and change the FROM to reference it via FROM
--platform=${TARGETPLATFORM} <image> (requires BuildKit/recent Docker), or (b)
simply drop the --platform flag and let docker-compose supply the platform via
the env variable; ensure devcontainer.json/composition passes the chosen
variable through.

Copy link
Author

Choose a reason for hiding this comment

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

I don't think this is the right solution, given that the development platform has to match the deployment platform, and the deployment platform is infrastructure as code elsewhere.

Copy link

Choose a reason for hiding this comment

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

@photocyte That's a valid point about maintaining dev/prod parity - it's definitely important to avoid environment drift that could cause deployment issues.

To better understand the context: is your deployment platform definitively amd64/x86_64? If so, then keeping the hard-coded platform: linux/amd64 makes sense for consistency.

The original issue was helping Apple Silicon developers get started with dev-containers. If maintaining the amd64 platform is the right approach for your infrastructure, then your solution addresses that need while preserving the deployment alignment you mentioned.

I'll note that this approach means Apple Silicon developers will run under emulation, which works but may have some performance implications during development. However, if that tradeoff is acceptable for maintaining environment consistency, then your approach is sound.

@@ -1,5 +1,6 @@
services:
devcontainer:
platform: linux/amd64
Copy link
Contributor

Choose a reason for hiding this comment

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

Separately, can you have github build a Codespace off your current branch and confirm that's still functional?

Copy link
Contributor

Choose a reason for hiding this comment

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

anytime we're messing around with the guts of the devcontainer configuration, it's good to ensure it's still compatible with Github Codespaces

ejfine added a commit to LabAutomationAndScreening/copier-base-template that referenced this pull request Aug 14, 2025
## Link to Issue or Message thread
LabAutomationAndScreening/cloud-courier#30


 ## Why is this change necessary?
People are encountering issues when developing on Mac either on
baremetal or using devcontainers on Apple Silicon


 ## How does this change address the issue?
Specifies amd64 more explicitly, and adds some mac-specific things to
.gitignore


 ## What side effects does this change have?
None


 ## How is this change tested?
Building a codespace and a devcontainer with these new settings


 ## Other
Ignores some more log files and bumps some pulumi depenedencies
@photocyte
Copy link
Author

Closing in preference to #32

@photocyte photocyte closed this Aug 14, 2025
ejfine added a commit that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants