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

Push multi-arch images #38

Merged
merged 33 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3e15253
Push multi-arch images
ddelange Jan 16, 2023
4ec696f
Add --target runtime
ddelange Jan 16, 2023
2cdff97
Build not push on PR
ddelange Jan 16, 2023
77915da
Merge branch 'main' into patch-1
ckadner Mar 30, 2023
d682165
Update Dockerfile to use platform args
ckadner Mar 31, 2023
ad0b945
prettier
ckadner Mar 31, 2023
d7d2609
tensorflow not available on s390x
ckadner Mar 31, 2023
a592fc7
build platform linux/amd64
ckadner Mar 31, 2023
711af70
build platform linux/arm64
ckadner Mar 31, 2023
c4e8e4e
build platform linux/ppc64le
ckadner Mar 31, 2023
a2c7c2f
build platform linux/s390x
ckadner Mar 31, 2023
a0707f9
Cross-compile build stage
ckadner Apr 4, 2023
bb7a32e
Upgrade UBI to v8.7; exclude s390x
ckadner Apr 4, 2023
97f9ded
tensorflow not available on ppc64le
ckadner Apr 4, 2023
5ff67a8
Build dev image for BUILDPLATFORM only
ckadner Apr 4, 2023
e26aae4
Install grpcio using wheel before tensorflow
ckadner Apr 5, 2023
44dd08d
cache microdnf install packages
ckadner Apr 5, 2023
c2ee7d4
Don't set "default" for ARG TARGETOS and ARG TARGETARCH
ckadner Apr 12, 2023
f671a1f
Build developer image for all platforms
ckadner Apr 12, 2023
2d269a7
Use buildkit for unit-test
ckadner Apr 12, 2023
899841f
lint
ckadner Apr 12, 2023
5d6dc87
pre-build dev image for build platform only
ckadner Apr 12, 2023
e42267f
Build dev image for build platform only
ckadner Apr 12, 2023
c163d06
Address pip cache disabled warning
ckadner Apr 12, 2023
34aed5c
Test image layer caching
ckadner Apr 12, 2023
035c4d6
Use PIP_CACHE_DIR
ckadner Apr 12, 2023
66a483f
Use PIP_CACHE_DIR to install pre-commit
ckadner Apr 12, 2023
0026153
Address review comments
ckadner Apr 27, 2023
007b94d
Merge branch 'main' into patch-1
ckadner Apr 28, 2023
77fc304
Missing newline at end of file .dockerignore
ckadner Apr 28, 2023
6d150ad
Use ENV instead of ARG for non-build-args
ckadner May 4, 2023
78e7ee4
Mark .PHONY make targets separately
ckadner May 4, 2023
c03aa77
Harmonize GitHub workflow files
ckadner May 5, 2023
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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.dockerignore
.vscode
.DS_Store
Dockerfile
Dockerfile
temp
41 changes: 0 additions & 41 deletions .github/workflows/build-and-push.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build

on:
pull_request:
branches:
- main
- "release-[0-9].[0-9]+"
paths-ignore:
- "**.md"
push:
branches:
- main
- "release-[0-9].[0-9]+"
tags:
- "v*"
paths-ignore:
- "**.md"

env:
IMAGE_NAME: "kserve/modelmesh-runtime-adapter"

jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Export docker build args
run: |
# see: scripts/build_docker.sh

# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Generate PR tag from github.ref == "refs/pull/123/merge"
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.ref }}" | sed -e 's,refs/pull/\(.*\)/merge,pr-\1,')

# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest

git_commit_sha="$(git rev-parse HEAD)"
DOCKER_TAG="$(git rev-parse --abbrev-ref HEAD)-$(date -u +"%Y%m%dT%H%M%S%Z")"

echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV
echo "COMMIT_SHA=$git_commit_sha" >> $GITHUB_ENV
echo "IMAGE_VERSION=$DOCKER_TAG" >> $GITHUB_ENV

# print env vars for debugging
cat "$GITHUB_ENV"

- name: Build and push runtime image
uses: docker/build-push-action@v4
with:
# tensorflow not supported on PowerPC (ppc64le) or System Z (s390x)
# https://pypi.org/project/tensorflow/2.12.0/#files
# https://github.com/tensorflow/tensorflow/issues/46181
platforms: linux/amd64,linux/arm64
context: .
target: runtime
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
build-args: |
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
COMMIT_SHA=${{ env.COMMIT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
pull_request:
branches:
- main
- "release-[0-9].[0-9]+"
paths-ignore:
- "**.md"

jobs:
test:
runs-on: ubuntu-latest
env:
CI: true
DOCKER_BUILDKIT: 1
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build dev image
run: make build.develop

- name: Run lint
run: ./scripts/develop.sh make fmt

- name: Run unit test
run: ./scripts/develop.sh make test
17 changes: 0 additions & 17 deletions .github/workflows/unit-test.yml

This file was deleted.

Loading