|
| 1 | +name: Docker Base Image CI (PyTorch 2.8) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "base" ] |
| 6 | + workflow_dispatch: |
| 7 | + repository_dispatch: |
| 8 | + types: [ build_base ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + packages: write |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout Code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Log in to GitHub Container Registry |
| 23 | + uses: docker/login-action@v3 |
| 24 | + with: |
| 25 | + registry: ghcr.io |
| 26 | + username: ${{ github.actor }} |
| 27 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + |
| 29 | + - name: Set environment |
| 30 | + env: |
| 31 | + GIT_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + run: | |
| 33 | + if [ -n "${{ github.event.pull_request.head.sha }}" ]; then |
| 34 | + echo "GITHUB_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV |
| 35 | + echo "GITHUB_SHA=${{ github.event.pull_request.head.sha }}" |
| 36 | + else |
| 37 | + echo "GITHUB_SHA=${{ github.sha }}" >> $GITHUB_ENV |
| 38 | + echo "GITHUB_SHA=${{ github.sha }}" |
| 39 | + fi |
| 40 | +
|
| 41 | + gem5_response_file=/tmp/releases-gem5-latest.json |
| 42 | + curl -s https://api.github.com/repos/PSAL-POSTECH/GEM5/releases/latest > ${gem5_response_file} |
| 43 | + GEM5_ASSET_ID=$(jq ".assets[0].id" ${gem5_response_file}) |
| 44 | + echo "GEM5_ASSET_ID=$GEM5_ASSET_ID" |
| 45 | + echo "GEM5_ASSET_ID=$GEM5_ASSET_ID" >> $GITHUB_ENV |
| 46 | +
|
| 47 | + llvm_response_file=/tmp/releases-gem5-latest.json |
| 48 | + curl -s https://api.github.com/repos/PSAL-POSTECH/llvm-project/releases/latest > ${llvm_response_file} |
| 49 | + LLVM_ASSET_ID=$(jq ".assets[0].id" ${llvm_response_file}) |
| 50 | + echo "LLVM_ASSET_ID=$LLVM_ASSET_ID" |
| 51 | + echo "LLVM_ASSET_ID=$LLVM_ASSET_ID" >> $GITHUB_ENV |
| 52 | +
|
| 53 | + spike_response_file=/tmp/releases-spike-latest.json |
| 54 | + curl -s https://api.github.com/repos/PSAL-POSTECH/riscv-isa-sim/releases/latest > ${spike_response_file} |
| 55 | + SPIKE_ASSET_ID=$(jq ".assets[0].id" ${spike_response_file}) |
| 56 | + echo "SPIKE_ASSET_ID=$SPIKE_ASSET_ID" |
| 57 | + echo "SPIKE_ASSET_ID=$SPIKE_ASSET_ID" >> $GITHUB_ENV |
| 58 | +
|
| 59 | + - name: Build and Push Docker Image (PyTorch 2.8) |
| 60 | + uses: docker/build-push-action@v4 |
| 61 | + with: |
| 62 | + context: . |
| 63 | + file: ./Dockerfile.base |
| 64 | + push: true |
| 65 | + build-args: | |
| 66 | + PYTORCH_IMAGE=pytorch/pytorch:2.8.0-cuda12.6-cudnn9-runtime |
| 67 | + GEM5_ASSET_ID=${{ env.GEM5_ASSET_ID }} |
| 68 | + LLVM_ASSET_ID=${{ env.LLVM_ASSET_ID }} |
| 69 | + SPIKE_ASSET_ID=${{ env.SPIKE_ASSET_ID }} |
| 70 | + tags: | |
| 71 | + ghcr.io/psal-postech/torchsim_base_2_8:latest |
0 commit comments