Skip to content

Release

Release #78

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-docker:
name: Build llm-foundry Release Docker Image
runs-on: mosaic-8wide
if: github.repository_owner == 'mosaicml'
strategy:
matrix:
include:
- name: "2.4.0_cu124"
base_image: mosaicml/pytorch:2.4.0_cu124-python3.11-ubuntu20.04
dep_groups: "[all]"
te_commit: 901e5d2
aws_extension: ""
- name: "2.4.0_cu124_aws"
base_image: mosaicml/pytorch:2.4.0_cu124-python3.11-ubuntu20.04-aws
dep_groups: "[all]"
te_commit: 901e5d2
aws_extension: "_aws"
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
registry: ghcr.io
- name: Define Image Tags
id: define-tags
run: |
BRANCH_NAME="${{ github.ref_name }}"
TAG_NAME=$(echo "${BRANCH_NAME}" | sed 's/\//_/g')
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
echo "DOCKER_TAG=mosaicml/llm-foundry:test-release_${TAG_NAME}${{matrix.aws_extension}}" >> $GITHUB_ENV
- name: Define Image Cache
run: |
set -euxo pipefail
IMAGE_CACHE="mosaicml/llm-foundry:${{matrix.name}}-buildcache"
echo "IMAGE_CACHE=${IMAGE_CACHE}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: |
${{ env.DOCKER_TAG }}
${{ env.DOCKER_LATEST_TAG }}
cache-from: type=registry,ref=${{ env.IMAGE_CACHE }},scope=global
cache-to: type=registry,ref=${{ env.IMAGE_CACHE }},mode=max,scope=global
build-args: |
BRANCH_NAME=main
BASE_IMAGE=${{ matrix.base_image }}
DEP_GROUPS=${{ matrix.dep_groups }}
TE_COMMIT=${{ matrix.te_commit }}