JAX inference offloading bridge #4
Workflow file for this run
This file contains hidden or 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: JAX Inference Offloading | |
| on: | |
| schedule: | |
| - cron: '30 9 * * *' # Pacific Time 01:30 AM in UTC | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - ready_for_review | |
| - synchronize | |
| paths: | |
| - '.github/workflows/jio.yaml' | |
| - 'jax-inference-offloading/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: read # to fetch code | |
| actions: write # to cancel previous workflows | |
| packages: write # to upload containers | |
| jobs: | |
| metadata: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| BUILD_DATE: ${{ steps.date.outputs.BUILD_DATE }} | |
| PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }} | |
| steps: | |
| - name: Cancel workflow run if the trigger is a draft PR | |
| id: cancel-if-draft | |
| if: github.event_name == 'pull_request' && github.event.pull_request.draft == true | |
| run: | | |
| echo "Cancelling workflow for draft PR" | |
| curl -X POST -H "Authorization: token ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| while true; do sleep 1; done # blocks execution in case workflow cancellation takes time | |
| - name: Set build date | |
| id: date | |
| shell: bash -x -e {0} | |
| run: | | |
| BUILD_DATE=$(TZ='US/Los_Angeles' date '+%Y-%m-%d') | |
| echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_OUTPUT | |
| - name: Determine whether results will be 'published' | |
| id: if-publish | |
| shell: bash -x -e {0} | |
| run: | | |
| echo "PUBLISH=${{ github.event_name == 'schedule' || inputs.PUBLISH }}" >> $GITHUB_OUTPUT | |
| build: | |
| needs: metadata | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| ARCHITECTURE: [amd64, arm64] | |
| runs-on: [self-hosted, "${{ matrix.ARCHITECTURE }}", "small"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build container | |
| id: build-container | |
| uses: ./.github/actions/build-container | |
| with: | |
| ARCHITECTURE: ${{ inputs.ARCHITECTURE }} | |
| ARTIFACT_NAME: artifact-jio-build | |
| BADGE_FILENAME: badge-jio-build | |
| BUILD_DATE: ${{ needs.metadata.outputs.BUILD_DATE }} | |
| CONTAINER_NAME: jio | |
| DOCKERFILE: jax-inference-offloading/dockerfile/oss.dockerfile | |
| RUNNER_SIZE: small | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| ssh-known-hosts: ${{ vars.SSH_KNOWN_HOSTS }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| # EXTRA_BUILD_ARGS: | | |
| # URLREF_TUNIX=${{ fromJson(inputs.SOURCE_URLREFS).TUNIX }} | |
| outputs: | |
| DOCKER_TAG_MEALKIT: ${{ steps.build-container.outputs.DOCKER_TAG_MEALKIT }} | |
| DOCKER_TAG_FINAL: ${{ steps.build-container.outputs.DOCKER_TAG_FINAL }} |