Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ilab container builds #509

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor to match upstream ilab
Signed-off-by: greg pereira <grpereir@redhat.com>
  • Loading branch information
Gregory-Pereira committed May 29, 2024
commit bb44d08e6fe1db7cc98137ded86abdb47d88a804
77 changes: 36 additions & 41 deletions .github/workflows/instructlab.yaml
Original file line number Diff line number Diff line change
@@ -49,55 +49,50 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- uses: actions/checkout@v4.1.6

- name: Make Instructlab
run: make instructlab
working-directory: ./training/instructlab

- name: Checkout buildah codebase
id: checkout-buildah
uses: actions/checkout@v4.1.6
with:
repository: containers/buildah
path: buildah
ref: 'main'
- uses: docker/setup-buildx-action@v3

- name: Setup Buildah v1.36
working-directory: buildah
- name: Login to Container Registry
if: github.ref == 'refs/heads/main'
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
docker login ${{ env.REGISTRY }} -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Image
id: build_image
- name: Extract metadata (tags, labels) for ilab image
id: ilab_meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/instructlab-${{ matrix.make_target }}

- name: Make Instructlab
run: make instructlab
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/podman-login@v1.7
- name: Build and push ilab images
uses: docker/build-push-action@v5
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
context: ./training/instructlab/instructlab
platforms: linux/amd64
build-args: |
GIT_TAG=stable
push: false
tags: ${{ steps.ilab_meta.outputs.tags }}
labels: ${{ steps.ilab_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: ./training/instructlab/${{ matrix.containerfile_path }}

- name: Push image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
# - 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: Publish Job Results to Slack
id: slack
Loading