-
Notifications
You must be signed in to change notification settings - Fork 160
feat: added devcontainers #10866
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
Open
norton120
wants to merge
6
commits into
projectnessie:main
Choose a base branch
from
pirate-baby:devcontainer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: added devcontainers #10866
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
839b9bd
feat: add development container configuration
norton120 f23e772
docs: add development container section to CONTRIBUTING.md
norton120 58a2a64
cleaned up doc contributions
norton120 09cc73b
fix: restore original trailing whitespace in CONTRIBUTING.md
norton120 09da8b2
add CLAUDE file
norton120 2db7d6b
added workflow for CI to test devcontainer (basic env spinup only so …
norton120 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM openjdk:21-jdk-slim | ||
|
||
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 | ||
|
||
ENV LANGUAGE='en_US:en' | ||
ENV JAVA_HOME=/usr/local/openjdk-21 | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
|
||
# 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 \ | ||
curl \ | ||
wget \ | ||
findutils \ | ||
tar \ | ||
gzip \ | ||
unzip \ | ||
procps && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# 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/ && \ | ||
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 | ||
|
||
USER nessie | ||
WORKDIR /workspace | ||
|
||
# verify | ||
RUN java --version && javac --version | ||
CMD ["/bin/bash"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 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 /bin/bash | ||
|
||
# Test the setup | ||
./gradlew --version | ||
java --version | ||
``` | ||
|
||
## Development Workflow | ||
|
||
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). | ||
|
||
## 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 | ||
|
||
|
||
## Troubleshooting | ||
|
||
**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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"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" | ||
], | ||
"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" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,6 @@ __pycache__/ | |
|
||
# Spark / Hive | ||
metastore_db/ | ||
|
||
# Claude AI assistant files | ||
CLAUDE.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.