Skip to content

Add basic dev container configuration#74

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-50
Draft

Add basic dev container configuration#74
Copilot wants to merge 4 commits intomainfrom
copilot/fix-50

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2025

This PR adds a complete development container setup for the Friendly Computing Machine project, providing a consistent development environment across different machines and platforms.

What's Added

Core Dev Container Configuration

  • .devcontainer/devcontainer.json - Main configuration using Python 3.11 base image with Docker-in-Docker support
  • .devcontainer/setup.sh - Automated setup script that handles all project-specific requirements
  • .devcontainer/README.md - Comprehensive documentation for dev container usage

Key Features

Environment Setup:

  • Python 3.11 (matching .python-version file)
  • UV 0.5.13 package manager (matching GitHub Actions and Dockerfile versions)
  • Docker-in-Docker support for external API client generation via bin/generate_client.sh

VS Code Integration:

  • Python extension with proper virtual environment configuration
  • Pytest testing integration
  • Ruff linting (matching project's pre-commit configuration)
  • Black formatting support
  • Jupyter notebook support

Automated Setup:
The setup script automatically:

  1. Installs UV 0.5.13
  2. Generates external API client dependencies using OpenAPI generator
  3. Runs uv sync to install all project dependencies
  4. Verifies the installation works

Usage

  1. Open the project in VS Code
  2. Install the "Dev Containers" extension
  3. Command Palette → "Dev Containers: Reopen in Container"
  4. Wait for setup to complete

After setup, developers can immediately:

  • Run tests: uv run pytest
  • Run the bot: uv run fcm bot run
  • Run temporal worker: uv run workflow run

Benefits

  • Consistency: Same environment across all development machines
  • Zero setup friction: New contributors can start developing immediately
  • Matches CI/CD: Uses same Python version and UV version as GitHub Actions
  • Complete tooling: Includes all necessary development tools and extensions

Fixes #50.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.26%. Comparing base (d95ce03) to head (f680458).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #74   +/-   ##
=======================================
  Coverage   34.26%   34.26%           
=======================================
  Files          58       58           
  Lines        2072     2072           
  Branches       99       99           
=======================================
  Hits          710      710           
  Misses       1360     1360           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI and others added 2 commits May 29, 2025 00:23
Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Copilot AI changed the title [WIP] dev container Add basic dev container configuration May 29, 2025
Copilot AI requested a review from QMasterMoo May 29, 2025 00:27
Copy link
Copy Markdown
Member

@QMasterMoo QMasterMoo left a comment

Choose a reason for hiding this comment

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

So far, so good.

However, this is missing some features required for development

  • the tilt utility should be installed
  • a kubernetes environment for tilt should be mad available
    • tilt requires kubernetes to run
    • use kind or ctlptl or the docker built in kubernetes
    • just make tilt work in the dev container with it
  • temporal cli should be installed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should this be built using the existing docker file? Is there a way to keep them in sync? I fear this would not be updated with time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! Fixed in commit f680458. The devcontainer now uses the existing Dockerfile as its base (target: "base"), which automatically keeps UV versions and other dependencies in sync. This eliminates the maintenance issue of having duplicate version specifications.

Comment thread .devcontainer/setup.sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Likewise, this uv version is out of date and will be updated by a human developer at some point. The human developer is likely to forget this file. No amount of documentation will fix this. You must share the versions and consolidate setup scripts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly! Fixed in commit f680458. The setup script no longer installs UV separately since it now uses the project's Dockerfile as the base image, which already includes UV at the correct version. This consolidates the setup and eliminates version drift between files.

Comment on lines +12 to +18
"extensions": [
"ms-python.python",
"ms-python.pylint",
"ms-python.black-formatter",
"ms-toolsai.jupyter",
"charliermarsh.ruff"
],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this common? I feel weird specifying extensions here, but if it's normal I'm OK with it.

although, the black formatter should not be installed with ruff. Please keep ruff and remove black

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, specifying extensions in devcontainer.json is common practice - it ensures consistent tooling across all developers. Removed the black formatter extension in commit f680458 and updated the formatting provider to use ruff instead, since ruff handles both linting and formatting.

Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 29, 2025

So far, so good.

However, this is missing some features required for development
...

Added all the requested development tools in commit f680458:

  • tilt utility: Installed via official install script
  • kubernetes environment: Added kind (Kubernetes in Docker) with kubectl
  • temporal cli: Installed from GitHub releases

The dev container now provides a complete local development environment with all necessary tools for working with the project's Kubernetes and Temporal infrastructure.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 168.63.129.16

If you need me to access, download, or install something from one of these locations, you can either:

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.

dev container

2 participants