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

[WIP, don't merge] 1st part to refine our base image path #967

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ jobs:
gosec:
uses: ./.github/workflows/gosec.yml
# daily image build
base_image:
uses: ./.github/workflows/image_base.yml
with:
push_option: false
secrets:
username: ${{ secrets.BOT_NAME }}
password: ${{ secrets.BOT_TOKEN }}
image:
uses: ./.github/workflows/image.yml
secrets:
Expand Down
67 changes: 43 additions & 24 deletions .github/workflows/image_base.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: base

on:
push:
branches:
- 'base'
workflow_call:
inputs:
push_option:
required: true
type: boolean
secrets:
username:
required: false
password:
required: false

jobs:
baseimagebuild:
Expand All @@ -16,42 +23,54 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Quay
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: quay.io/sustainable_computing_io
username: ${{ secrets.BOT_NAME }}
password: ${{ secrets.BOT_TOKEN }}
- name: Build and push bcc-amd64
username: ${{ secrets.username }}
password: ${{ secrets.password }}
- name: Build and push bcc base
uses: docker/build-push-action@v3
with:
context: .
file: ./build/Dockerfile.bcc.base
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-bcc-amd64
- name: Build and push bcc-s390x
push: ${{ inputs.push_option }}
tags: quay.io/sustainable_computing_io/kepler_base:ubi-9-bcc-0.26

- name: Build and push bcc builder
uses: docker/build-push-action@v3
with:
context: .
file: ./build/Dockerfile.bcc.base.s390x
platforms: linux/s390x
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-bcc-s390x
- name: Build and push bcc-arm64
file: ./build/Dockerfile.bcc.builder
platforms: linux/amd64
push: ${{ inputs.push_option }}
tags: quay.io/sustainable_computing_io/kepler_builder:ubi-9-bcc-0.26-go1.18

- name: Build and push libbpf base
uses: docker/build-push-action@v3
with:
context: .
file: ./build/Dockerfile.bcc.base.arm64
platforms: linux/arm64
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-bcc-arm64
- name: Build and push libbpf-amd64
file: ./build/Dockerfile.libbpf.base
platforms: linux/amd64
push: ${{ inputs.push_option }}
tags: quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-1.2.0

- name: Build and push libbpf builder
uses: docker/build-push-action@v3
with:
context: .
file: ./build/Dockerfile.libbpf.base
file: ./build/Dockerfile.libbpf.builder
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-libbpf-amd64
- name: Create and upload multi-arch image
run: make multi-arch-image-base
push: ${{ inputs.push_option }}
tags: quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0-go1.18
#- name: Build and push bcc-s390x
# uses: docker/build-push-action@v3
# with:
# context: .
# file: ./build/Dockerfile.bcc.base.s390x
# platforms: linux/s390x
# push: true
# tags: quay.io/sustainable_computing_io/kepler_base:latest-bcc-s390x
#- name: Create and upload multi-arch image
# run: make multi-arch-image-base
7 changes: 5 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ jobs:
# for each PR run integration test
integration_test_libbpf:
uses: ./.github/workflows/integration_test_libbpf.yml


# base image
base_image:
uses: ./.github/workflows/image_base.yml
with:
push_option: false
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,11 @@ platform-validation: ginkgo-set get-env

check: tidy-vendor set_govulncheck govulncheck format golint test
.PHONY: check

multi-arch-image-base:
$(CTR_CMD) pull --platform=linux/s390x quay.io/sustainable_computing_io/kepler_base:latest-s390x; \
$(CTR_CMD) pull --platform=linux/amd64 quay.io/sustainable_computing_io/kepler_base:latest-amd64; \
$(CTR_CMD) manifest create quay.io/sustainable_computing_io/kepler_base:latest quay.io/sustainable_computing_io/kepler_base:latest-s390x quay.io/sustainable_computing_io/kepler_base:latest-amd64 quay.io/sustainable_computing_io/kepler_base:latest-arm64; \
$(CTR_CMD) manifest annotate --arch s390x quay.io/sustainable_computing_io/kepler_base:latest quay.io/sustainable_computing_io/kepler_base:latest-s390x; \
$(CTR_CMD) push quay.io/sustainable_computing_io/kepler_base:latest
.PHONY: multi-arch-image-base
18 changes: 13 additions & 5 deletions build/Dockerfile.bcc.base
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
FROM docker.io/nvidia/cuda:12.1.1-base-ubi9

ARG ARCH=$(uname -m)

# enable EPEL and install cpuid
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
yum install -y cpuid

# install less frequently updated pkg first
RUN yum install -y kmod xz python3 && yum clean all -y

# bcc pkg is updated more frequently
# enable centos appstream
RUN yum install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/bcc-0.26.0-2.el9.x86_64.rpm && \
yum install -y https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/bcc-devel-0.26.0-2.el9.x86_64.rpm

RUN yum install -y dnf-plugins-core python3-pip
# && \
#yum config-manager --set-enabled powertools

# don't update yet, this will conflict with protected pkg i.e. redhat-release
#RUN yum update -y

# nvidia driver is updated on a (bi)monthly basis
# RUN yum install -y nvidia-driver-NVML nvidia-driver-cuda
# install less frequently updated pkg first
RUN pip3 install --no-cache-dir archspec

# bcc pkg is updated more frequently
RUN yum install -y bcc && yum install -y bcc-devel
23 changes: 0 additions & 23 deletions build/Dockerfile.bcc.base.amd64

This file was deleted.

23 changes: 0 additions & 23 deletions build/Dockerfile.bcc.base.arm64

This file was deleted.

4 changes: 3 additions & 1 deletion build/Dockerfile.bcc.builder
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-bcc-0.26 as builder

LABEL name=kepler-builder

RUN yum install -y kernel-devel make git gcc rpm-build systemd && \
RUN yum install -y make git gcc systemd && \
yum clean all -y

#kernel-devel rpm-build

RUN curl -LO https://go.dev/dl/go1.18.10.linux-amd64.tar.gz; mkdir -p /usr/local; tar -C /usr/local -xvzf go1.18.10.linux-amd64.tar.gz; rm -f go1.18.10.linux-amd64.tar.gz
2 changes: 0 additions & 2 deletions build/Dockerfile.libbpf.base
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#
FROM docker.io/nvidia/cuda:12.1.1-base-ubi9

ARG ARCH=$(uname -m)

# enable EPEL and install cpuid
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
yum install -y cpuid
Expand Down
27 changes: 0 additions & 27 deletions build/Dockerfile.libbpf.base.amd64

This file was deleted.

3 changes: 2 additions & 1 deletion build/Dockerfile.libbpf.builder
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-1.2.0 as builder

LABEL name=kepler-builder

RUN yum install -y make git gcc rpm-build systemd && \
RUN yum install -y make git gcc systemd && \
yum clean all -y
# rpm-build

RUN curl -LO https://go.dev/dl/go1.18.10.linux-amd64.tar.gz; mkdir -p /usr/local; tar -C /usr/local -xvzf go1.18.10.linux-amd64.tar.gz; rm -f go1.18.10.linux-amd64.tar.gz