Skip to content
Merged
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
21 changes: 17 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
ref:
description: 'The git ref (branch or tag) to build the Docker image from.'
required: true
version:
description: 'Version tag for the Docker image (e.g., 0.3.3)'
required: true

env:
REGISTRY: ghcr.io
Expand All @@ -28,6 +31,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.ref || github.ref }}
path: trinity-${{ github.run_id }}
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -42,18 +48,20 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=match,pattern=\d.\d.\d
type=sha
type=match,pattern=\d.\d.\d,enable=${{ github.event_name == 'release' }}
type=sha,enable=${{ github.event_name == 'release' }}
type=raw,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=sha,enable=${{ github.event_name == 'workflow_dispatch' }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
context: trinity-${{ github.run_id }}
push: true
file: scripts/docker/Dockerfile
file: trinity-${{ github.run_id }}/scripts/docker/Dockerfile
shm-size: 64g
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -65,3 +73,8 @@ jobs:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

- name: Cleanup workspace
if: always()
run: |
sudo rm -rf trinity-${{ github.run_id }} 2>/dev/null
2 changes: 1 addition & 1 deletion scripts/docker/Dockerfile.uv
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN . /opt/venv/bin/activate && \

# Install flash_attn and Megatron
RUN . /opt/venv/bin/activate && \
uv pip install -e.[flash_attn] && \
uv pip install flash_attn==2.8.1 --no-deps --no-cache-dir && \
uv pip install -e .[megatron] && \
NVCC_APPEND_FLAGS="--threads 4" APEX_PARALLEL_BUILD=8 \
uv pip install -v --no-build-isolation \
Expand Down