From 64084a471bf668b9e06c39e2a2519f9f449192af Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Wed, 8 Jan 2025 21:26:23 +0000 Subject: [PATCH] Add Devcontainer support Signed-off-by: Timothy Middelkoop --- .devcontainer/devcontainer.json | 21 +++++++++++++++++++ CHANGELOG.md | 1 + .../development-environment-devcontainer.rst | 8 +++++++ userdocs/index.rst | 1 + 4 files changed, 31 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 userdocs/contributing/development-environment-devcontainer.rst diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..ccf2c591 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "Warewulf Development", + "image": "registry.docker.com/library/rockylinux:9", + "remoteUser": "vscode", + "onCreateCommand": "sudo dnf install -y dnf-utils && sudo dnf config-manager --set-enabled crb && sudo dnf install -y unzip cpio gpgme-devel python3-sphinx python3-sphinx_rtd_theme", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/go:1": { + "version": "latest" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "golang.go", + "ms-vscode.makefile-tools" + ] + } + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index ab7ac9c8..1955f351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Adds `wwctl container --build=false` to prevent automatically (re)building the container. #1490, #1489 - Added resources as generic, arbitrary YAML data for nodes and profiles. #1568 - New `fstab` resource configures mounts in fstab overlay, including NFS mounts. #515 +- Add Dev Container support #1653 ### Changed diff --git a/userdocs/contributing/development-environment-devcontainer.rst b/userdocs/contributing/development-environment-devcontainer.rst new file mode 100644 index 00000000..c75df4e1 --- /dev/null +++ b/userdocs/contributing/development-environment-devcontainer.rst @@ -0,0 +1,8 @@ +============================= +Development Environment (Dev Container/VSC) +============================= + +Using a Dev Container for development +===================================================== + +Visual Studio Code (VSC) can utilize a Dev Container for a self-contained environment that has all the necessary tools and dependencies to build and test Warewulf. The Dev Container is based on the Rocky 9 image and is built using the `devcontainer.json` file in the `.devcontainer` directory of the Warewulf repository. To use this working Docker/Podman and VSC installations are required. To use the Dev Container, click the "Open a Remote Window" button on the bottom left of the editor (`><` icon) and select "Reopen in Container". This will build the container and open a new VSC window with the container as the development environment. diff --git a/userdocs/index.rst b/userdocs/index.rst index 951e4176..3f1d5fde 100644 --- a/userdocs/index.rst +++ b/userdocs/index.rst @@ -47,6 +47,7 @@ Welcome to the Warewulf User Guide! Contributing Debugging Documentation + Development Environment (Dev Container/VSC) Development Environment (Vagrant) Development Environment (KVM) Development Environment (VirtualBox)