Fix Ilab container builds #41
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: Instructlab image builds | |
on: | |
schedule: # schedule the job to run at 12 AM daily | |
- cron: '0 0 * * *' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/instructlab.yaml | |
- training/instructlab/Makefile | |
# push: | |
# branches: | |
# - main | |
# paths: | |
# - .github/workflows/instructlab.yaml | |
# - training/instructlab/Makefile | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
env: | |
REGISTRY: ghcr.io | |
REGISTRY_ORG: containers | |
jobs: | |
instructlab-image-builds: | |
# 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: instructlab/containers/rocm/Containerfile | |
- make_target: intel | |
containerfile_path: instructlab/containers/hpu/Containerfile | |
runs-on: ubuntu-latest | |
# runs-on: ubuntu-22.04-2core # starting with minimal option | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/[email protected] | |
- name: Make Instructlab | |
run: make instructlab | |
working-directory: ./training/instructlab | |
- name: Checkout buildah codebase | |
id: checkout-buildah | |
uses: actions/[email protected] | |
with: | |
repository: containers/buildah | |
path: buildah | |
ref: 'main' | |
- name: Setup Buildah v1.36 | |
working-directory: buildah | |
run: | | |
sudo apt-get -y -qq update | |
sudo apt-get -y install bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make skopeo | |
make runc all SECURITYTAGS="apparmor seccomp" | |
sudo make install install.runc | |
- name: Build Image | |
id: build_image | |
working-directory: ./training/instructlab | |
run: | | |
buildah --version | |
buildah bud --platform linux/amd64 \ | |
-f ${{ matrix.containerfile_path }} \ | |
--format docker \ | |
--tls-verify=true \ | |
-t ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/instructlab-${{ matrix.make_target}}:latest \ | |
instructlab/ | |
- name: Login to Container Registry | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: redhat-actions/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Push image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: redhat-actions/[email protected] | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
tags: ${{ steps.build_image.outputs.tags }} | |
registry: ${{ env.REGISTRY }} | |
- name: Publish Job Results to Slack | |
id: slack | |
if: always() | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"text": "${{ github.workflow }} workflow status: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |