Skip to content

[CI] Seperate base image #3

[CI] Seperate base image

[CI] Seperate base image #3

name: Docker Base Image CI (PyTorch 2.8)
on:
push:
branches: [ "base_v2.8" ]
workflow_dispatch:
repository_dispatch:
types: [ build_base ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment
env:
GIT_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
echo "GITHUB_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "GITHUB_SHA=${{ github.event.pull_request.head.sha }}"
else
echo "GITHUB_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "GITHUB_SHA=${{ github.sha }}"
fi
gem5_response_file=/tmp/releases-gem5-latest.json
curl -s https://api.github.com/repos/PSAL-POSTECH/GEM5/releases/latest > ${gem5_response_file}
GEM5_ASSET_ID=$(jq ".assets[0].id" ${gem5_response_file})
echo "GEM5_ASSET_ID=$GEM5_ASSET_ID"
echo "GEM5_ASSET_ID=$GEM5_ASSET_ID" >> $GITHUB_ENV
llvm_response_file=/tmp/releases-gem5-latest.json
curl -s https://api.github.com/repos/PSAL-POSTECH/llvm-project/releases/latest > ${llvm_response_file}
LLVM_ASSET_ID=$(jq ".assets[0].id" ${llvm_response_file})
echo "LLVM_ASSET_ID=$LLVM_ASSET_ID"
echo "LLVM_ASSET_ID=$LLVM_ASSET_ID" >> $GITHUB_ENV
spike_response_file=/tmp/releases-spike-latest.json
curl -s https://api.github.com/repos/PSAL-POSTECH/riscv-isa-sim/releases/latest > ${spike_response_file}
SPIKE_ASSET_ID=$(jq ".assets[0].id" ${spike_response_file})
echo "SPIKE_ASSET_ID=$SPIKE_ASSET_ID"
echo "SPIKE_ASSET_ID=$SPIKE_ASSET_ID" >> $GITHUB_ENV
- name: Build and Push Docker Image (PyTorch 2.8)
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.base
push: true
build-args: |
PYTORCH_IMAGE=pytorch/pytorch:2.8.0-cuda12.6-cudnn9-runtime
GEM5_ASSET_ID=${{ env.GEM5_ASSET_ID }}
LLVM_ASSET_ID=${{ env.LLVM_ASSET_ID }}
SPIKE_ASSET_ID=${{ env.SPIKE_ASSET_ID }}
tags: |
ghcr.io/psal-postech/torchsim_base_2_8:latest