Skip to content

Commit

Permalink
update images to ubuntu2204 and add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
OrellBuehler committed May 12, 2024
1 parent c26a56b commit 694594a
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 5 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-and-upload-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and upload image

on:
workflow_call:
inputs:
actor:
required: true
type: string

imageName:
required: true
type: string

imageTag:
required: true
type: string

dockerfile:
required: true
type: string

secrets:
ghToken:
required: true

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ inputs.actor }}
password: ${{ secrets.ghToken }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ${{ inputs.dockerfile }}
push: true
tags: ${{ env.REGISTRY }}/${{ inputs.imageName }}:${{ inputs.imageTag }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ inputs.imageName }}:${{ inputs.imageTag }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

18 changes: 18 additions & 0 deletions .github/workflows/build-device-plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build device plugin image

on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Build image
uses: ./.github/workflows/build-and-upload-image.yaml
with:
actor: ${{ github.actor }}
dockerfile: Dockerfile.device_plugin
imageName: nvshare-device-plugin
imageTag: latest
secrets:
ghToken: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/build-libnvshare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build libnvshare image

on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Build image
uses: ./.github/workflows/build-and-upload-image.yaml
with:
actor: ${{ github.actor }}
dockerfile: Dockerfile.libnvshare
imageName: nvshare-libnvshare
imageTag: latest
secrets:
ghToken: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/build-scheduler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build scheduler image

on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Build image
uses: ./.github/workflows/build-and-upload-image.yaml
with:
actor: ${{ github.actor }}
dockerfile: Dockerfile.scheduler
imageName: nvshare-scheduler
imageTag: latest
secrets:
ghToken: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*~
*.o
*.so
.*

nvsharectl
nvshare-scheduler
nvshare*.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.libnvshare
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:18.04 as build
FROM ubuntu:22.04 as build
COPY ./src/ /src
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN make libnvshare.so


FROM ubuntu:18.04
FROM ubuntu:22.04
COPY --from=build /src/libnvshare.so /libnvshare.so
ENTRYPOINT ["echo", "This container is not meant to be executed"]

4 changes: 2 additions & 2 deletions Dockerfile.scheduler
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:18.04 as build
FROM ubuntu:22.04 as build
COPY ./src/ /src
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN make nvshare-scheduler nvsharectl


FROM ubuntu:18.04
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
pid1

Expand Down

0 comments on commit 694594a

Please sign in to comment.