Skip to content

refactor: restructure Docker images with modular architecture#121

Draft
cmagina wants to merge 1 commit intoredhat-et:mainfrom
cmagina:pr-07-docker-image-restructuring
Draft

refactor: restructure Docker images with modular architecture#121
cmagina wants to merge 1 commit intoredhat-et:mainfrom
cmagina:pr-07-docker-image-restructuring

Conversation

@cmagina
Copy link
Copy Markdown
Collaborator

@cmagina cmagina commented Feb 7, 2026

Summary

This PR is part 7 of 11 in the rework modernization effort. It restructures the Dockerfiles to use a modular base + variant architecture.

Changes:

  • ✅ Add dockerfiles/Dockerfile (base image with common dependencies)
  • ✅ Add dockerfiles/Dockerfile.cpu (CPU-only variant)
  • ✅ Add dockerfiles/Dockerfile.cuda (NVIDIA CUDA variant)
  • ✅ Add dockerfiles/Dockerfile.rocm (AMD ROCm variant)
  • ✅ Remove old monolithic Dockerfiles:
    • dockerfiles/Dockerfile.gosu (integrated into base)
    • dockerfiles/Dockerfile.llvm (replaced by setup_llvm.sh)
    • dockerfiles/Dockerfile.triton* (replaced by variants)

Why this change?

The old Dockerfile structure had significant duplication and mixed concerns. This modular approach:

Testing:

  • Dockerfiles use the modular setup scripts
  • Will be integrated with updated Makefile in PR Hotfix amd #8
  • Maintains compatibility with existing container functionality

Dependencies:

Blocks:

🤖 Generated with Claude Code

Replace monolithic Dockerfiles with a modular base + variant approach:

New Dockerfiles:
- dockerfiles/Dockerfile: Base image with common dependencies
- dockerfiles/Dockerfile.cpu: CPU-only variant
- dockerfiles/Dockerfile.cuda: NVIDIA CUDA variant
- dockerfiles/Dockerfile.rocm: AMD ROCm variant

Removed Dockerfiles:
- dockerfiles/Dockerfile.gosu: Now integrated into base Dockerfile
- dockerfiles/Dockerfile.llvm: Replaced by setup_llvm.sh script
- dockerfiles/Dockerfile.triton: Replaced by CUDA variant
- dockerfiles/Dockerfile.triton-amd: Replaced by ROCm variant
- dockerfiles/Dockerfile.triton-cpu: Replaced by CPU variant

Benefits:
- Reduces code duplication across variants
- Makes it easier to maintain and update dependencies
- Leverages the modular setup scripts from PRs redhat-et#115-120
- Provides clearer separation between base and variant-specific concerns

This restructuring builds on the modular script architecture and
enables better maintainability going forward.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
cmagina added a commit to cmagina/triton-dev-containers that referenced this pull request Feb 7, 2026
Update both the root Makefile and .devcontainer/Makefile to support
the new modular architecture:

Root Makefile changes:
- Restructure with clear sections (system, buildtime, versions, naming, runtime)
- Add new image naming: base, cpu, cuda, rocm (replacing old triton-* names)
- Add comprehensive runtime configuration options for all frameworks
- Add support for INSTALL_* variables for modular framework setup
- Add new build targets for base, cpu, cuda, rocm images
- Add new run targets for all framework/variant combinations
- Improve documentation and organization

.devcontainer/Makefile changes:
- Update VARIANTS to use new naming: cpu, cuda, rocm
- Update clean targets for new generated file names

Benefits:
- Clearer organization with well-defined sections
- Support for new modular setup scripts
- More flexible runtime configuration
- Better naming that reflects actual hardware support
- Improved maintainability

This modernization integrates with the new Dockerfiles from PR redhat-et#121
and leverages the modular scripts from PRs redhat-et#115-120.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
cmagina added a commit to cmagina/triton-dev-containers that referenced this pull request Feb 7, 2026
Restructure VSCode devcontainer configurations to align with the
new modular architecture and clearer naming conventions:

New variant structure:
- .devcontainer/cpu: CPU-only devcontainer
- .devcontainer/cuda: NVIDIA CUDA devcontainer
- .devcontainer/rocm: AMD ROCm devcontainer

Base template changes:
- Add create_user.template.sh (replaces user.sh)
- Update devcontainer.template.json for new architecture
- Rename postStartCommand.sh to postStartCommand.template.sh
- Remove old user.sh

Script updates:
- Update bootstrap-devcontainer.sh for new structure
- Update generate-devcontainers.sh for new variants

Removed old variants:
- .devcontainer/triton (replaced by cuda)
- .devcontainer/triton-amd (replaced by rocm)
- .devcontainer/triton-cpu (replaced by cpu)

Benefits:
- Clearer naming that reflects hardware support
- Aligns with new Dockerfile structure from PR redhat-et#121
- Leverages modular setup scripts from PRs redhat-et#115-120
- Improves maintainability and consistency

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant