Skip to content

Commit 7bc010e

Browse files
Add devcontainer configuration for Julia development environment (#709)
* Initial plan * Add devcontainer configuration with juliaup, Julia 1.10/1.12, hexdump, and HDF5 tools Co-authored-by: JonasIsensee <[email protected]> * Improve error handling in devcontainer setup script Co-authored-by: JonasIsensee <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JonasIsensee <[email protected]>
1 parent d144466 commit 7bc010e

File tree

3 files changed

+142
-0
lines changed

3 files changed

+142
-0
lines changed

.devcontainer/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# JLD2.jl Development Container
2+
3+
This directory contains the development container configuration for GitHub Codespaces and VS Code Remote Containers.
4+
5+
## What's Included
6+
7+
### Julia Environment
8+
- **juliaup**: Julia version manager
9+
- **Julia 1.10 (LTS)**: Long-term support version
10+
- **Julia 1.12 (release)**: Latest stable release
11+
- Default channel set to 1.12
12+
13+
### Development Tools
14+
- **hexdump**: Binary file analysis tool
15+
- **HDF5 CLI tools**: Complete suite of HDF5 utilities
16+
- `h5dump`: Displays HDF5 file contents
17+
- `h5debug`: HDF5 debugging tool
18+
- `h5stat`: HDF5 file statistics
19+
- `h5ls`: List HDF5 file contents
20+
- `h5diff`: Compare HDF5 files
21+
- Additional HDF5 utilities
22+
23+
### VS Code Extensions
24+
- Julia Language Support
25+
26+
## Usage
27+
28+
### GitHub Codespaces
29+
When you create a new Codespace for this repository, the environment will be automatically configured with all the required tools.
30+
31+
### VS Code Remote Containers
32+
1. Install the "Remote - Containers" extension in VS Code
33+
2. Open the repository in VS Code
34+
3. Click "Reopen in Container" when prompted (or use Command Palette: "Remote-Containers: Reopen in Container")
35+
36+
## What Happens During Setup
37+
38+
1. Base Ubuntu 22.04 container is created
39+
2. juliaup and Julia versions are installed via devcontainer feature
40+
3. The `setup.sh` script runs to:
41+
- Install hexdump utility
42+
- Install HDF5 CLI tools
43+
- Verify all installations
44+
- Install Julia package dependencies
45+
46+
## Switching Julia Versions
47+
48+
Use juliaup to switch between installed versions:
49+
50+
```bash
51+
# List available versions
52+
juliaup list
53+
54+
# Switch to Julia 1.10 (LTS)
55+
juliaup default 1.10
56+
57+
# Switch to Julia 1.12 (release)
58+
juliaup default 1.12
59+
```
60+
61+
## Verifying Installations
62+
63+
All tools are verified during container creation. You can manually verify by running:
64+
65+
```bash
66+
# Check Julia
67+
julia --version
68+
69+
# Check hexdump
70+
hexdump --help
71+
72+
# Check HDF5 tools
73+
h5dump --version
74+
which h5stat h5debug h5ls h5diff
75+
```

.devcontainer/devcontainer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "JLD2.jl Development Environment",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
4+
5+
"features": {
6+
"ghcr.io/devcontainers-contrib/features/juliaup:1": {
7+
"channels": "1.10,1.12",
8+
"defaultChannel": "1.12"
9+
}
10+
},
11+
12+
"postCreateCommand": ".devcontainer/setup.sh",
13+
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"julialang.language-julia"
18+
],
19+
"settings": {
20+
"julia.environmentPath": "${workspaceFolder}"
21+
}
22+
}
23+
},
24+
25+
"remoteUser": "vscode"
26+
}

.devcontainer/setup.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Setting up JLD2.jl development environment..."
5+
6+
# Update package list
7+
sudo apt-get update
8+
9+
# Install hexdump (part of bsdmainutils or bsdextrautils)
10+
echo "Installing hexdump..."
11+
sudo apt-get install -y bsdmainutils
12+
13+
# Install HDF5 tools (h5dump, h5debug, h5stat, etc.)
14+
echo "Installing HDF5 CLI tools..."
15+
sudo apt-get install -y hdf5-tools
16+
17+
# Verify installations
18+
echo "Verifying installations..."
19+
echo "Julia versions available:"
20+
juliaup list || echo "Julia installation pending..."
21+
22+
echo "hexdump version:"
23+
hexdump -V 2>&1 || hexdump --version 2>&1 || echo "hexdump installed (no version flag available)"
24+
25+
echo "HDF5 tools installed:"
26+
which h5dump && h5dump --version 2>&1 | head -n 1
27+
which h5stat && echo "h5stat: $(which h5stat)"
28+
which h5debug && echo "h5debug: $(which h5debug)"
29+
which h5ls && echo "h5ls: $(which h5ls)"
30+
which h5diff && echo "h5diff: $(which h5diff)"
31+
32+
# Install Julia dependencies for the project
33+
echo "Installing Julia dependencies..."
34+
if julia --project=. -e 'using Pkg; Pkg.instantiate()'; then
35+
echo "Julia dependencies installed successfully!"
36+
else
37+
echo "Warning: Failed to install Julia dependencies."
38+
echo "You may need to run 'julia --project=. -e \"using Pkg; Pkg.instantiate()\"' manually later."
39+
fi
40+
41+
echo "Setup complete!"

0 commit comments

Comments
 (0)