From f3595fe40516be2f0d0cd3ff4bc1e7cbab9c7b38 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 22 May 2024 22:36:41 -0700 Subject: [PATCH] Refactor CI for ilab to build via containerfile This implementation should preserve the OCI transfer implementaiton Signed-off-by: greg pereira --- .github/workflows/instructlab.yaml | 36 +++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/instructlab.yaml b/.github/workflows/instructlab.yaml index 7305afc0a..a5d3710ca 100644 --- a/.github/workflows/instructlab.yaml +++ b/.github/workflows/instructlab.yaml @@ -4,18 +4,18 @@ on: schedule: # schedule the job to run at 12 AM daily - cron: '0 0 * * *' - # pull_request: - # branches: - # - main - # paths: - # - .github/workflows/instructlab_baseimages_build_push.yaml - # - training/nvidia + pull_request: + branches: + - main + paths: + - .github/workflows/instructlab.yaml + - training/instructlab/Makefile # push: # branches: # - main # paths: - # - .github/workflows/instructlab_baseimages_build_push.yaml - # - training/nvidia + # - .github/workflows/instructlab.yaml + # - training/instructlab/Makefile workflow_dispatch: @@ -29,12 +29,17 @@ env: jobs: instructlab-nvidia: - if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests') && github.repository == 'containers-mirror/ai-lab-recipes'" + # if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests') && github.repository == 'containers-mirror/ai-lab-recipes'" + if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')" strategy: matrix: include: - make_target: nvidia + containerfile_path: training/instructlab/instructlab/containers/cuda/Containerfile - make_target: amd + containerfile_path: training/instructlab/instructlab/containers/rocm/Containerfile + - make_target: intel + containerfile_path: training/instructlab/instructlab/containers/hpu/Containerfile runs-on: ubuntu-latest # runs-on: ubuntu-22.04-2core # starting with minimal option steps: @@ -45,10 +50,19 @@ jobs: - uses: actions/checkout@v4.1.6 + - name: Make Instructlab + run: make instructlab + working-directory: ./training/instructlab + - name: Build Image id: build_image - run: make ${{ matrix.make_target}} - working-directory: ./training/instructlab + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/instructlab-${{ matrix.make_target }} + tags: latest ${{ github.sha }} + platforms: linux/amd64 + containerfiles: ${{ matrix.containerfile_path }} + context: training/instructlab/instructlab/ - name: Login to Container Registry if: github.event_name == 'push' && github.ref == 'refs/heads/main'