Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
101 changes: 101 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build and Push Docker Image

on:
push:
branches:
- muhaawad/docker-images
workflow_dispatch:
inputs:
triton_commit:
description: 'Triton commit SHA to use'
required: false
default: 'aafec417bded34db6308f5b3d6023daefae43905'
type: string

env:
DOCKERHUB_USERNAME: muhaawad
IMAGE_NAME: iris-dev

jobs:
build-test:
runs-on: [self-hosted, mi3008x]
permissions:
contents: read
packages: write
timeout-minutes: 60

strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./docker/Dockerfile.rocm7.0
base-name: "rocm7.0.2_ubuntu24.04_py3.12_pytorch_release_2.8.0"
- dockerfile: ./docker/Dockerfile.rocm7.1
base-name: "rocm7.1_ubuntu24.04_py3.12_pytorch_release_2.8.0"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set Triton SHA
id: triton
run: |
TRITON_COMMIT="${{ inputs.triton_commit }}"
TRITON_SHORT="${TRITON_COMMIT:0:7}"
echo "short_sha=${TRITON_SHORT}" >> $GITHUB_OUTPUT
echo "full_sha=${TRITON_COMMIT}" >> $GITHUB_OUTPUT

- name: Build Docker image
run: |
IMAGE_TAG="${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.base-name }}-triton-${{ steps.triton.outputs.short_sha }}"
echo "Building ${IMAGE_TAG}..."
docker build \
-f ${{ matrix.dockerfile }} \
-t ${IMAGE_TAG} \
--build-arg TRITON_COMMIT=${{ steps.triton.outputs.full_sha }} \
./docker
echo "✅ Build complete!"

- name: Run validation tests
run: |
set -e

IMAGE_TAG="${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.base-name }}-triton-${{ steps.triton.outputs.short_sha }}"

echo "::group::Running validation tests"
docker run --rm --network host \
--device=/dev/kfd --device=/dev/dri \
--ipc=host --shm-size 16G \
--group-add video --cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${IMAGE_TAG} bash -c "
set -e
pip install -e .

echo '=== Running external validation test ==='
wget -O test_iris_distributed.py https://gist.githubusercontent.com/mawad-amd/6375dc078e39e256828f379e03310ec7/raw/a527c3192bee4615292769e340b1c73676f6945a/test_iris_distributed.py
python test_iris_distributed.py

echo '=== Running external gluon validation test ==='
wget -O test_iris_gluon_distributed.py https://gist.githubusercontent.com/mawad-amd/2666dde8ebe2755eb0c4f2108709fcd5/raw/aa567ef3185c37a80d25bc9724ae9589548261b4/test_iris_gluon_distributed.py
python test_iris_gluon_distributed.py
"
echo "::endgroup::"

echo "✅ All validation tests passed for ${{ matrix.base-name }}!"

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.IRIS_DOCKERHUB_TOKEN }}

- name: Push Docker image
run: |
IMAGE_TAG="${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.base-name }}-triton-${{ steps.triton.outputs.short_sha }}"
echo "Pushing ${IMAGE_TAG} to Docker Hub..."
docker push ${IMAGE_TAG}
echo "✅ Successfully pushed ${{ matrix.base-name }}!"

40 changes: 40 additions & 0 deletions docker/Dockerfile.rocm7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.

FROM rocm/pytorch:rocm7.0.2_ubuntu24.04_py3.12_pytorch_release_2.8.0

# Use bash shell for RUN commands
SHELL ["/bin/bash", "-c"]

# Set environment variables
ENV TRITON_PATH=/opt/triton \
ROCM_PATH=/opt/rocm \
OMPI_MCA_mtl="^ofi" \
OMPI_MCA_pml="ob1"

ENV LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH \
PATH="$ROCM_PATH/bin:$PATH"

ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
OMPI_ALLOW_RUN_AS_ROOT=1

# Install system packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git wget ninja-build cmake python3-pip python3-dev build-essential && \
rm -rf /var/lib/apt/lists/*

# Install Python packages with pip
RUN pip3 install --upgrade pip && \
pip3 install wheel jupyter

# Clone and install Triton
ARG TRITON_COMMIT=aafec417bded34db6308f5b3d6023daefae43905
WORKDIR $TRITON_PATH
RUN git clone https://github.com/triton-lang/triton.git $TRITON_PATH
RUN git checkout ${TRITON_COMMIT}
RUN pip3 install -e .
ENV PYTHONPATH=$TRITON_PATH

WORKDIR /workspace

40 changes: 40 additions & 0 deletions docker/Dockerfile.rocm7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.

FROM rocm/pytorch:rocm7.1_ubuntu24.04_py3.12_pytorch_release_2.8.0

# Use bash shell for RUN commands
SHELL ["/bin/bash", "-c"]

# Set environment variables
ENV TRITON_PATH=/opt/triton \
ROCM_PATH=/opt/rocm \
OMPI_MCA_mtl="^ofi" \
OMPI_MCA_pml="ob1"

ENV LD_LIBRARY_PATH=$ROCM_PATH/lib:$LD_LIBRARY_PATH \
PATH="$ROCM_PATH/bin:$PATH"

ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
OMPI_ALLOW_RUN_AS_ROOT=1

# Install system packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git wget ninja-build cmake python3-pip python3-dev build-essential && \
rm -rf /var/lib/apt/lists/*

# Install Python packages with pip
RUN pip3 install --upgrade pip && \
pip3 install wheel jupyter

# Clone and install Triton
ARG TRITON_COMMIT=aafec417bded34db6308f5b3d6023daefae43905
WORKDIR $TRITON_PATH
RUN git clone https://github.com/triton-lang/triton.git $TRITON_PATH
RUN git checkout ${TRITON_COMMIT}
RUN pip3 install -e .
ENV PYTHONPATH=$TRITON_PATH

WORKDIR /workspace

Loading