diff --git a/.github/workflows/image_base.yml b/.github/workflows/image_base.yml index 886d9f3f03..05c20c722c 100644 --- a/.github/workflows/image_base.yml +++ b/.github/workflows/image_base.yml @@ -57,7 +57,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile.builder + file: ./build/Dockerfile.builder platforms: linux/amd64 push: true tags: quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0 diff --git a/Dockerfile.base b/Dockerfile.base deleted file mode 100644 index f684ffb101..0000000000 --- a/Dockerfile.base +++ /dev/null @@ -1,33 +0,0 @@ -FROM registry.access.redhat.com/ubi9/go-toolset:1.20 as builder - -USER 0 - -RUN yum -y install yum-utils -RUN yum-config-manager --enable ubi-9-baseos-source - -WORKDIR /elfutils-source -RUN yumdownloader --source elfutils -RUN yum -y install cpio -RUN rpm2cpio elfutils-0.189-3.el9.src.rpm | cpio -iv -RUN tar xjvf elfutils-0.189.tar.bz2 -WORKDIR /elfutils-source/elfutils-0.189 -RUN ./configure --disable-debuginfod -RUN make install - - -WORKDIR /libbpf-source -RUN yumdownloader --source libbpf -RUN rpm2cpio libbpf-1.2.0-1.el9.src.rpm | cpio -iv -RUN tar xf ./linux-*el9.tar.xz -WORKDIR /libbpf-source/linux-5.14.0-333.el9/tools/lib/bpf -RUN make install_headers -RUN prefix=/usr BUILD_STATIC_ONLY=y make install -WORKDIR /libbpf-source/linux-5.14.0-333.el9/tools/bpf -RUN make bpftool - -RUN yum -y install clang - -# enable EPEL and install cpuid -RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -RUN yum install -y cpuid -RUN yum clean all diff --git a/Makefile b/Makefile index 49c99837fa..f3bc9172e2 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ VERSION ?= $(GIT_VERSION) LDFLAGS := "-w -s -X 'github.com/sustainable-computing-io/kepler/pkg/version.Version=$(VERSION)'" ROOTLESS ?= false IMAGE_REPO ?= quay.io/sustainable_computing_io -BUILDER_IMAGE ?= quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0-go1.18 +BUILDER_IMAGE ?= quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0 IMAGE_NAME ?= kepler IMAGE_TAG ?= latest CTR_CMD ?= $(or $(shell which podman 2>/dev/null), $(shell which docker 2>/dev/null)) @@ -44,75 +44,15 @@ GOOS := $(shell go env GOOS) GOARCH := $(shell go env GOARCH) GOENV := GOOS=$(GOOS) GOARCH=$(GOARCH) -ifdef ATTACHER_TAG - ATTACHER_TAG := $(ATTACHER_TAG) - ifeq ($(ATTACHER_TAG),libbpf) - LIBBPF_HEADERS := /usr/include/bpf - KEPLER_OBJ_SRC := $(SRC_ROOT)/bpfassets/libbpf/bpf.o/$(GOARCH)_kepler.bpf.o - LIBBPF_OBJ ?= /usr/lib64/libbpf.a - endif -else -# auto determine - BCC_TAG := - LIBBPF_TAG := - - ifneq ($(shell command -v ldconfig),) - ifneq ($(shell ldconfig -p|grep bcc),) - BCC_TAG = bcc - endif - endif - - ifneq ($(shell command -v dpkg),) - ifneq ($(shell dpkg -l|grep bcc),) - BCC_TAG = bcc - endif - endif - - ifneq ($(shell command -v ldconfig),) - ifneq ($(shell ldconfig -p|grep libbpf),) - LIBBPF_TAG = libbpf - endif - endif - - ifneq ($(shell command -v dpkg),) - ifneq ($(shell dpkg -l|grep libbpf-dev),) - LIBBPF_TAG = libbpf - endif - endif - - LIBBPF_HEADERS := /usr/include/bpf - KEPLER_OBJ_SRC := $(SRC_ROOT)/bpfassets/libbpf/bpf.o/$(GOARCH)_kepler.bpf.o - LIBBPF_OBJ := /usr/lib/$(ARCH)-linux-gnu/libbpf.a - -# for libbpf tag, if libbpf.a, kepler.bpf.o exist, clear bcc tag - ifneq ($(LIBBPF_TAG),) - ifneq ($(wildcard $(LIBBPF_OBJ)),) - ifneq ($(wildcard $(KEPLER_OBJ_SRC)),) - BCC_TAG = - endif - endif - endif -# if bcc tag is not clear, clear libbpf tag - ifneq ($(BCC_TAG),) - LIBBPF_TAG = - endif - ATTACHER_TAG := $(BCC_TAG)$(LIBBPF_TAG) -endif +LIBBPF_HEADERS := /usr/include/bpf +KEPLER_OBJ_SRC := $(SRC_ROOT)/bpfassets/libbpf/bpf.o/$(GOARCH)_kepler.bpf.o +LIBBPF_OBJ ?= /usr/lib64/libbpf.a -# if libbpf tag is not empty, update goenv -ifeq ($(ATTACHER_TAG),libbpf) - GOENV = GO111MODULE="" GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 CC=clang CGO_CFLAGS="-I $(LIBBPF_HEADERS)" CGO_LDFLAGS="$(LIBBPF_OBJ)" -endif +GOENV = GO111MODULE="" GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 CC=clang CGO_CFLAGS="-I $(LIBBPF_HEADERS)" CGO_LDFLAGS="$(LIBBPF_OBJ)" -ifneq ($(ATTACHER_TAG),) - DOCKERFILE := $(SRC_ROOT)/build/Dockerfile.$(ATTACHER_TAG).kepler - IMAGE_BUILD_TAG := $(SOURCE_GIT_TAG)-linux-$(GOARCH)-$(ATTACHER_TAG) - GO_BUILD_TAGS := $(GENERAL_TAGS)'$(ATTACHER_TAG) '$(GOOS) -else - DOCKERFILE := $(SRC_ROOT)/build/Dockerfile - IMAGE_BUILD_TAG := $(SOURCE_GIT_TAG)-linux-$(GOARCH) - GO_BUILD_TAGS := $(GENERAL_TAGS)$(GOOS) -endif +DOCKERFILE := $(SRC_ROOT)/build/Dockerfile +IMAGE_BUILD_TAG := $(SOURCE_GIT_TAG)-linux-$(GOARCH) +GO_BUILD_TAGS := $(GENERAL_TAGS)$(GOOS) # for testsuite ENVTEST_ASSETS_DIR=$(SRC_ROOT)/test-bin @@ -142,7 +82,7 @@ clean: clean-cross-build .PHONY: clean ### build container ### -build_containerized: genbpfassets tidy-vendor format +build_containerized: tidy-vendor format @if [ -z '$(CTR_CMD)' ] ; then echo '!! ERROR: containerized builds require podman||docker CLI, none found $$PATH' >&2 && exit 1; fi echo BIN_TIMESTAMP==$(BIN_TIMESTAMP) @@ -228,15 +168,15 @@ clean_build_local: copy_build_local: cp $(CROSS_BUILD_BINDIR)/$(GOOS)_$(GOARCH)/kepler $(CROSS_BUILD_BINDIR) -cross-build-linux-amd64: genbpfassets +cross-build-linux-amd64: +$(MAKE) _build_local GOOS=linux GOARCH=amd64 .PHONY: cross-build-linux-amd64 -cross-build-linux-arm64: genbpfassets +cross-build-linux-arm64: +$(MAKE) _build_local GOOS=linux GOARCH=arm64 .PHONY: cross-build-linux-arm64 -cross-build-linux-s390x: genbpfassets +cross-build-linux-s390x: +$(MAKE) _build_local GOOS=linux GOARCH=s390x .PHONY: cross-build-linux-s390x @@ -306,11 +246,6 @@ golint: golangci/golangci-lint \ golangci-lint run --verbose -genbpfassets: - GO111MODULE=off go get -u github.com/go-bindata/go-bindata/... - ./hack/bindata.sh -.PHONY: genbpfassets - genlibbpf: kepler.bpf.o diff --git a/build/Dockerfile b/build/Dockerfile index 3a7fd154db..85f49ad7b2 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,7 @@ # # This Dockerfile is used for building the kepler default image: Dockerfile.bcc.kepler # -FROM quay.io/sustainable_computing_io/kepler_builder:ubi-9-bcc-0.26-go1.18 as builder +FROM quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0 as builder ARG BIN_TIMESTAMP ARG SOURCE_GIT_TAG diff --git a/build/Dockerfile.bcc.base b/build/Dockerfile.bcc.base deleted file mode 100644 index ec58c786d4..0000000000 --- a/build/Dockerfile.bcc.base +++ /dev/null @@ -1,27 +0,0 @@ -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 -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 - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y - -# nvidia driver is updated on a (bi)monthly basis -# RUN yum install -y nvidia-driver-NVML nvidia-driver-cuda diff --git a/build/Dockerfile.bcc.base.amd64 b/build/Dockerfile.bcc.base.amd64 deleted file mode 100644 index 5b88ee632c..0000000000 --- a/build/Dockerfile.bcc.base.amd64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM --platform=linux/amd64 docker.io/nvidia/cuda:12.1.0-base-ubi8 - -ARG ARCH=amd64 - -# enable centos appstream -RUN yum install -y http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/centos-gpg-keys-8-6.el8.noarch.rpm && \ - yum install -y http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/centos-stream-repos-8-6.el8.noarch.rpm - -RUN yum install -y dnf-plugins-core && \ - yum config-manager --set-enabled powertools - - -# don't update yet, this will conflict with protected pkg i.e. redhat-release -#RUN yum update -y - -# install less frequently updated pkg first -RUN yum install -y kmod xz python3 && yum clean all -y && \ - pip3 install --no-cache-dir archspec - -# bcc pkg is updated more frequently -RUN yum install -y bcc-0.24.0 && yum install -y bcc-devel-0.24.0 - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y - \ No newline at end of file diff --git a/build/Dockerfile.bcc.base.arm64 b/build/Dockerfile.bcc.base.arm64 deleted file mode 100644 index de56b98dad..0000000000 --- a/build/Dockerfile.bcc.base.arm64 +++ /dev/null @@ -1,31 +0,0 @@ -FROM --platform=linux/arm64 docker.io/nvidia/cuda:12.1.0-base-ubi8 - -ARG ARCH=aarch64 - -# enable centos appstream -RUN yum install -y http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/centos-gpg-keys-8-6.el8.noarch.rpm && \ - yum install -y http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/centos-stream-repos-8-6.el8.noarch.rpm - -RUN yum install -y dnf-plugins-core && \ - yum config-manager --set-enabled powertools - - -# don't update yet, this will conflict with protected pkg i.e. redhat-release -#RUN yum update -y - -# install less frequently updated pkg first -RUN yum install -y kmod xz python3 && yum clean all -y && \ - pip3 install --no-cache-dir archspec - -# bcc pkg is updated more frequently -RUN yum install -y bcc-0.24.0 && yum install -y bcc-devel-0.24.0 - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y \ No newline at end of file diff --git a/build/Dockerfile.bcc.base.s390x b/build/Dockerfile.bcc.base.s390x deleted file mode 100644 index 397cd2d0e8..0000000000 --- a/build/Dockerfile.bcc.base.s390x +++ /dev/null @@ -1,32 +0,0 @@ -FROM --platform=linux/s390x registry.access.redhat.com/ubi9/ubi:9.1 - -ARG ARCH=s390x - -RUN yum install -y https://mirror.stream.centos.org/9-stream/BaseOS/s390x/os/Packages/centos-gpg-keys-9.0-20.el9.noarch.rpm && \ - yum install -y https://mirror.stream.centos.org/9-stream/BaseOS/s390x/os/Packages/centos-stream-repos-9.0-20.el9.noarch.rpm - -# don't update yet, this will conflict with protected pkg i.e. redhat-release -#RUN yum update -y - -RUN yum install -y kmod xz && yum clean all -y - -RUN dnf -y install dnf-plugins-core && \ - dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - dnf config-manager --set-enabled crb - -# bcc pkg is updated more frequently -RUN yum install -y bcc && yum install -y bcc-devel - -# install less frequently updated python3 pkg and archspec -RUN yum install -y python3 python3-pip && yum clean all -y && \ - pip3 install --no-cache-dir archspec - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y diff --git a/build/Dockerfile.bcc.builder b/build/Dockerfile.bcc.builder deleted file mode 100644 index 4932b0466d..0000000000 --- a/build/Dockerfile.bcc.builder +++ /dev/null @@ -1,10 +0,0 @@ -FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-bcc-0.26 as builder - -#USER root - -LABEL name=kepler-builder - -RUN yum install -y kernel-devel make git gcc rpm-build systemd && \ - yum clean all -y - -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 diff --git a/build/Dockerfile.bcc.kepler b/build/Dockerfile.bcc.kepler deleted file mode 100644 index 6ac80b9a8c..0000000000 --- a/build/Dockerfile.bcc.kepler +++ /dev/null @@ -1,43 +0,0 @@ -FROM quay.io/sustainable_computing_io/kepler_builder:ubi-9-bcc-0.26-go1.18 as builder - -ARG BIN_TIMESTAMP -ARG SOURCE_GIT_TAG - -LABEL name=kepler-builder - -ENV GOPATH=/opt/app-root GO111MODULE=off GOROOT=/usr/local/go - -ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH - -# Set GOCACHE environment variable for caching -ENV GOCACHE=/go/cache - -WORKDIR $GOPATH/src/github.com/sustainable-computing-io/kepler - -COPY . . -RUN mkdir -p data -# Build kepler with caching to speed up the process -RUN make build SOURCE_GIT_TAG=$SOURCE_GIT_TAG BIN_TIMESTAMP=$BIN_TIMESTAMP -RUN ls ./_output/bin -# RUN make test - -# build image -FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-bcc-0.26 - -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/_output/bin/kepler /usr/bin/kepler - -RUN mkdir -p /var/lib/kepler/data -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/cpus.yaml /var/lib/kepler/data/cpus.yaml - -# copy model weight -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/acpi_AbsPowerModel.json /var/lib/kepler/data/acpi_AbsPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/acpi_DynPowerModel.json /var/lib/kepler/data/acpi_DynPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/rapl_AbsPowerModel.json /var/lib/kepler/data/rapl_AbsPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/rapl_DynPowerModel.json /var/lib/kepler/data/rapl_DynPowerModel.json - -# pre install kernel sources -RUN mkdir -p /usr/share/kepler/kernel_sources - -COPY --from=quay.io/sustainable_computing_io/kepler_kernel_source_images:ubi9 /usr/src/kernels /usr/share/kepler/kernel_sources - -ENTRYPOINT ["/usr/bin/kepler"] diff --git a/build/Dockerfile.libbpf.base b/build/Dockerfile.libbpf.base deleted file mode 100644 index 9934955113..0000000000 --- a/build/Dockerfile.libbpf.base +++ /dev/null @@ -1,36 +0,0 @@ -# -# This Dockerfile is used for building the image `quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-0.5` -# -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 - -# dependencies for libbpf -RUN yum install -y https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/elfutils-libelf-0.188-3.el9.x86_64.rpm && \ - yum install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/elfutils-libelf-devel-0.188-3.el9.x86_64.rpm && \ - yum install -y clang llvm llvm-devel zlib-devel make libbpf && yum clean all -y - -ENV LIBBPF_VERSION=1.2.0 -RUN curl -LO https://github.com/libbpf/libbpf/archive/refs/tags/v${LIBBPF_VERSION}.tar.gz; mkdir -p /usr/local; \ - tar -C /usr/local -xvzf v${LIBBPF_VERSION}.tar.gz; rm -f v${LIBBPF_VERSION}.tar.gz; \ - cd /usr/local/libbpf-${LIBBPF_VERSION}/src && OBJDIR=/usr/lib/$(uname -m)-linux-gnu make BUILD_STATIC_ONLY=y install install_uapi_headers - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y -# nvidia driver is updated on a (bi)monthly basis -# RUN yum install -y nvidia-driver-NVML nvidia-driver-cuda - diff --git a/build/Dockerfile.libbpf.base.amd64 b/build/Dockerfile.libbpf.base.amd64 deleted file mode 100644 index a4c7a22e37..0000000000 --- a/build/Dockerfile.libbpf.base.amd64 +++ /dev/null @@ -1,37 +0,0 @@ -# -# This Dockerfile is used for building the image `quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-0.5` for amd64 -# -FROM --platform=linux/amd64 docker.io/nvidia/cuda:12.1.1-base-ubi9 - -ARG ARCH=amd64 - -# 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 - -# dependencies for libbpf -RUN yum install -y https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/elfutils-libelf-0.188-3.el9.x86_64.rpm && \ - yum install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/elfutils-libelf-devel-0.188-3.el9.x86_64.rpm && \ - yum install -y clang llvm llvm-devel zlib-devel make libbpf && yum clean all -y - -ENV LIBBPF_VERSION=1.2.0 -RUN curl -LO https://github.com/libbpf/libbpf/archive/refs/tags/v${LIBBPF_VERSION}.tar.gz; mkdir -p /usr/local; \ - tar -C /usr/local -xvzf v${LIBBPF_VERSION}.tar.gz; rm -f v${LIBBPF_VERSION}.tar.gz; \ - cd /usr/local/libbpf-${LIBBPF_VERSION}/src && OBJDIR=/usr/lib/$(uname -m)-linux-gnu make BUILD_STATIC_ONLY=y install install_uapi_headers - -# install xgboost library -ENV XGBOOST_VERSION=v2.0.1 -ENV nproc=8 -RUN yum install cmake git gcc gcc-c++ -y; \ - git clone --recursive https://github.com/dmlc/xgboost; \ - cd xgboost; git checkout tags/${XGBOOST_VERSION}; \ - mkdir build; cd build; cmake ..; make -j$(nproc); make install; \ - echo "/usr/local/lib64" > /etc/ld.so.conf.d/xgboost.conf; ldconfig; ldconfig -p | grep xgboost; \ - yum remove cmake git gcc gcc-c++ -y - -# nvidia driver is updated on a (bi)monthly basis -# RUN yum install -y nvidia-driver-NVML nvidia-driver-cuda - diff --git a/build/Dockerfile.libbpf.builder b/build/Dockerfile.libbpf.builder deleted file mode 100644 index 71f67f61fb..0000000000 --- a/build/Dockerfile.libbpf.builder +++ /dev/null @@ -1,13 +0,0 @@ -# -# This Dockerfile is used for building the image `quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-0.5-go1.18` -# -FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-1.2.0 as builder - -#USER root - -LABEL name=kepler-builder - -RUN yum install -y make git gcc rpm-build systemd && \ - yum clean all -y - -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 diff --git a/build/Dockerfile.libbpf.kepler b/build/Dockerfile.libbpf.kepler deleted file mode 100644 index ae336ccbf4..0000000000 --- a/build/Dockerfile.libbpf.kepler +++ /dev/null @@ -1,39 +0,0 @@ -# -# This Dockerfile is used for building the image `quay.io/sustainable_computing_io/kepler` -# -FROM quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.2.0-go1.18 as builder - -ARG BIN_TIMESTAMP -ARG SOURCE_GIT_TAG - -LABEL name=kepler-builder - -ENV GOPATH=/opt/app-root GO111MODULE=off GOROOT=/usr/local/go - -ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH - -WORKDIR $GOPATH/src/github.com/sustainable-computing-io/kepler - -COPY . . -RUN mkdir -p data -# Build kepler -RUN make build SOURCE_GIT_TAG=$SOURCE_GIT_TAG BIN_TIMESTAMP=$BIN_TIMESTAMP -RUN ls ./_output/bin -# RUN make test - -# build image -FROM quay.io/sustainable_computing_io/kepler_base:ubi-9-libbpf-1.2.0 - -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/_output/bin/kepler /usr/bin/kepler - -RUN mkdir -p /var/lib/kepler/data -RUN mkdir -p /var/lib/kepler/bpfassets -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/cpus.yaml /var/lib/kepler/data/cpus.yaml -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/bpfassets/libbpf/bpf.o /var/lib/kepler/bpfassets - -# copy model weight -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/acpi_AbsPowerModel.json /var/lib/kepler/data/acpi_AbsPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/acpi_DynPowerModel.json /var/lib/kepler/data/acpi_DynPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/rapl_AbsPowerModel.json /var/lib/kepler/data/rapl_AbsPowerModel.json -COPY --from=builder /opt/app-root/src/github.com/sustainable-computing-io/kepler/data/model_weight/rapl_DynPowerModel.json /var/lib/kepler/data/rapl_DynPowerModel.json -ENTRYPOINT ["/usr/bin/kepler"] diff --git a/build/kernel-source-images/Dockerfile.ubi b/build/kernel-source-images/Dockerfile.ubi deleted file mode 100644 index 1877625d3e..0000000000 --- a/build/kernel-source-images/Dockerfile.ubi +++ /dev/null @@ -1,4 +0,0 @@ -FROM ImageName - -ARG ARCH=amd64 -RUN yum install -y kernel-devel \ No newline at end of file diff --git a/build/kernel-source-images/build-kernel-source-images.sh b/build/kernel-source-images/build-kernel-source-images.sh deleted file mode 100644 index 0ac163286d..0000000000 --- a/build/kernel-source-images/build-kernel-source-images.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -x -IMAGE_BASE="quay.io/sustainable_computing_io/kepler_kernel_source_images" -for i in "8" "9"; do - Image="registry.access.redhat.com/ubi${i}/ubi" - echo "Building $i" - # podman doesn't support --build-arg - # replace ImageName with the actual image name using sed - sed "s|ImageName|${Image}|g" Dockerfile.ubi > Dockerfile.ubi.${i} - - docker build --build-arg ImageName=${Image} -t ${IMAGE_BASE}:ubi${i} -f Dockerfile.ubi.${i} . - docker push ${IMAGE_BASE}:ubi${i} - rm Dockerfile.ubi.${i} -done