From 839b9bdf3ada68d71fee8f53d5dc801ef4979f71 Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Wed, 4 Jun 2025 17:59:55 -0400 Subject: [PATCH 1/6] feat: add development container configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add VS Code dev container with Java 21 JDK and Gradle support - Include Dockerfile with Debian base to avoid Podman conflicts - Configure non-root nessie user with sudo access - Add port forwarding for Nessie server (19120) - Include comprehensive README with setup instructions This provides a consistent containerized development environment that addresses the platform-specific issues mentioned in CONTRIBUTING.md while enabling safe development without "metal" installation requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .devcontainer/Dockerfile | 61 ++++++++++++++++++++++ .devcontainer/README.md | 91 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 50 ++++++++++++++++++ 3 files changed, 202 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..74ea14d7ffd --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,61 @@ +# Nessie Development Container +# Based on the project's requirements and existing Docker setup + +FROM openjdk:21-jdk-slim + +LABEL org.opencontainers.image.source=https://github.com/pirate-baby/nessie +LABEL org.opencontainers.image.description="Nessie Development Container" +LABEL org.opencontainers.image.licenses=Apache-2.0 + +# Set environment variables +ENV LANGUAGE='en_US:en' +ENV JAVA_HOME=/usr/local/openjdk-21 +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +# Install development tools and dependencies +USER root + +# Update packages and install development essentials +RUN apt-get update && \ + apt-get install -y \ + git \ + curl \ + wget \ + findutils \ + tar \ + gzip \ + unzip \ + procps \ + sudo \ + && rm -rf /var/lib/apt/lists/* + +# Install Docker CLI (for potential Docker-in-Docker scenarios) +RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz | \ + tar -xz -C /tmp && \ + mv /tmp/docker/docker /usr/local/bin/ && \ + rm -rf /tmp/docker + +# Create nessie user for development (matching project's pattern) +RUN groupadd --gid 10001 nessie && \ + useradd --uid 10000 --gid nessie --create-home --shell /bin/bash nessie && \ + usermod -aG sudo nessie && \ + echo "nessie ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +# Set up workspace directory +RUN mkdir -p /workspace && \ + chown -R nessie:nessie /workspace + +# Switch to nessie user +USER nessie +WORKDIR /workspace + +# Set user environment +ENV USER=nessie +ENV UID=10000 +ENV HOME=/home/nessie + +# Verify Java installation +RUN java --version && javac --version + +# Set the default command +CMD ["/bin/bash"] \ No newline at end of file diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000000..baf01bda1f8 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,91 @@ +# Nessie Development Container + +This directory contains a development container configuration for Project Nessie that provides a consistent, containerized development environment with all necessary tools pre-installed. + +## What's Included + +- **Java 21 JDK** - Full OpenJDK development environment +- **Gradle** - Build tool (downloaded automatically via wrapper) +- **Git** - Version control +- **Docker CLI** - For container operations +- **Development tools** - curl, wget, unzip, and other essentials +- **VS Code extensions** - Java development pack, Gradle support +- **User setup** - Non-root `nessie` user with sudo access + +## Quick Start + +### Option 1: VS Code Dev Containers (Recommended) + +1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +2. Open the project in VS Code +3. When prompted, click "Reopen in Container" or use `Ctrl+Shift+P` → "Dev Containers: Reopen in Container" +4. Wait for the container to build and start + +### Option 2: Manual Docker Usage + +```bash +# Build the development container +docker build -f .devcontainer/Dockerfile -t nessie-dev . + +# Run a shell in the container +docker run -it --rm -v $(pwd):/workspace -w /workspace nessie-dev bash + +# Test the setup +./gradlew --version +java --version +``` + +## Development Workflow + +Once in the container, you can use all the standard Nessie development commands: + +```bash +# Basic smoke test +./gradlew sAp compileAll jar codeChecks + +# Run tests +./gradlew test + +# Run integration tests +./gradlew intTest + +# Build and run the server +./gradlew :nessie-quarkus:quarkusBuild +java -jar servers/quarkus-server/build/quarkus-app/quarkus-run.jar +``` + +The Nessie server will be available at http://localhost:19120 (automatically forwarded in VS Code). + +## Why Use This Dev Container? + +This addresses the common issues mentioned in Nessie's contributing docs: + +- ✅ **No "development on the metal"** - Everything runs in a safe, isolated container +- ✅ **Linux-first environment** - Even on macOS/Windows, you get a consistent Linux environment +- ✅ **No Podman conflicts** - Uses Docker with a standard Debian base +- ✅ **Pre-configured toolchain** - Java 21, Gradle, and all dependencies ready to go +- ✅ **VS Code integration** - Full IDE support with proper Java language server setup + +## Container Details + +- **Base Image**: `openjdk:21-jdk-slim` (Debian-based) +- **User**: `nessie` (UID 10000, GID 10001) +- **Working Directory**: `/workspace` +- **Port Forwarding**: 19120 (Nessie server) +- **Java Home**: `/usr/local/openjdk-21` + +## Customization + +You can modify the configuration by editing: +- `.devcontainer/devcontainer.json` - VS Code settings, extensions, port forwarding +- `.devcontainer/Dockerfile` - Container image, installed packages, environment + +## Troubleshooting + +**Container won't start**: Ensure Docker is running and you have sufficient disk space. + +**Gradle issues**: The container automatically downloads Gradle via the wrapper. Make sure you have network access. + +**Permission errors**: The container runs as user `nessie` with sudo access. Files should be automatically owned correctly. + +**VS Code Java issues**: The container includes proper Java language server configuration. Reload VS Code if needed. \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..73f09dc081c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,50 @@ +{ + "name": "Nessie Development", + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "features": { + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "redhat.java", + "vscjava.vscode-gradle", + "ms-vscode.vscode-json", + "streetsidesoftware.code-spell-checker" + ], + "settings": { + "java.configuration.runtimes": [ + { + "name": "JavaSE-21", + "path": "/usr/local/openjdk-21" + } + ], + "java.compile.nullAnalysis.mode": "automatic" + } + } + }, + "containerEnv": { + "JAVA_HOME": "/usr/local/openjdk-21" + }, + "remoteUser": "nessie", + "workspaceFolder": "/workspace", + "mounts": [ + "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached" + ], + "forwardPorts": [19120], + "portsAttributes": { + "19120": { + "label": "Nessie Server", + "onAutoForward": "notify" + } + }, + "postCreateCommand": "./gradlew --version", + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/usr/local/openjdk-21/bin" + } +} \ No newline at end of file From f23e772de4c9023713275800b98c20b157f98d9c Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Wed, 4 Jun 2025 18:04:08 -0400 Subject: [PATCH 2/6] docs: add development container section to CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add comprehensive dev container documentation as recommended option - Position it prominently before platform-specific manual setup - Highlight benefits: consistent Linux environment, no platform issues - Reference the detailed .devcontainer/README.md for full instructions - Frame manual setup as alternative for those who prefer it This addresses the development environment barriers mentioned in the existing contributing docs by providing a containerized solution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CONTRIBUTING.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eff45948bb9..a5fa3afe2b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,6 +150,38 @@ non-obvious platform differences. TL;DR It is fine to build code on macOS and Windows, but the reference platform is Linux. +#### Development Container (Recommended) + +For a consistent development experience across all platforms, Nessie provides a development container +configuration that creates an isolated Linux environment with all required tools pre-installed. + +**Quick Start:** +1. Install [VS Code](https://code.visualstudio.com/) and the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +2. Open the project in VS Code +3. When prompted, click "Reopen in Container" or use `Ctrl+Shift+P` → "Dev Containers: Reopen in Container" +4. Wait for the container to build and start developing! + +**What's included:** +- Java 21 JDK with proper toolchain configuration +- Gradle build environment (automatically downloaded) +- Git, Docker CLI, and essential development tools +- VS Code Java extensions pre-configured +- Non-root user with sudo access +- Port forwarding for the Nessie server (19120) + +**Benefits:** +- ✅ Consistent Linux environment on any platform (Windows, macOS, Linux) +- ✅ No platform-specific setup issues or Podman conflicts +- ✅ Isolated from your host system - no "development on the metal" +- ✅ All dependencies pre-installed and configured +- ✅ Works identically for all team members + +For detailed instructions and manual Docker usage, see [`.devcontainer/README.md`](.devcontainer/README.md). + +**Alternative: Manual platform setup** + +If you prefer to set up your development environment manually, continue reading the platform-specific sections below. + #### Running tests on macOS In our CI we use Podman for macOS, initialized using the following sequence of commands, From 58a2a64da3c64245f1c29f5a7c8dad9a1ec5952d Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Wed, 4 Jun 2025 18:09:22 -0400 Subject: [PATCH 3/6] cleaned up doc contributions --- CONTRIBUTING.md | 51 ++++++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5fa3afe2b2..8ef50d041aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contributing to Nessie ## How to contribute -Everyone is encouraged to contribute to the Nessie project. We welcome of course code changes, -but we are also grateful for bug reports, feature suggestions, helping with testing and +Everyone is encouraged to contribute to the Nessie project. We welcome of course code changes, +but we are also grateful for bug reports, feature suggestions, helping with testing and documentation, or simply spreading the word about Nessie. There are several ways to get in touch with other contributors: @@ -14,8 +14,8 @@ More information are available at https://projectnessie.org/develop/ You must agree to abide by the Project Nessie [Code of Conduct](CODE_OF_CONDUCT.md). ## Reporting issues -Issues can be filed on GitHub. Please use the template and add as much detail as possible. Including the -version of the client and server, how the server is being run (eg docker image) etc. The more the community +Issues can be filed on GitHub. Please use the template and add as much detail as possible. Including the +version of the client and server, how the server is being run (eg docker image) etc. The more the community knows the more it can help :-) ### Feature Requests @@ -25,7 +25,7 @@ and ask there. It helps build a richer discussion and more people can be involve ### Large changes or improvements -We are excited to accept new contributors and larger changes. Please join the mailing list and post a proposal +We are excited to accept new contributors and larger changes. Please join the mailing list and post a proposal before submitting a large change. This helps avoid double work and allows the community to arrive at a consensus on the new feature or improvement. @@ -117,7 +117,7 @@ can be migrated as follows: 1. Run `git pull` 1. Run `./gradlew testClasses` to ensure the build works fine. The very first build will be slower, because it has to assemble the build plugins and download dependencies. -1. Make sure that your IDE has no more "references to Maven" (nothing to do when using IntelliJ) +1. Make sure that your IDE has no more "references to Maven" (nothing to do when using IntelliJ) 1. Open Nessie in your IDE Note: The Gradle build does *not* use the local Maven repository and dependencies there will not be @@ -126,8 +126,8 @@ used by default. See [Local Maven reposotiry](#local-maven-repository). ### Development process The development process doesn't contain many surprises. As most projects on github anyone can contribute by -forking the repo and posting a pull request. See -[GitHub's documentation](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) +forking the repo and posting a pull request. See +[GitHub's documentation](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) for more information. Small changes don't require an issue. However, it is good practice to open up an issue for larger changes. If you are unsure of where to start ask on the slack channel or look at [existing issues](https://github.com/projectnessie/nessie/issues). The [good first issue](https://github.com/projectnessie/nessie/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label marks issues that are particularly good for people new to the codebase. @@ -150,38 +150,19 @@ non-obvious platform differences. TL;DR It is fine to build code on macOS and Windows, but the reference platform is Linux. -#### Development Container (Recommended) +#### Development Container -For a consistent development experience across all platforms, Nessie provides a development container +If you prefer not to develop on the metal, Nessie provides a VSCode `devcontainers` development container configuration that creates an isolated Linux environment with all required tools pre-installed. **Quick Start:** -1. Install [VS Code](https://code.visualstudio.com/) and the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -2. Open the project in VS Code -3. When prompted, click "Reopen in Container" or use `Ctrl+Shift+P` → "Dev Containers: Reopen in Container" -4. Wait for the container to build and start developing! - -**What's included:** -- Java 21 JDK with proper toolchain configuration -- Gradle build environment (automatically downloaded) -- Git, Docker CLI, and essential development tools -- VS Code Java extensions pre-configured -- Non-root user with sudo access -- Port forwarding for the Nessie server (19120) - -**Benefits:** -- ✅ Consistent Linux environment on any platform (Windows, macOS, Linux) -- ✅ No platform-specific setup issues or Podman conflicts -- ✅ Isolated from your host system - no "development on the metal" -- ✅ All dependencies pre-installed and configured -- ✅ Works identically for all team members +(Assumes you are using [VS Code](https://code.visualstudio.com/) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) ) +1. Open the project in VS Code +2. When prompted, click "Reopen in Container" or use `Ctrl+Shift+P` → "Dev Containers: Reopen in Container" +3. Wait for the container to build and start developing! For detailed instructions and manual Docker usage, see [`.devcontainer/README.md`](.devcontainer/README.md). -**Alternative: Manual platform setup** - -If you prefer to set up your development environment manually, continue reading the platform-specific sections below. - #### Running tests on macOS In our CI we use Podman for macOS, initialized using the following sequence of commands, @@ -269,7 +250,7 @@ cd python/ [ ! -d venv/ ] && virtualenv venv . venv/bin/activate pip install -U -r requirements_lint.txt - + black pynessie tests ``` @@ -286,7 +267,7 @@ Code coverage is measured using jacoco plus codecov. ### Submitting a pull request Upon submission of a pull request you will be asked to sign our contributor license agreement. -Anyone can take part in the review process and once the community is happy and the build actions are passing a Pull Request will be merged. Support +Anyone can take part in the review process and once the community is happy and the build actions are passing a Pull Request will be merged. Support must be unanimous for a change to be merged. ### Reporting security issues From 09cc73b7d97e751a2db120c1004be01c8021ea7a Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Wed, 4 Jun 2025 18:22:04 -0400 Subject: [PATCH 4/6] fix: restore original trailing whitespace in CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commits accidentally removed trailing whitespace from multiple lines. This restores the original formatting to match main while keeping only the new Development Container section addition. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CONTRIBUTING.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ef50d041aa..530498d5fe3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contributing to Nessie ## How to contribute -Everyone is encouraged to contribute to the Nessie project. We welcome of course code changes, -but we are also grateful for bug reports, feature suggestions, helping with testing and +Everyone is encouraged to contribute to the Nessie project. We welcome of course code changes, +but we are also grateful for bug reports, feature suggestions, helping with testing and documentation, or simply spreading the word about Nessie. There are several ways to get in touch with other contributors: @@ -14,8 +14,8 @@ More information are available at https://projectnessie.org/develop/ You must agree to abide by the Project Nessie [Code of Conduct](CODE_OF_CONDUCT.md). ## Reporting issues -Issues can be filed on GitHub. Please use the template and add as much detail as possible. Including the -version of the client and server, how the server is being run (eg docker image) etc. The more the community +Issues can be filed on GitHub. Please use the template and add as much detail as possible. Including the +version of the client and server, how the server is being run (eg docker image) etc. The more the community knows the more it can help :-) ### Feature Requests @@ -25,7 +25,7 @@ and ask there. It helps build a richer discussion and more people can be involve ### Large changes or improvements -We are excited to accept new contributors and larger changes. Please join the mailing list and post a proposal +We are excited to accept new contributors and larger changes. Please join the mailing list and post a proposal before submitting a large change. This helps avoid double work and allows the community to arrive at a consensus on the new feature or improvement. @@ -117,7 +117,7 @@ can be migrated as follows: 1. Run `git pull` 1. Run `./gradlew testClasses` to ensure the build works fine. The very first build will be slower, because it has to assemble the build plugins and download dependencies. -1. Make sure that your IDE has no more "references to Maven" (nothing to do when using IntelliJ) +1. Make sure that your IDE has no more "references to Maven" (nothing to do when using IntelliJ) 1. Open Nessie in your IDE Note: The Gradle build does *not* use the local Maven repository and dependencies there will not be @@ -126,8 +126,8 @@ used by default. See [Local Maven reposotiry](#local-maven-repository). ### Development process The development process doesn't contain many surprises. As most projects on github anyone can contribute by -forking the repo and posting a pull request. See -[GitHub's documentation](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) +forking the repo and posting a pull request. See +[GitHub's documentation](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) for more information. Small changes don't require an issue. However, it is good practice to open up an issue for larger changes. If you are unsure of where to start ask on the slack channel or look at [existing issues](https://github.com/projectnessie/nessie/issues). The [good first issue](https://github.com/projectnessie/nessie/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label marks issues that are particularly good for people new to the codebase. @@ -250,7 +250,7 @@ cd python/ [ ! -d venv/ ] && virtualenv venv . venv/bin/activate pip install -U -r requirements_lint.txt - + black pynessie tests ``` @@ -267,7 +267,7 @@ Code coverage is measured using jacoco plus codecov. ### Submitting a pull request Upon submission of a pull request you will be asked to sign our contributor license agreement. -Anyone can take part in the review process and once the community is happy and the build actions are passing a Pull Request will be merged. Support +Anyone can take part in the review process and once the community is happy and the build actions are passing a Pull Request will be merged. Support must be unanimous for a change to be merged. ### Reporting security issues From 09da8b20e00770035827ead0ac812f4f4b11500d Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Thu, 5 Jun 2025 09:03:34 -0400 Subject: [PATCH 5/6] add CLAUDE file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 62e4b874078..7ef89790820 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,6 @@ __pycache__/ # Spark / Hive metastore_db/ + +# Claude AI assistant files +CLAUDE.md From 2db7d6bf1de831ce47a564b1130418c89bcfd457 Mon Sep 17 00:00:00 2001 From: Ethan Knox Date: Fri, 13 Jun 2025 10:06:37 -0400 Subject: [PATCH 6/6] added workflow for CI to test devcontainer (basic env spinup only so we're not double-testing the code), removed some extranious comments --- .devcontainer/Dockerfile | 28 ++++------------- .devcontainer/README.md | 42 +++---------------------- .devcontainer/devcontainer.json | 3 +- .github/workflows/devcontainer-test.yml | 28 +++++++++++++++++ 4 files changed, 39 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/devcontainer-test.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 74ea14d7ffd..d6e9c41b3cb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,21 +1,14 @@ -# Nessie Development Container -# Based on the project's requirements and existing Docker setup - FROM openjdk:21-jdk-slim -LABEL org.opencontainers.image.source=https://github.com/pirate-baby/nessie +LABEL org.opencontainers.image.source=https://github.com/projectnessie/nessie LABEL org.opencontainers.image.description="Nessie Development Container" LABEL org.opencontainers.image.licenses=Apache-2.0 -# Set environment variables ENV LANGUAGE='en_US:en' ENV JAVA_HOME=/usr/local/openjdk-21 ENV PATH="${JAVA_HOME}/bin:${PATH}" -# Install development tools and dependencies -USER root - -# Update packages and install development essentials +# note "invalid signature encountered" is a common error when out of disk space or no internet RUN apt-get update && \ apt-get install -y \ git \ @@ -25,11 +18,10 @@ RUN apt-get update && \ tar \ gzip \ unzip \ - procps \ - sudo \ - && rm -rf /var/lib/apt/lists/* + procps && \ + rm -rf /var/lib/apt/lists/* -# Install Docker CLI (for potential Docker-in-Docker scenarios) +# will need docker/podman RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz | \ tar -xz -C /tmp && \ mv /tmp/docker/docker /usr/local/bin/ && \ @@ -45,17 +37,9 @@ RUN groupadd --gid 10001 nessie && \ RUN mkdir -p /workspace && \ chown -R nessie:nessie /workspace -# Switch to nessie user USER nessie WORKDIR /workspace -# Set user environment -ENV USER=nessie -ENV UID=10000 -ENV HOME=/home/nessie - -# Verify Java installation +# verify RUN java --version && javac --version - -# Set the default command CMD ["/bin/bash"] \ No newline at end of file diff --git a/.devcontainer/README.md b/.devcontainer/README.md index baf01bda1f8..2535bbb82ff 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -28,7 +28,7 @@ This directory contains a development container configuration for Project Nessie docker build -f .devcontainer/Dockerfile -t nessie-dev . # Run a shell in the container -docker run -it --rm -v $(pwd):/workspace -w /workspace nessie-dev bash +docker run -it --rm -v $(pwd):/workspace -w /workspace nessie-dev /bin/bash # Test the setup ./gradlew --version @@ -37,22 +37,7 @@ java --version ## Development Workflow -Once in the container, you can use all the standard Nessie development commands: - -```bash -# Basic smoke test -./gradlew sAp compileAll jar codeChecks - -# Run tests -./gradlew test - -# Run integration tests -./gradlew intTest - -# Build and run the server -./gradlew :nessie-quarkus:quarkusBuild -java -jar servers/quarkus-server/build/quarkus-app/quarkus-run.jar -``` +Once in the container, you can use all the standard Nessie [development commands](../CONTRIBUTING.md): The Nessie server will be available at http://localhost:19120 (automatically forwarded in VS Code). @@ -61,31 +46,12 @@ The Nessie server will be available at http://localhost:19120 (automatically for This addresses the common issues mentioned in Nessie's contributing docs: - ✅ **No "development on the metal"** - Everything runs in a safe, isolated container -- ✅ **Linux-first environment** - Even on macOS/Windows, you get a consistent Linux environment +- ✅ **Linux-first environment** - Even on macOS/Windows, you get a consistent Linux environment - ✅ **No Podman conflicts** - Uses Docker with a standard Debian base - ✅ **Pre-configured toolchain** - Java 21, Gradle, and all dependencies ready to go - ✅ **VS Code integration** - Full IDE support with proper Java language server setup -## Container Details - -- **Base Image**: `openjdk:21-jdk-slim` (Debian-based) -- **User**: `nessie` (UID 10000, GID 10001) -- **Working Directory**: `/workspace` -- **Port Forwarding**: 19120 (Nessie server) -- **Java Home**: `/usr/local/openjdk-21` - -## Customization - -You can modify the configuration by editing: -- `.devcontainer/devcontainer.json` - VS Code settings, extensions, port forwarding -- `.devcontainer/Dockerfile` - Container image, installed packages, environment ## Troubleshooting -**Container won't start**: Ensure Docker is running and you have sufficient disk space. - -**Gradle issues**: The container automatically downloads Gradle via the wrapper. Make sure you have network access. - -**Permission errors**: The container runs as user `nessie` with sudo access. Files should be automatically owned correctly. - -**VS Code Java issues**: The container includes proper Java language server configuration. Reload VS Code if needed. \ No newline at end of file +**Container build fails with "At least one invalid signature was encountered."**: You are likely out of disk space (in docker at least), or you have no network connection. Clean out unused containers and images, and try again. \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 73f09dc081c..c5210cc7acd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,8 +14,7 @@ "vscjava.vscode-java-pack", "redhat.java", "vscjava.vscode-gradle", - "ms-vscode.vscode-json", - "streetsidesoftware.code-spell-checker" + "ms-vscode.vscode-json" ], "settings": { "java.configuration.runtimes": [ diff --git a/.github/workflows/devcontainer-test.yml b/.github/workflows/devcontainer-test.yml new file mode 100644 index 00000000000..07c96d47376 --- /dev/null +++ b/.github/workflows/devcontainer-test.yml @@ -0,0 +1,28 @@ +name: Devcontainer Build Test + +on: + pull_request: + # we could be more aggressive with this check, but I also don't want to double dip tests and the rest of CI + paths: + - '.devcontainer/**' + +jobs: + build-devcontainer: + name: Build and Test Devcontainer + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build devcontainer image + run: | + docker build -t nessie-devcontainer -f .devcontainer/Dockerfile . + + - name: Run gradle build in devcontainer + run: | + docker run --rm \ + -v "$(pwd)":/workspace \ + -w /workspace \ + -u nessie \ + nessie-devcontainer \ + ./gradlew jar testClasses \ No newline at end of file