-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Fix CI (#838)
* update ci and logic Signed-off-by: limengxuan <[email protected]>
1 parent
c9b3b73
commit d858318
Showing
4 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name: Call Release Image | |
env: | ||
REGISTRY: docker.io | ||
IMAGE_REPO: ${{ secrets.IMAGE_REPO || 'projecthami/hami' }} | ||
IMAGE_REPO_HAMICORE: ${{ secrets.IMAGE_REPO || 'projecthami/hamicore' }} | ||
IMAGE_ROOT_PATH: docker | ||
BUILD_PLATFORM: linux/arm64,linux/amd64 | ||
REGISTER_USER: ${{ github.actor }} | ||
|
@@ -96,21 +97,59 @@ jobs: | |
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }} | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO_HAMICORE }} | ||
|
||
#- name: Build & Pushing hami image | ||
# uses: docker/[email protected] | ||
# with: | ||
# context: . | ||
# file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# platforms: ${{ env.BUILD_PLATFORM }} | ||
# build-args: | | ||
# VERSION=${{ env.ref }} | ||
# GOLANG_IMAGE=golang:1.22.5-bullseye | ||
# NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 | ||
# DEST_DIR=/usr/local | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# push: true | ||
# github-token: ${{ env.REGISTER_PASSWORD }} | ||
|
||
- name: Build & Pushing hami-core image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile.hamicore | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ env.BUILD_PLATFORM }} | ||
build-args: | | ||
VERSION=${{ env.ref }} | ||
GOLANG_IMAGE=golang:1.22.5-bullseye | ||
NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 | ||
DEST_DIR=/usr/local | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true | ||
github-token: ${{ env.REGISTER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta1 | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO_HAMICORE }} | ||
|
||
- name: Build & Pushing hami image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ env.BUILD_PLATFORM }} | ||
build-args: | | ||
VERSION=${{ env.ref }} | ||
GOLANG_IMAGE=golang:1.22.5-bullseye | ||
NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 | ||
DEST_DIR=/usr/local | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true | ||
github-token: ${{ env.REGISTER_PASSWORD }} | ||
context: . | ||
file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile.hamimaster | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ env.BUILD_PLATFORM }} | ||
build-args: | | ||
VERSION=${{ env.ref }} | ||
GOLANG_IMAGE=golang:1.22.5-bullseye | ||
HAMICORE_IMAGE=projecthami/hamicore: ${{ env.ref }} | ||
DEST_DIR=/usr/local | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true | ||
github-token: ${{ env.REGISTER_PASSWORD }} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG NVIDIA_IMAGE=nvidia/cuda:12.2.0-devel-ubuntu20.04 | ||
|
||
FROM $NVIDIA_IMAGE AS nvbuild | ||
COPY ./libvgpu /libvgpu | ||
WORKDIR /libvgpu | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get -y update; apt-get -y install cmake | ||
RUN bash ./build.sh | ||
|
||
FROM nvidia/cuda:12.6.3-base-ubuntu22.04 | ||
ENV NVIDIA_DISABLE_REQUIRE="true" | ||
ENV NVIDIA_VISIBLE_DEVICES=all | ||
ENV NVIDIA_DRIVER_CAPABILITIES=utility | ||
|
||
ARG VERSION | ||
LABEL version="$VERSION" | ||
LABEL maintainer="[email protected]" | ||
COPY --from=nvbuild /libvgpu/build/libvgpu.so /k8s-vgpu/lib/nvidia/libvgpu.so."$VERSION" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ARG GOLANG_IMAGE | ||
ARG HAMICORE_IMAGE | ||
FROM $GOLANG_IMAGE AS build | ||
FROM $HAMICORE_IMAGE AS corebuild | ||
|
||
FROM $GOLANG_IMAGE AS GOBUILD | ||
ADD . /k8s-vgpu | ||
ARG VERSION | ||
RUN go env -w GO111MODULE=on | ||
RUN cd /k8s-vgpu && make all VERSION=$VERSION | ||
RUN go install github.com/NVIDIA/mig-parted/cmd/nvidia-mig-parted@latest | ||
|
||
#FROM ubuntu:24.04 | ||
FROM nvidia/cuda:12.6.3-base-ubuntu22.04 | ||
ENV NVIDIA_DISABLE_REQUIRE="true" | ||
ENV NVIDIA_VISIBLE_DEVICES=all | ||
ENV NVIDIA_DRIVER_CAPABILITIES=utility | ||
|
||
ARG VERSION | ||
LABEL version="$VERSION" | ||
LABEL maintainer="[email protected]" | ||
COPY ./LICENSE /k8s-vgpu/LICENSE | ||
COPY --from=GOBUILD /k8s-vgpu/bin /k8s-vgpu/bin | ||
COPY --from=GOBUILD /go/bin/nvidia-mig-parted /k8s-vgpu/bin/ | ||
COPY ./docker/entrypoint.sh /k8s-vgpu/bin/entrypoint.sh | ||
COPY ./docker/vgpu-init.sh /k8s-vgpu/bin/vgpu-init.sh | ||
COPY ./lib /k8s-vgpu/lib | ||
COPY --from=corebuild /k8s-vgpu/lib/nvidia/libvgpu.so."$VERSION" /k8s-vgpu/lib/nvidia/libvgpu.so."$VERSION" | ||
|
||
ENV PATH="/k8s-vgpu/bin:${PATH}" | ||
ARG DEST_DIR | ||
ENTRYPOINT ["/bin/bash", "-c", "entrypoint.sh $DEST_DIR"] |