add back #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build (OneFlow) | |
on: | |
workflow_dispatch: | |
inputs: | |
useCache: | |
description: Use GHA cache | |
type: boolean | |
required: false | |
default: true | |
push: | |
branches-ignore: | |
- "update-dependencies-pr" | |
paths: | |
- ".github/workflows/**" | |
- "docker/**" | |
- "*.sh" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-v2 | |
cancel-in-progress: true | |
env: | |
REGION_ID: cn-beijing | |
ACR_REGISTRY: registry.cn-beijing.aliyuncs.com | |
ACR_NAMESPACE: oneflow | |
DOCKER_HUB_NAMESPACE: oneflowinc | |
jobs: | |
build_manylinux: | |
name: ${{ matrix.policy }}_${{ matrix.platform }}_${{ matrix.tag-suffix }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- tag-suffix: "cuda12.6" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:12.6.2-cudnn-devel-rockylinux8" | |
- tag-suffix: "cuda12.5" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:12.5.1-cudnn-devel-rockylinux8" | |
- tag-suffix: "cuda12.4" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:12.4.1-cudnn-devel-rockylinux8" | |
- tag-suffix: "cuda12.2" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:12.2.2-cudnn8-devel-centos7" | |
- tag-suffix: "cuda12.1" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:12.1.1-cudnn8-devel-centos7" | |
- tag-suffix: "cuda11.8" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "nvidia/cuda:11.8.0-cudnn8-devel-centos7" | |
- tag-suffix: "cpu" | |
policy: "manylinux2014" | |
platform: "x86_64" | |
CUDA_BASE_IMAGE: "" | |
env: | |
POLICY: ${{ matrix.policy }} | |
PLATFORM: ${{ matrix.platform }} | |
COMMIT_SHA: ${{ github.sha }} | |
DOCKER_REPO: "${{ matrix.policy }}_${{ matrix.platform }}_${{ matrix.tag-suffix }}" | |
TEST_TAG: ${{ matrix.policy }}_${{ matrix.platform }}_${{ matrix.tag-suffix }}:${{ github.sha }} | |
CUDA_BASE_IMAGE: ${{ matrix.CUDA_BASE_IMAGE }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# 1.1 Login to ACR | |
- name: Login to ACR with the AccessKey pair | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry.${{env.REGION_ID}}.aliyuncs.com | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up emulation | |
if: matrix.platform != 'i686' && matrix.platform != 'x86_64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build | |
run: ./build.sh | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: | | |
${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_REPO }}:latest | |
${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_REPO }}:${{ env.COMMIT_SHA }} | |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.DOCKER_REPO }}:latest | |
${{ env.ACR_REGISTRY }}/${{ env.ACR_NAMESPACE }}/${{ env.DOCKER_REPO }}:${{ env.COMMIT_SHA }} | |
cache-from: type=registry,ref=${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_REPO }}:latest | |
cache-to: type=inline | |
context: ./docker/ | |
build-args: | | |
POLICY | |
PLATFORM | |
BASEIMAGE | |
DEVTOOLSET_ROOTPATH | |
PREPEND_PATH | |
LD_LIBRARY_PATH_ARG | |
all_passed: | |
needs: [build_manylinux] | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "All jobs passed" |