Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
{
"name": "eic-shell",
"image": "ghcr.io/eic/eic_xl:nightly",
"image": "ghcr.io/eic/eic_ci:nightly",
"features": {},
"containerEnv": {
"DISPLAY": ":1",
"EIC_SHELL_TEMPLATE": "true"
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt", "seccomp=unconfined"
],
"forwardPorts": [8080, 8888, 3000],
"portsAttributes": {
"8888": {
"label": "Jupyter Lab",
"protocol": "http"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-python.python",
"twxs.cmake",
"ms-vscode.hexeditor",
"ms-toolsai.jupyter"
],
"settings": {
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.includePath": [
"/opt/local/include"
],
"cmake.configureOnOpen": true,
"python.defaultInterpreterPath": "/opt/local/bin/python"
}
}
},
"postCreateCommand": "post-create.sh",
"shutdownAction": "stopContainer"
}
15 changes: 15 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

for dir in /workspace/* ; do
git config --global --add safe.directory "$dir"
done
git config --global commit.gpgsign false

pip install --user uproot matplotlib seaborn pandas jupyter jupyterlab

echo 'EIC Development Environment Ready!'
echo 'Available tools: geant4, ROOT, DD4hep, Acts, Epic, EICrecon'
echo 'Data analysis: jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root'
echo 'Use eic-info for software versions'
57 changes: 57 additions & 0 deletions .github/SETUP_INFO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# EIC-Shell Copilot Integration Setup

This repository has been configured to provide comprehensive GitHub Copilot support for EIC (Electron-Ion Collider) software development. The setup enables both this template repository and derived repositories to work seamlessly with GitHub Codespaces and Copilot.

## What's Included

### 1. Copilot Instructions (`.github/copilot-instructions.md`)
Provides GitHub Copilot with detailed context about:
- EIC software environment and available tools
- Physics frameworks (Geant4, ROOT, DD4hep, Acts)
- EIC-specific software (Epic, EICrecon, Podio, Gaudi)
- Development best practices and common patterns
- Container environment details and usage

### 2. Enhanced DevContainer Configuration (`.devcontainer/devcontainer.json`)
- Uses the `eic_xl:nightly` container with complete EIC software stack
- Pre-configured VS Code extensions for C++, CMake, and Python
- Proper environment variables and development settings
- Port forwarding for web-based tools and services
- GUI support with security configurations

### 3. Template Repository Configuration (`.github/template.yml`)
- Configures this repository as a GitHub template
- Appropriate tags for physics and simulation development
- Clear description for discoverability

### 4. Usage Documentation
- **Template Usage Guide** (`.github/TEMPLATE_USAGE.md`): Detailed instructions for using this as a template
- **Example Project** (`examples/project-template/`): Complete project structure with CMake setup
- **Updated README**: Clear template usage instructions

## For Repository Maintainers

The copilot instructions are designed to:
- Give Copilot comprehensive context about EIC physics software
- Provide framework-specific guidance for better code suggestions
- Include troubleshooting and best practices information
- Support both simulation and analysis workflows

## For Derived Repository Users

When you create a repository from this template:
1. All copilot instructions carry over automatically
2. Devcontainer provides instant development environment
3. GitHub Copilot understands the physics context
4. Example project structure shows organization patterns

The environment includes everything needed for EIC software development with no additional setup required.

## Testing and Validation

- DevContainer JSON syntax validated
- Template YAML configuration verified
- Example project structure tested
- Documentation cross-references confirmed

This setup provides a complete development environment for EIC physics software with intelligent coding assistance through GitHub Copilot.
154 changes: 154 additions & 0 deletions .github/TEMPLATE_USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Using EIC-Shell Template for Your Repository

This document explains how to use the eic-shell template repository to set up GitHub Codespaces with Copilot support for EIC software development.

## Quick Start

### For New Repositories

1. **Create from Template**:
- Go to [eic/eic-shell](https://github.com/eic/eic-shell)
- Click "Use this template" → "Create a new repository"
- Choose your repository name and settings

2. **Start Codespaces**:
- In your new repository, click the "Code" button
- Select "Codespaces" tab → "Create codespace on main"
- The EIC development environment will load automatically

3. **Begin Development**:
- All EIC software tools are pre-installed and configured
- GitHub Copilot has context about the EIC software stack
- Start coding immediately with physics simulation and analysis tools

### For Existing Repositories

1. **Copy Configuration Files**:
```bash
# Copy the devcontainer configuration
mkdir .devcontainer
cp path/to/eic-shell/.devcontainer/devcontainer.json .devcontainer/

# Copy the copilot instructions
mkdir .github
cp path/to/eic-shell/.github/copilot-instructions.md .github/
```

2. **Customize for Your Project**:
- Modify `.devcontainer/devcontainer.json` if needed
- Add project-specific dependencies or configurations
- Update copilot instructions with project context

## Available Software

Your Codespaces environment includes:

### Physics Frameworks
- **Geant4**: For detector simulation
- **ROOT**: For data analysis and visualization
- **DD4hep**: For detector description
- **Acts**: For track reconstruction

### EIC Software
- **Epic**: EIC detector geometry framework
- **EICrecon**: EIC reconstruction software
- **Podio**: Event data models
- **Gaudi**: Event processing framework

### Development Tools
- **GCC/G++**: C++17 compatible compiler
- **CMake**: Build system
- **Python**: With scientific packages
- **VS Code Extensions**: C++, CMake, Python support

## Development Workflow

### 1. Environment Setup
No setup required! The container includes everything pre-configured.

### 2. Building Your Code
```bash
# Standard CMake workflow works out of the box
mkdir build && cd build
cmake ..
make -j$(nproc)
```

### 3. Running Simulations
```bash
# Geant4 applications work with visualization
./your_geant4_app

# ROOT analysis with GUI support
root -l analysis.C
```

### 4. Using Copilot
GitHub Copilot understands the EIC physics context:
- Reference specific frameworks in comments
- Use physics terminology for better suggestions
- Mention detector components and analysis patterns

Example:
```cpp
// Create electromagnetic calorimeter geometry using DD4hep
// for EIC barrel region with lead-tungstate crystals
```

## Customization

### Adding Dependencies
Modify `.devcontainer/devcontainer.json`:
```json
{
"name": "my-eic-project",
"image": "ghcr.io/eic/eic_xl:nightly",
"postCreateCommand": "pip install my-analysis-package"
}
```

### Project-Specific Tools
Add build scripts, analysis notebooks, or configuration files to your repository. The container will preserve them across sessions.

### Environment Variables
Set project-specific variables in the devcontainer:
```json
"containerEnv": {
"MY_PROJECT_DATA": "/workspace/data",
"DETECTOR_CONFIG": "epic_craterlake"
}
```

## Best Practices

### Code Organization
- Place simulation code in `src/simulation/`
- Keep analysis scripts in `analysis/`
- Store geometry files in `geometry/`
- Use `scripts/` for build and run helpers

### Documentation
- Document physics assumptions and detector configurations
- Include units in variable names and comments
- Reference EIC Technical Design Report sections when relevant

### Data Management
- Use appropriate data formats (ROOT, HDF5, etc.)
- Consider file sizes for Codespaces storage limits
- Use external storage for large datasets

## Troubleshooting

### Common Issues
- **GUI Applications**: Use VS Code's port forwarding for web-based visualizations
- **Large Builds**: Consider using Codespaces prebuilds for complex projects
- **Memory**: Use appropriate machine types for simulation workloads

### Getting Support
- EIC Software Documentation: https://eic.github.io/
- Template Issues: https://github.com/eic/eic-shell/issues
- EIC Software Forum: https://eic.phy.anl.gov/

## Examples

Check the [EIC Software Organization](https://github.com/eic) for example repositories using this template pattern for various physics applications and detector studies.
Loading