From e82e824f0824464313f95792e092000222bf4174 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 24 Jun 2024 11:41:27 -0700 Subject: [PATCH 01/22] util-docker: Breakup long (>79 char) lines in docker-bake Change-Id: I5488301543bfff21279b6c0b1aae841574efee95 --- util/dockerfiles/docker-bake.hcl | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index b96e44d921..892075c7d0 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -40,15 +40,34 @@ variable "TAG" { # `docker buildx bake --push ubuntu-20-04_all-dependencies` or # `docker buildx bake --push ubuntu-releases`. group "default" { - targets=["clang-compilers", "ubuntu-releases", "gcc-compilers", "gcn-gpu", "gpu-fs", "sst", "systemc", "llvm-gnu-cross-compiler-riscv64", "gem5-all-min-dependencies"] + targets=[ + "clang-compilers", + "ubuntu-releases", + "gcc-compilers", + "gcn-gpu", + "gpu-fs", + "sst", + "systemc", + "llvm-gnu-cross-compiler-riscv64", + "gem5-all-min-dependencies" + ] } group "ubuntu-releases" { - targets=["ubuntu-24-04_all-dependencies", "ubuntu-22-04_all-dependencies", "ubuntu-20-04_all-dependencies", "ubuntu-24-04_min-dependencies"] + targets=[ + "ubuntu-24-04_all-dependencies", + "ubuntu-22-04_all-dependencies", + "ubuntu-20-04_all-dependencies", + "ubuntu-24-04_min-dependencies" + ] } group "clang-compilers" { - targets = ["clang-compilers-base-20-04", "clang-compilers-base-22-04", "clang-compilers-16"] + targets = [ + "clang-compilers-base-20-04", + "clang-compilers-base-22-04", + "clang-compilers-16" + ] } group "gcc-compilers" { From c2916788819da2ba2126edeb368878764f8ccc81 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 24 Jun 2024 11:43:23 -0700 Subject: [PATCH 02/22] util-docker: Fix docker-bake.hcl sst context The context for sst is the "sst" directory. Change-Id: Ic120cca13a9e4df02b98d101ad8e16c296807c2d --- util/dockerfiles/docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 892075c7d0..7a2e0c5b8a 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -98,7 +98,7 @@ target "gpu-fs" { target "sst" { inherits = ["common"] dockerfile = "Dockerfile" - context = "sst-11.1.0" + context = "sst" tags = ["${IMAGE_URI}/sst-env:${TAG}"] } From e03a20bdb44f4d05cc2445d7d0adac4c78be3b7e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 24 Jun 2024 11:46:45 -0700 Subject: [PATCH 03/22] util-docker: Remove version from systemc Docker context This simplifies things slightly. Change-Id: I1263e385f7adeb2b83cdc09f7f6903be9193c467 --- util/dockerfiles/docker-bake.hcl | 2 +- util/dockerfiles/{systemc-2.3.3 => systemc}/Dockerfile | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename util/dockerfiles/{systemc-2.3.3 => systemc}/Dockerfile (100%) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 7a2e0c5b8a..4cce9c737a 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -105,7 +105,7 @@ target "sst" { target "systemc" { inherits = ["common"] dockerfile = "Dockerfile" - context = "systemc-2.3.3" + context = "systemc" tags = ["${IMAGE_URI}/systemc-env:${TAG}"] } diff --git a/util/dockerfiles/systemc-2.3.3/Dockerfile b/util/dockerfiles/systemc/Dockerfile similarity index 100% rename from util/dockerfiles/systemc-2.3.3/Dockerfile rename to util/dockerfiles/systemc/Dockerfile From a1eefb6ed87999d34fce94d39f5007667019e540 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 24 Jun 2024 12:01:21 -0700 Subject: [PATCH 04/22] util-docker: Remove old/unsed/unecessary Dockerfiles * Unsupported compilers. * Unsed cross compilers. * The gem5-all-min-deps image. Change-Id: Iaab64e5e6685b0a538c38b2979fae86f01bc53e8 --- util/dockerfiles/docker-bake.hcl | 22 +----- .../gem5-all-min-dependencies/Dockerfile | 36 ---------- .../Dockerfile | 72 ------------------- 3 files changed, 3 insertions(+), 127 deletions(-) delete mode 100644 util/dockerfiles/gem5-all-min-dependencies/Dockerfile delete mode 100644 util/dockerfiles/llvm-gnu-cross-compiler-riscv64/Dockerfile diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 4cce9c737a..ac3a0e85a5 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -47,9 +47,7 @@ group "default" { "gcn-gpu", "gpu-fs", "sst", - "systemc", - "llvm-gnu-cross-compiler-riscv64", - "gem5-all-min-dependencies" + "systemc" ] } @@ -151,7 +149,7 @@ target "gcc-compilers-base-20-04" { context = "ubuntu-20.04_gcc-version" dockerfile = "Dockerfile" matrix = { - ver = ["8", "9", "10"] + ver = ["10"] } args = { version = ver @@ -165,7 +163,7 @@ target "gcc-compilers-base-22-04" { context = "ubuntu-22.04_gcc-version" dockerfile = "Dockerfile" matrix = { - ver = ["11", "12"] + ver = ["11", "12", "13'"] } args = { version = ver @@ -207,17 +205,3 @@ target "clang-compilers-16" { context = "ubuntu-22.04_clang_16" tags = ["${IMAGE_URI}/clang-version-16:${TAG}"] } - -target "llvm-gnu-cross-compiler-riscv64" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "llvm-gnu-cross-compiler-riscv64" - tags = ["${IMAGE_URI}/llvm-gnu-cross-compiler-riscv64:${TAG}"] -} - -target "gem5-all-min-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "gem5-all-min-dependencies" - tags = ["${IMAGE_URI}/gem5-all-min-dependencies:${TAG}"] -} diff --git a/util/dockerfiles/gem5-all-min-dependencies/Dockerfile b/util/dockerfiles/gem5-all-min-dependencies/Dockerfile deleted file mode 100644 index cb73ab0bce..0000000000 --- a/util/dockerfiles/gem5-all-min-dependencies/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2022 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-22.04_min-dependencies:latest as source -RUN apt -y update && apt -y install git -RUN git clone -b develop https://github.com/gem5/gem5/ /gem5 -WORKDIR /gem5 -RUN scons -j`nproc` build/ALL/gem5.fast - -FROM ghcr.io/gem5/ubuntu-22.04_min-dependencies:latest -COPY --from=source /gem5/build/ALL/gem5.fast /usr/local/bin/gem5 - -ENTRYPOINT [ "/usr/local/bin/gem5" ] diff --git a/util/dockerfiles/llvm-gnu-cross-compiler-riscv64/Dockerfile b/util/dockerfiles/llvm-gnu-cross-compiler-riscv64/Dockerfile deleted file mode 100644 index cc84f3d45a..0000000000 --- a/util/dockerfiles/llvm-gnu-cross-compiler-riscv64/Dockerfile +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2022 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -# stage 1: download the dependencies -FROM --platform=${BUILDPLATFORM} ubuntu:20.04 AS stage1 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && apt -y install \ - binutils build-essential libtool texinfo gzip zip unzip patchutils curl git \ - make cmake ninja-build automake bison flex gperf grep sed gawk bc \ - zlib1g-dev libexpat1-dev libmpc-dev libglib2.0-dev libfdt-dev libpixman-1-dev - -# stage 2: download the compilers and compile them -FROM stage1 AS stage2 -RUN mkdir -p /riscv/_install -WORKDIR /riscv -ENV PATH=`/riscv/_install/bin:$PATH` -RUN git clone https://github.com/riscv/riscv-gnu-toolchain -WORKDIR /riscv/riscv-gnu-toolchain -RUN git checkout 051b9f7ddb7d136777505ea19c70a41926842b96 -RUN git submodule update --init --recursive -RUN ./configure --prefix=/riscv/_install --enable-multilib -RUN make linux -j`nproc` -RUN make install - -WORKDIR /riscv -RUN git clone https://github.com/llvm/llvm-project.git riscv-llvm -WORKDIR /riscv/riscv-llvm -RUN git checkout 2ef95efb414e215490a222de05cafdffb8054758 -RUN ln -s ../../clang llvm/tools || true -RUN mkdir _build -WORKDIR /riscv/riscv-llvm/_build -RUN cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" \ - -DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True \ - -DCMAKE_INSTALL_PREFIX="/riscv/_install" \ - -DLLVM_OPTIMIZED_TABLEGEN=True -DLLVM_BUILD_TESTS=False \ - -DDEFAULT_SYSROOT="/riscv/_install/sysroot" \ - -DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-linux-gnu" \ - -DLLVM_TARGETS_TO_BUILD="RISCV" \ - ../llvm -RUN cmake --build . --target install -j`nproc` - -# stage 3: create a new container with the compiled cross-compilers only -FROM stage1 - -RUN mkdir -p /riscv/ -COPY --from=stage2 /riscv/_install/ /riscv/_install -ENV PATH=/riscv/_install/bin:$PATH From 9d635dea550b77aae2e6dbe42695bf94d6eb9129 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 11:16:52 -0700 Subject: [PATCH 05/22] util-docker: Improve Docker gcc and clang builder 1. Uses the all-dependencies image as the base image. 2. Has all compilers use Ubuntu 24.04. Notes: This change implitly changes our supported compilers to GCC v10 to v13 and Clang v14 to v18. This will be fully incorporated into the project later. Change-Id: Id8e2141ea64a34c7e3532605f6ecb7d9ccb76951 --- util/dockerfiles/clang-compiler/Dockerfile | 14 ++ util/dockerfiles/docker-bake.hcl | 202 ++++++++++-------- util/dockerfiles/gcc-compiler/Dockerfile | 14 ++ .../ubuntu-20.04_clang-version/Dockerfile | 57 ----- .../ubuntu-20.04_gcc-version/Dockerfile | 49 ----- .../ubuntu-22.04_clang-16/Dockerfile | 49 ----- .../dockerfiles/ubuntu-22.04_clang-16/llvm.sh | 176 --------------- .../ubuntu-22.04_clang-version/Dockerfile | 49 ----- .../ubuntu-22.04_gcc-version/Dockerfile | 48 ----- .../ubuntu-22.04_gcc_13-version/Dockerfile | 53 ----- 10 files changed, 146 insertions(+), 565 deletions(-) create mode 100644 util/dockerfiles/clang-compiler/Dockerfile create mode 100644 util/dockerfiles/gcc-compiler/Dockerfile delete mode 100644 util/dockerfiles/ubuntu-20.04_clang-version/Dockerfile delete mode 100644 util/dockerfiles/ubuntu-20.04_gcc-version/Dockerfile delete mode 100644 util/dockerfiles/ubuntu-22.04_clang-16/Dockerfile delete mode 100755 util/dockerfiles/ubuntu-22.04_clang-16/llvm.sh delete mode 100644 util/dockerfiles/ubuntu-22.04_clang-version/Dockerfile delete mode 100644 util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile delete mode 100644 util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile diff --git a/util/dockerfiles/clang-compiler/Dockerfile b/util/dockerfiles/clang-compiler/Dockerfile new file mode 100644 index 0000000000..17718e9fb6 --- /dev/null +++ b/util/dockerfiles/clang-compiler/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest + +ARG version=16 # Version of Clang to install in this image. Default is 16. + +RUN apt -y update && \ + apt -y install clang-${version} && \ + update-alternatives --install \ + /usr/bin/clang++ clang++ /usr/bin/clang++-${version} 100 && \ + update-alternatives --install \ + /usr/bin/clang clang /usr/bin/clang-${version} 100 && \ + update-alternatives --install \ + /usr/bin/c++ c++ /usr/bin/clang++-${version} 100 && \ + update-alternatives --install \ + /usr/bin/cc cc /usr/bin/clang-${version} 100 diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index ac3a0e85a5..7edcd8d447 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -35,6 +35,13 @@ variable "TAG" { default = "bootcamp-2024" } +# Common attributes across all targets. Note: these can be overwritten. +target "common" { + # Here we are enabling multi-platform builds. We are compiling to both ARM + # amd X86. + platforms = ["linux/amd64", "linux/arm64", "linux/riscv64"] +} + # A group of targets to be built. Note: groups can contain other groups. # Any target or group can be build individually. I.e.: # `docker buildx bake --push ubuntu-20-04_all-dependencies` or @@ -42,8 +49,8 @@ variable "TAG" { group "default" { targets=[ "clang-compilers", - "ubuntu-releases", "gcc-compilers", + "ubuntu-releases", "gcn-gpu", "gpu-fs", "sst", @@ -51,6 +58,115 @@ group "default" { ] } +group "clang-compilers" { + targets = [ + "clang-version-14", + "clang-version-15", + "clang-version-16", + "clang-version-17", + "clang-version-18" + ] +} + +target "clang-version-14" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "14" + } + context = "clang-compiler" + tags = ["${IMAGE_URI}/clang-version-14:${TAG}"] +} + +target "clang-version-15" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "15" + } + context = "clang-compiler" + tags = ["${IMAGE_URI}/clang-version-15:${TAG}"] +} + +target "clang-version-16" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "16" + } + context = "clang-compiler" + tags = ["${IMAGE_URI}/clang-version-16:${TAG}"] +} + +target "clang-version-17" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "17" + } + context = "clang-compiler" + tags = ["${IMAGE_URI}/clang-version-17:${TAG}"] +} + +target "clang-version-18" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "18" + } + context = "clang-compiler" + tags = ["${IMAGE_URI}/clang-version-18:${TAG}"] +} + +group "gcc-compilers" { + targets = [ + "gcc-version-10", + "gcc-version-11", + "gcc-version-12", + "gcc-version-13" + ] +} + +target "gcc-version-10" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "10" + } + context = "gcc-compiler" + tags = ["${IMAGE_URI}/gcc-version-10:${TAG}"] +} + +target "gcc-version-11" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "11" + } + context = "gcc-compiler" + tags = ["${IMAGE_URI}/gcc-version-11:${TAG}"] +} + +target "gcc-version-12" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "12" + } + context = "gcc-compiler" + tags = ["${IMAGE_URI}/gcc-version-12:${TAG}"] +} + +target "gcc-version-13" { + inherits = ["common"] + dockerfile = "Dockerfile" + args = { + version = "13" + } + context = "gcc-compiler" + tags = ["${IMAGE_URI}/gcc-version-13:${TAG}"] +} + group "ubuntu-releases" { targets=[ "ubuntu-24-04_all-dependencies", @@ -60,25 +176,6 @@ group "ubuntu-releases" { ] } -group "clang-compilers" { - targets = [ - "clang-compilers-base-20-04", - "clang-compilers-base-22-04", - "clang-compilers-16" - ] -} - -group "gcc-compilers" { - targets = ["gcc-compilers-base-20-04", "gcc-compilers-base-22-04"] -} - -# Common attributes across all targets. Note: these can be overwritten. -target "common" { - # Here we are enabling multi-platform builds. We are compiling to both ARM - # amd X86. - platforms = ["linux/amd64", "linux/arm64", "linux/riscv64"] -} - target "gcn-gpu" { inherits = ["common"] dockerfile = "Dockerfile" @@ -141,67 +238,4 @@ target "ubuntu-24-04_min-dependencies" { dockerfile = "Dockerfile" context = "ubuntu-24.04_min-dependencies" tags = ["${IMAGE_URI}/ubuntu-24.04_min-dependencies:${TAG}"] -} - -target "gcc-compilers-base-20-04" { - name = "gcc-compilers-${replace(ver, ".", "-")}" - inherits = ["common"] - context = "ubuntu-20.04_gcc-version" - dockerfile = "Dockerfile" - matrix = { - ver = ["10"] - } - args = { - version = ver - } - tags = ["${IMAGE_URI}/gcc-version-${ver}:${TAG}"] -} - -target "gcc-compilers-base-22-04" { - name = "gcc-compilers-${replace(ver, ".", "-")}" - inherits = ["common"] - context = "ubuntu-22.04_gcc-version" - dockerfile = "Dockerfile" - matrix = { - ver = ["11", "12", "13'"] - } - args = { - version = ver - } - tags = ["${IMAGE_URI}/gcc-version-${ver}:${TAG}"] -} - -target "clang-compilers-base-20-04" { - name = "clang-compilers-${replace(ver, ".", "-")}" - inherits = ["common"] - context = "ubuntu-20.04_clang-version" - dockerfile = "Dockerfile" - matrix = { - ver = ["10", "11", "12"] - } - args = { - version = ver - } - tags = ["${IMAGE_URI}/clang-version-${ver}:${TAG}"] -} - -target "clang-compilers-base-22-04" { - name = "clang-compilers-${replace(ver, ".", "-")}" - inherits = ["common"] - context = "ubuntu-22.04_clang-version" - dockerfile = "Dockerfile" - matrix = { - ver = ["13", "14", "15"] - } - args = { - version = ver - } - tags = ["${IMAGE_URI}/clang-version-${ver}:${TAG}"] -} - -target "clang-compilers-16" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-22.04_clang_16" - tags = ["${IMAGE_URI}/clang-version-16:${TAG}"] -} +} \ No newline at end of file diff --git a/util/dockerfiles/gcc-compiler/Dockerfile b/util/dockerfiles/gcc-compiler/Dockerfile new file mode 100644 index 0000000000..797a5d7090 --- /dev/null +++ b/util/dockerfiles/gcc-compiler/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest + +ARG version=13 # Version of GCC to install in this image. Default is 13. + +RUN apt -y update && \ + apt -y install gcc-${version} g++-${version} && \ + update-alternatives --install \ + /usr/bin/g++ g++ /usr/bin/g++-${version} 100 && \ + update-alternatives --install \ + /usr/bin/gcc gcc /usr/bin/gcc-${version} 100 && \ + update-alternatives --install \ + /usr/bin/c++ c++ /usr/bin/g++-${version} 100 && \ + update-alternatives --install \ + /usr/bin/cc cc /usr/bin/gcc-${version} 100 diff --git a/util/dockerfiles/ubuntu-20.04_clang-version/Dockerfile b/util/dockerfiles/ubuntu-20.04_clang-version/Dockerfile deleted file mode 100644 index 2ea9413c7d..0000000000 --- a/util/dockerfiles/ubuntu-20.04_clang-version/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2021 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:20.04 - -# Valid version values: -# 6.0 -# 7 -# 8 -# 9 -# 10 -# 11 -# 12 -ARG version - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - python-is-python3 doxygen libboost-all-dev libhdf5-serial-dev \ - python3-pydot libpng-dev clang-${version} make \ - # This is needed as clang-8 does not have the libstdc++-10-dev package. - # It is necessary for compilation. - libstdc++-10-dev - -RUN apt-get --purge -y remove gcc - -RUN update-alternatives --install \ - /usr/bin/clang++ clang++ /usr/bin/clang++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/clang clang /usr/bin/clang-${version} 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/clang++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/clang-${version} 100 diff --git a/util/dockerfiles/ubuntu-20.04_gcc-version/Dockerfile b/util/dockerfiles/ubuntu-20.04_gcc-version/Dockerfile deleted file mode 100644 index 7841635aef..0000000000 --- a/util/dockerfiles/ubuntu-20.04_gcc-version/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2020 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:20.04 - -# Valid version values: -# 7 -# 8 -# 9 # Not supported. See: https://github.com/gem5/gem5/issues/555. -# 10 -ARG version - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - python-is-python3 doxygen libboost-all-dev libhdf5-serial-dev \ - python3-pydot libpng-dev gcc-${version} g++-${version} make - -RUN update-alternatives --install \ - /usr/bin/g++ g++ /usr/bin/g++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-${version} 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/g++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/gcc-${version} 100 diff --git a/util/dockerfiles/ubuntu-22.04_clang-16/Dockerfile b/util/dockerfiles/ubuntu-22.04_clang-16/Dockerfile deleted file mode 100644 index 045efbd13a..0000000000 --- a/util/dockerfiles/ubuntu-22.04_clang-16/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2023 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:22.04 - - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - python-is-python3 doxygen libboost-all-dev libhdf5-serial-dev \ - python3-pydot libpng-dev make lsb-release wget \ - software-properties-common gnupg - -COPY llvm.sh /llvm.sh -RUN ./llvm.sh 16 - -RUN apt-get --purge -y remove gcc - -RUN update-alternatives --install \ - /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 -RUN update-alternatives --install \ - /usr/bin/clang clang /usr/bin/clang-16 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/clang++-16 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/clang-16 100 diff --git a/util/dockerfiles/ubuntu-22.04_clang-16/llvm.sh b/util/dockerfiles/ubuntu-22.04_clang-16/llvm.sh deleted file mode 100755 index 200c0390fe..0000000000 --- a/util/dockerfiles/ubuntu-22.04_clang-16/llvm.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash -################################################################################ -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -################################################################################ -# -# This script will install the llvm toolchain on the different -# Debian and Ubuntu versions - -set -eux - -usage() { - set +x - echo "Usage: $0 [llvm_major_version] [all] [OPTIONS]" 1>&2 - echo -e "all\t\t\tInstall all packages." 1>&2 - echo -e "-n=code_name\t\tSpecifies the distro codename, for example bionic" 1>&2 - echo -e "-h\t\t\tPrints this help." 1>&2 - echo -e "-m=repo_base_url\tSpecifies the base URL from which to download." 1>&2 - exit 1; -} - -CURRENT_LLVM_STABLE=17 -BASE_URL="http://apt.llvm.org" - -# Check for required tools -needed_binaries=(lsb_release wget add-apt-repository gpg) -missing_binaries=() -for binary in "${needed_binaries[@]}"; do - if ! which $binary &>/dev/null ; then - missing_binaries+=($binary) - fi -done -if [[ ${#missing_binaries[@]} -gt 0 ]] ; then - echo "You are missing some tools this script requires: ${missing_binaries[@]}" - echo "(hint: apt install lsb-release wget software-properties-common gnupg)" - exit 4 -fi - -# Set default values for commandline arguments -# We default to the current stable branch of LLVM -LLVM_VERSION=$CURRENT_LLVM_STABLE -ALL=0 -DISTRO=$(lsb_release -is) -VERSION=$(lsb_release -sr) -UBUNTU_CODENAME="" -CODENAME_FROM_ARGUMENTS="" -# Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives) -source /etc/os-release -DISTRO=${DISTRO,,} -case ${DISTRO} in - debian) - # Debian Trixie has a workaround because of - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038383 - if [[ "${VERSION}" == "unstable" ]] || [[ "${VERSION}" == "testing" ]] || [[ "${VERSION_CODENAME}" == "trixie" ]]; then - CODENAME=unstable - LINKNAME= - else - # "stable" Debian release - CODENAME=${VERSION_CODENAME} - LINKNAME=-${CODENAME} - fi - ;; - *) - # ubuntu and its derivatives - if [[ -n "${UBUNTU_CODENAME}" ]]; then - CODENAME=${UBUNTU_CODENAME} - if [[ -n "${CODENAME}" ]]; then - LINKNAME=-${CODENAME} - fi - fi - ;; -esac - -# read optional command line arguments -if [ "$#" -ge 1 ] && [ "${1::1}" != "-" ]; then - if [ "$1" != "all" ]; then - LLVM_VERSION=$1 - else - # special case for ./llvm.sh all - ALL=1 - fi - OPTIND=2 - if [ "$#" -ge 2 ]; then - if [ "$2" == "all" ]; then - # Install all packages - ALL=1 - OPTIND=3 - fi - fi -fi - -while getopts ":hm:n:" arg; do - case $arg in - h) - usage - ;; - m) - BASE_URL=${OPTARG} - ;; - n) - CODENAME=${OPTARG} - if [[ "${CODENAME}" == "unstable" ]]; then - # link name does not apply to unstable repository - LINKNAME= - else - LINKNAME=-${CODENAME} - fi - CODENAME_FROM_ARGUMENTS="true" - ;; - esac -done - -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root!" - exit 1 -fi - -declare -A LLVM_VERSION_PATTERNS -LLVM_VERSION_PATTERNS[9]="-9" -LLVM_VERSION_PATTERNS[10]="-10" -LLVM_VERSION_PATTERNS[11]="-11" -LLVM_VERSION_PATTERNS[12]="-12" -LLVM_VERSION_PATTERNS[13]="-13" -LLVM_VERSION_PATTERNS[14]="-14" -LLVM_VERSION_PATTERNS[15]="-15" -LLVM_VERSION_PATTERNS[16]="-16" -LLVM_VERSION_PATTERNS[17]="-17" -LLVM_VERSION_PATTERNS[18]="" - -if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then - echo "This script does not support LLVM version $LLVM_VERSION" - exit 3 -fi - -LLVM_VERSION_STRING=${LLVM_VERSION_PATTERNS[$LLVM_VERSION]} - -# join the repository name -if [[ -n "${CODENAME}" ]]; then - REPO_NAME="deb ${BASE_URL}/${CODENAME}/ llvm-toolchain${LINKNAME}${LLVM_VERSION_STRING} main" - - # check if the repository exists for the distro and version - if ! wget -q --method=HEAD ${BASE_URL}/${CODENAME} &> /dev/null; then - if [[ -n "${CODENAME_FROM_ARGUMENTS}" ]]; then - echo "Specified codename '${CODENAME}' is not supported by this script." - else - echo "Distribution '${DISTRO}' in version '${VERSION}' is not supported by this script." - fi - exit 2 - fi -fi - - -# install everything - -if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then - # download GPG key once - wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc -fi - -if [[ -z "`apt-key list 2> /dev/null | grep -i llvm`" ]]; then - # Delete the key in the old format - apt-key del AF4F7421 -fi -add-apt-repository "${REPO_NAME}" -apt-get update -PKG="clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION" -if [[ $ALL -eq 1 ]]; then - # same as in test-install.sh - # No worries if we have dups - PKG="$PKG clang-tidy-$LLVM_VERSION clang-format-$LLVM_VERSION clang-tools-$LLVM_VERSION llvm-$LLVM_VERSION-dev lld-$LLVM_VERSION lldb-$LLVM_VERSION llvm-$LLVM_VERSION-tools libomp-$LLVM_VERSION-dev libc++-$LLVM_VERSION-dev libc++abi-$LLVM_VERSION-dev libclang-common-$LLVM_VERSION-dev libclang-$LLVM_VERSION-dev libclang-cpp$LLVM_VERSION-dev libunwind-$LLVM_VERSION-dev" - if test $LLVM_VERSION -gt 14; then - PKG="$PKG libclang-rt-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev" - fi -fi -apt-get install -y $PKG diff --git a/util/dockerfiles/ubuntu-22.04_clang-version/Dockerfile b/util/dockerfiles/ubuntu-22.04_clang-version/Dockerfile deleted file mode 100644 index 7ddf7fe825..0000000000 --- a/util/dockerfiles/ubuntu-22.04_clang-version/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2022 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:22.04 - -# Valid version values: -# 13 -# 15 -ARG version - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - python-is-python3 doxygen libboost-all-dev libhdf5-serial-dev \ - python3-pydot libpng-dev clang-${version} make - -RUN apt-get --purge -y remove gcc - -RUN update-alternatives --install \ - /usr/bin/clang++ clang++ /usr/bin/clang++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/clang clang /usr/bin/clang-${version} 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/clang++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/clang-${version} 100 diff --git a/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile b/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile deleted file mode 100644 index feac348780..0000000000 --- a/util/dockerfiles/ubuntu-22.04_gcc-version/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2022 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:22.04 - -# Valid version values: -# 11 -# 12 - -ARG version - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - doxygen libboost-all-dev libhdf5-serial-dev python3-pydot libpng-dev \ - gcc-${version} g++-${version} make - -RUN update-alternatives --install \ - /usr/bin/g++ g++ /usr/bin/g++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-${version} 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/g++-${version} 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/gcc-${version} 100 diff --git a/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile b/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile deleted file mode 100644 index 157cf4f9ba..0000000000 --- a/util/dockerfiles/ubuntu-22.04_gcc_13-version/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (c) 2024 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:22.04 - -# Valid version values: -# 13 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && \ - # software-properties-common is necessary to install - # to add PPA to the system - apt -y install software-properties-common && \ - # Installing PPA is necessary to install gcc-13 - # because it is not available in the default repositories - # for Ubuntu 22.04 - add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ - apt -y update && \ - apt -y install git m4 scons zlib1g zlib1g-dev libprotobuf-dev \ - protobuf-compiler libprotoc-dev libgoogle-perftools-dev python3-dev \ - doxygen libboost-all-dev libhdf5-serial-dev python3-pydot libpng-dev \ - gcc-13 g++-13 make - -RUN update-alternatives --install \ - /usr/bin/g++ g++ /usr/bin/g++- 100 -RUN update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-13 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/g++-13 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/gcc-13 100 From c1a562083d1506ab3d575ce744ab79edcceb3823 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 11:25:00 -0700 Subject: [PATCH 06/22] util-docker: Set 'pull' to 'always' This ensures the a `docker pull` command is always run before building. Change-Id: If1a66b9b426d5843459e0308a64f13a11c0c6ed2 --- util/dockerfiles/docker-bake.hcl | 1 + 1 file changed, 1 insertion(+) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 7edcd8d447..13158d79c6 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -40,6 +40,7 @@ target "common" { # Here we are enabling multi-platform builds. We are compiling to both ARM # amd X86. platforms = ["linux/amd64", "linux/arm64", "linux/riscv64"] + pull = true } # A group of targets to be built. Note: groups can contain other groups. From 4956c475f48e5094adc78f463230d3305d65ec84 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 12:02:27 -0700 Subject: [PATCH 07/22] util-docker: Set the GPU Docker images to build only to x86 These images won't work and make no sense compiling to any platform other than X86. These are used in SE mode simulations where the host platform matters. Change-Id: I47405e930bf511fabcbc93d0b08ee2fb2c556869 --- util/dockerfiles/docker-bake.hcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 13158d79c6..61db6b593e 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -179,6 +179,7 @@ group "ubuntu-releases" { target "gcn-gpu" { inherits = ["common"] + platform = "linux/amd64" # Only build for x86. dockerfile = "Dockerfile" context = "gcn-gpu" tags = ["${IMAGE_URI}/gcn-gpu:${TAG}"] @@ -186,6 +187,7 @@ target "gcn-gpu" { target "gpu-fs" { inherits = ["common"] + platform = "linux/amd64" # Only build for x86. dockerfile = "Dockerfile" context = "gpu-fs" tags = ["${IMAGE_URI}/gpu-fs:${TAG}"] From 9978b4ea4c6dd88ada1ea56475cb0d4e48c81756 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 12:15:21 -0700 Subject: [PATCH 08/22] util-docker: Add 'devcontainer' to default bake group Change-Id: I4b245cabd6e384cab780bd22b0f8b40d9819b92b --- util/dockerfiles/docker-bake.hcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 61db6b593e..4ae2d0aabf 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -55,7 +55,8 @@ group "default" { "gcn-gpu", "gpu-fs", "sst", - "systemc" + "systemc", + "devcontainer" ] } From 58aad68329e6690431223588a48145ef8f8a21d7 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 12:17:21 -0700 Subject: [PATCH 09/22] util-docker: Order targets in docker-bake This improves readbility. The targets order matches that in the default group. Change-Id: I1102aeb48bc256df9b58032a327ec663e5733a98 --- util/dockerfiles/docker-bake.hcl | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 4ae2d0aabf..23e3bf5e8e 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -178,6 +178,34 @@ group "ubuntu-releases" { ] } +target "ubuntu-24-04_all-dependencies" { + inherits = ["common"] + dockerfile = "Dockerfile" + context = "ubuntu-24.04_all-dependencies" + tags = ["${IMAGE_URI}/ubuntu-24.04_all-dependencies:${TAG}"] +} + +target "ubuntu-22-04_all-dependencies" { + inherits = ["common"] + dockerfile = "Dockerfile" + context = "ubuntu-22.04_all-dependencies" + tags = ["${IMAGE_URI}/ubuntu-22.04_all-dependencies:${TAG}"] +} + +target "ubuntu-20-04_all-dependencies" { + inherits = ["common"] + dockerfile = "Dockerfile" + context = "ubuntu-20.04_all-dependencies" + tags = ["${IMAGE_URI}/ubuntu-20.04_all-dependencies:${TAG}"] +} + +target "ubuntu-24-04_min-dependencies" { + inherits = ["common"] + dockerfile = "Dockerfile" + context = "ubuntu-24.04_min-dependencies" + tags = ["${IMAGE_URI}/ubuntu-24.04_min-dependencies:${TAG}"] +} + target "gcn-gpu" { inherits = ["common"] platform = "linux/amd64" # Only build for x86. @@ -208,38 +236,10 @@ target "systemc" { tags = ["${IMAGE_URI}/systemc-env:${TAG}"] } -target "ubuntu-24-04_all-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-24.04_all-dependencies" - tags = ["${IMAGE_URI}/ubuntu-24.04_all-dependencies:${TAG}"] -} - -target "ubuntu-22-04_all-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-22.04_all-dependencies" - tags = ["${IMAGE_URI}/ubuntu-22.04_all-dependencies:${TAG}"] -} - target "devcontainer" { inherits = ["common"] dependencies = ["devcontainer"] dockerfile = "Dockerfile" context = "devcontainer" tags = ["${IMAGE_URI}/devcontainer:${TAG}"] -} - -target "ubuntu-20-04_all-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-20.04_all-dependencies" - tags = ["${IMAGE_URI}/ubuntu-20.04_all-dependencies:${TAG}"] -} - -target "ubuntu-24-04_min-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-24.04_min-dependencies" - tags = ["${IMAGE_URI}/ubuntu-24.04_min-dependencies:${TAG}"] } \ No newline at end of file From 2c0c933a3afdfbcc6d6bc77560d7363ddc315a87 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 12:35:35 -0700 Subject: [PATCH 10/22] util-docker: Cleanup the systemc docker 1. Uses the ubuntu-24.04_all-deps as the base image. 2. Unifies the build and cleanup into a single step, thus reducing the size of the image. Change-Id: I63b5dad2af0e8b1f6be8ad1f28321c743f36b2dc --- util/dockerfiles/systemc/Dockerfile | 35 ++++++++++------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/util/dockerfiles/systemc/Dockerfile b/util/dockerfiles/systemc/Dockerfile index 41d4fafb93..f0517a139b 100644 --- a/util/dockerfiles/systemc/Dockerfile +++ b/util/dockerfiles/systemc/Dockerfile @@ -24,30 +24,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:22.04 +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install build-essential git m4 scons zlib1g zlib1g-dev \ - libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \ - python3-dev python-is-python3 doxygen libboost-all-dev \ - libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \ - python3-venv wget - -RUN mkdir /systemc -WORKDIR /systemc -RUN wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz; \ - tar xf systemc-2.3.3.tar.gz - -WORKDIR /systemc/systemc-2.3.3 -RUN mkdir objdir -WORKDIR objdir ENV CXX="g++" ENV CXXFLAGS="-std=c++17" -RUN ../configure --prefix=/opt/systemc -RUN make -j8 && make install -RUN make clean - -WORKDIR / -RUN rm -rf /systemc/systemc-2.3.3/objdir +RUN wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz; \ + tar xf systemc-2.3.3.tar.gz && \ + rm systemc-2.3.3.tar.gz && \ + cd systemc-2.3.3 && \ + mkdir objdir && \ + cd objdir && \ + ../configure --prefix=/opt/systemc && \ + make -j$(nproc) && \ + make install && \ + cd ../.. && \ + rm -rf systemc-2.3.3 From 3875dcdfd7b3984beed4e4c3faa990261ec18512 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 25 Jun 2024 12:48:38 -0700 Subject: [PATCH 11/22] util-docker: Update the sst Dockerfile 1. Builds on top of the Ubuntu 24.04 all-deps image. 2. Unify the download, build, install, and cleanup steps. Change-Id: I4c2bf8e571dfd228f7df8372cda0f428de59af51 --- util/dockerfiles/sst/Dockerfile | 63 +++++++++++++++------------------ 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/util/dockerfiles/sst/Dockerfile b/util/dockerfiles/sst/Dockerfile index bf392bcd49..6dafd3a19a 100644 --- a/util/dockerfiles/sst/Dockerfile +++ b/util/dockerfiles/sst/Dockerfile @@ -24,27 +24,22 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM --platform=${BUILDPLATFORM} ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install build-essential git m4 scons zlib1g zlib1g-dev \ - libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \ - python3-dev python-is-python3 doxygen libboost-all-dev \ - libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \ - python3-venv wget +FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest +# Setting the environmental variables +ENV PATH=$PATH:$SST_CORE_HOME/bin +ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/ ENV SST_CORE_HOME="/sst/" # Use GCC 10 -RUN apt update && apt -y install gcc-10 g++-10 -RUN update-alternatives --install \ - /usr/bin/g++ g++ /usr/bin/g++-10 100 -RUN update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/g++-10 100 -RUN update-alternatives --install \ +RUN apt -y update && apt -y install gcc-10 g++-10 &&\ + update-alternatives --install \ + /usr/bin/g++ g++ /usr/bin/g++-10 100 && \ + update-alternatives --install \ + /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \ + update-alternatives --install \ + /usr/bin/c++ c++ /usr/bin/g++-10 100 && \ + update-alternatives --install \ /usr/bin/cc cc /usr/bin/gcc-10 100 # SST Stuff @@ -52,24 +47,22 @@ RUN mkdir /sst # Download and build SST-Core without MPI support WORKDIR /sst/ -RUN wget https://github.com/sstsimulator/sst-core/releases/download/v13.0.0_Final/sstcore-13.0.0.tar.gz; \ - tar xf sstcore-13.0.0.tar.gz; -WORKDIR /sst/sstcore-13.0.0/ -RUN ./configure --prefix=$SST_CORE_HOME --with-python=/usr/bin/python3-config \ - --disable-mpi; \ - make all -j $(nproc); \ - make install; +RUN wget https://github.com/sstsimulator/sst-core/releases/download/v13.0.0_Final/sstcore-13.0.0.tar.gz && \ + tar xf sstcore-13.0.0.tar.gz && \ + cd sstcore-13.0.0/ && \ + ./configure --prefix=$SST_CORE_HOME --with-python=/usr/bin/python3-config \ + --disable-mpi && \ + make all -j $(nproc) && \ + make install && \ + cd /sst && rm -rf sstcore-13.0.0.tar.gz sstcore-13.0.0 # Download and build SST-Elements WORKDIR /sst -RUN wget https://github.com/sstsimulator/sst-elements/releases/download/v13.0.0_Final/sstelements-13.0.0.tar.gz; \ - tar xf sstelements-13.0.0.tar.gz; -WORKDIR /sst/sst-elements-library-13.0.0/ -RUN ./configure --prefix=$SST_CORE_HOME --with-python=/usr/bin/python3-config \ - --with-sst-core=$SST_CORE_HOME; \ - make all -j $(nproc); \ - make install; - -# Setting the environmental variables -ENV PATH=$PATH:$SST_CORE_HOME/bin -ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/ +RUN wget https://github.com/sstsimulator/sst-elements/releases/download/v13.0.0_Final/sstelements-13.0.0.tar.gz && \ + tar xf sstelements-13.0.0.tar.gz && \ + cd sst-elements-library-13.0.0 && \ + ./configure --prefix=$SST_CORE_HOME --with-python=/usr/bin/python3-config \ + --with-sst-core=$SST_CORE_HOME && \ + make all -j $(nproc) && \ + make install && \ + cd /sst && rm -rf sstelements-13.0.0.tar.gz sst-elements-library-13.0.0 From b68c2ef37f75caf488d682d750396c46578f9c80 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 27 Jun 2024 00:52:49 -0700 Subject: [PATCH 12/22] util-docker: Add vim to 24.04-all-deps Ubuntu Docker Change-Id: I898a0fddcdcf8a876fcbbe11795e858395ad9740 --- util/dockerfiles/ubuntu-24.04_all-dependencies/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/dockerfiles/ubuntu-24.04_all-dependencies/Dockerfile b/util/dockerfiles/ubuntu-24.04_all-dependencies/Dockerfile index fc157261ab..c1b9c02b56 100644 --- a/util/dockerfiles/ubuntu-24.04_all-dependencies/Dockerfile +++ b/util/dockerfiles/ubuntu-24.04_all-dependencies/Dockerfile @@ -52,7 +52,8 @@ RUN apt -y update && apt -y upgrade && apt -y install \ pkg-config \ wget \ cmake \ - doxygen + doxygen \ + vim # pre-commit, as installed via apt in 24.04, attempts to create a cache # directory at "${HOME}/.cache/pre-commit". If running docker with non-root, From bef452ce72728d8fdd3dcab2cfdb7937a8f0b89e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 27 Jun 2024 00:57:15 -0700 Subject: [PATCH 13/22] misc,tests: Update supported GCC and Clang compilers - GCC: v10 to v14 - Clang: v14 to v18 Change-Id: I6cd1686ffff0f08686a231b6b4936da343d53831 --- .github/workflows/ci-tests.yaml | 2 +- .github/workflows/compiler-tests.yaml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index a1adfdb8ef..f362347c77 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -96,7 +96,7 @@ jobs: # for compilation error to be exposed. runs-on: [self-hosted, linux, x64] if: github.event.pull_request.draft == false - container: ghcr.io/gem5/clang-version-16:latest + container: ghcr.io/gem5/clang-version-18:latest needs: [pre-commit, check-for-change-id] timeout-minutes: 90 steps: diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index 70b95f5ce4..e50e857622 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -13,9 +13,8 @@ jobs: strategy: fail-fast: false matrix: - image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, clang-version-16, clang-version-15, clang-version-14, clang-version-13, - clang-version-12, clang-version-11, clang-version-10, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, - ubuntu-24.04_min-dependencies] + image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, clang-version-18, clang-version-17, clang-version-16, clang-version-15, + clang-version-14, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, ubuntu-24.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours @@ -33,7 +32,7 @@ jobs: matrix: gem5-compilation: [ARM, ARM_MESI_Three_Level, ARM_MESI_Three_Level_HTM, ARM_MOESI_hammer, Garnet_standalone, MIPS, 'NULL', NULL_MESI_Two_Level, NULL_MOESI_CMP_directory, NULL_MOESI_CMP_token, NULL_MOESI_hammer, POWER, RISCV, SPARC, X86, X86_MI_example, X86_MOESI_AMD_Base, VEGA_X86] - image: [gcc-version-13, clang-version-16] + image: [gcc-version-13, clang-version-18] opts: [.opt] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours From 8b61490df1913f0043418efcdf10252b8a33aeeb Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 27 Jun 2024 01:17:49 -0700 Subject: [PATCH 14/22] util-docker: Update dockerfiles README Change-Id: I39bca04b3770bd51203944d69d0fbecff85055f8 --- util/dockerfiles/README.md | 78 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/util/dockerfiles/README.md b/util/dockerfiles/README.md index 18686fe2b7..8985b94ed9 100644 --- a/util/dockerfiles/README.md +++ b/util/dockerfiles/README.md @@ -1,3 +1,75 @@ -This directory contains Dockerfiles used to create images used in the gem5 project. -The `docker-compose.yaml` defines the building of each image. -The images can be built locally using `docker-compose build`. +# The gem5 Dockerfiles + +This directory contains the Dockerfiles used to build the gem5 Docker images. +The Docker images are used to run gem5 in a containerized environment. + +## The Docker Registry + +We use the Github Container Registry to host the gem5 Docker images. The images are available at the [ghcr.io/gem5] URI. + +### Pulling the Docker Images + +You can pull the gem5 Docker images using the following command: + +```sh +# Example: Pulling the gem5 Ubuntu 24.04 image. +docker pull ghcr.io/gem5/gem5/ubuntu-24.04_all-dependencies:latest +``` + +## Building the Docker Images + +The gem5 Dockerfiles are available in this directory. +All the currently supported Docker images, stored in the registery, are built using these Dockerfiles. + +### Docker buildx + +The Dockerfiles are built using the Docker buildx feature. The buildx feature is used to build multi-architecture images. The buildx feature is available in Docker 19.03 and later versions. + +For more information on the Docker buildx feature, refer to the [Docker documentation](https://docs.docker.com/buildx/working-with-buildx/). + +In this setup we store the buildx configurations in the "docker-bake.hcl" file. +It is worth contsulting this files and noting the "targerts" and "groups" these can be passed to the buildx command to build that target image or group of images. + +For example, the following will build the "ubuntu-24.04_all-dependencies" image: + +```sh +docker buildx bake ubuntu-24.04_all-dependencies +``` + +And the following will build all the gcc-compiler images: + +```sh +docker buildx bake gcc-compiler +``` + +If no target is specified all the images will be built. + +```sh +docker buildx bake +``` + +## Pushing the Docker Images + +To push the Docker images to the Github Container Registry, you can use the following command: + +```sh +docker buildx bake --push +``` + +However, you need to authenticate with the Github Container Registry, creating a token with write access to the gem5 GitHub Docker registry. + +### Authenticating with the Github Container Registry + +To push images, you need to authenticate with the Github Container Registry. You can authenticate using a Github Personal Access Token (PAT). The PAT can be generated from the Github settings. The PAT should have the `write:packages` scope to read the Github Container registry images. + +When you have the PAT, you can authenticate using the following command: + +```sh +echo $GITHUB_PAT | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin +``` + +## gem5 Docker Tags + +As is standard with Docker images, latest image created for each Dockerfile is tagged as `latest`. + +When a new major release of gem5 is created the Docker images compatible with that release are tagged with the gem5 version. For example, the images compatible with gem5 v23.1.0.0 are tagged as `v23-0`: `ghcr.io/gem5/gem5/ubuntu-24.04_all-dependencies:v23-0`. From 59455daa853e433fd6d516bfca0e79d85de9aab9 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 13 Aug 2024 16:12:45 -0700 Subject: [PATCH 15/22] util-docker: Fix correct common platform comment Change-Id: Ifc703b47b1e59522ba01f4c2b59a4863779eefb1 --- util/dockerfiles/docker-bake.hcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 23e3bf5e8e..c8b08d1a9d 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -37,8 +37,8 @@ variable "TAG" { # Common attributes across all targets. Note: these can be overwritten. target "common" { - # Here we are enabling multi-platform builds. We are compiling to both ARM - # amd X86. + # Here we are enabling multi-platform builds. We are compiling to ARM, X86, + # and RISC-V. platforms = ["linux/amd64", "linux/arm64", "linux/riscv64"] pull = true } @@ -242,4 +242,4 @@ target "devcontainer" { dockerfile = "Dockerfile" context = "devcontainer" tags = ["${IMAGE_URI}/devcontainer:${TAG}"] -} \ No newline at end of file +} From 9f93c8ac9c64dac1acd1a708bd3ef231ae4a1caa Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 13 Aug 2024 16:13:33 -0700 Subject: [PATCH 16/22] util-docker: Revert docker image tag to 'latest' Change-Id: Iafe92716725e6b3cecfeba57098c3a7efaf73d97 --- util/dockerfiles/docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index c8b08d1a9d..f920858770 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -32,7 +32,7 @@ variable "IMAGE_URI" { } variable "TAG" { - default = "bootcamp-2024" + default = "latest" } # Common attributes across all targets. Note: these can be overwritten. From dcb04a72fc9f62b20195c07e2507df0af0218534 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 13 Aug 2024 16:15:49 -0700 Subject: [PATCH 17/22] util-docker,tests: Remove Ubuntu 20.04 Docker Change-Id: I1d4bbebaa4b6f064b5f40a95d066bbf092cf103f --- .github/workflows/compiler-tests.yaml | 2 +- util/dockerfiles/docker-bake.hcl | 8 --- .../ubuntu-20.04_all-dependencies/Dockerfile | 57 ------------------- 3 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile diff --git a/.github/workflows/compiler-tests.yaml b/.github/workflows/compiler-tests.yaml index e50e857622..eb570916bc 100644 --- a/.github/workflows/compiler-tests.yaml +++ b/.github/workflows/compiler-tests.yaml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: image: [gcc-version-13, gcc-version-12, gcc-version-11, gcc-version-10, clang-version-18, clang-version-17, clang-version-16, clang-version-15, - clang-version-14, ubuntu-20.04_all-dependencies, ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, ubuntu-24.04_min-dependencies] + clang-version-14, ubuntu-22.04_all-dependencies, ubuntu-24.04_all-dependencies, ubuntu-24.04_min-dependencies] opts: [.opt, .fast] runs-on: [self-hosted, linux, x64] timeout-minutes: 2880 # 48 hours diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index f920858770..2ef05c7dd5 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -173,7 +173,6 @@ group "ubuntu-releases" { targets=[ "ubuntu-24-04_all-dependencies", "ubuntu-22-04_all-dependencies", - "ubuntu-20-04_all-dependencies", "ubuntu-24-04_min-dependencies" ] } @@ -192,13 +191,6 @@ target "ubuntu-22-04_all-dependencies" { tags = ["${IMAGE_URI}/ubuntu-22.04_all-dependencies:${TAG}"] } -target "ubuntu-20-04_all-dependencies" { - inherits = ["common"] - dockerfile = "Dockerfile" - context = "ubuntu-20.04_all-dependencies" - tags = ["${IMAGE_URI}/ubuntu-20.04_all-dependencies:${TAG}"] -} - target "ubuntu-24-04_min-dependencies" { inherits = ["common"] dockerfile = "Dockerfile" diff --git a/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile b/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile deleted file mode 100644 index 055e3ea8e7..0000000000 --- a/util/dockerfiles/ubuntu-20.04_all-dependencies/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2020 The Regents of the University of California -# All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer; -# redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution; -# neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -FROM --platform=${BUILDPLATFORM} ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -y update && apt -y upgrade && \ - apt -y install build-essential git m4 scons zlib1g zlib1g-dev \ - libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \ - python3-dev python-is-python3 doxygen libboost-all-dev \ - libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \ - python3-venv black gcc-10 g++-10 cmake python3-tk wget libssl-dev - -RUN pip install mypy pre-commit - -RUN update-alternatives --install \ - /usr/bin/g++ g++ /usr/bin/g++-10 100 -RUN update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 -RUN update-alternatives --install \ - /usr/bin/c++ c++ /usr/bin/g++-10 100 -RUN update-alternatives --install \ - /usr/bin/cc cc /usr/bin/gcc-10 100 - - -# DRAMSys requires cmake >= 3.24.0. -RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0.tar.gz \ - && tar -xzf cmake-3.24.0.tar.gz \ - && cd cmake-3.24.0 \ - && ./bootstrap \ - && make -j`nproc` \ - && make install \ - && cd .. \ - && rm -rf cmake-3.24.0.tar.gz cmake-3.24.0 From 0c26ee5f71680711ee0377ccf3417ae8fe873e7d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 14 Aug 2024 14:08:44 -0700 Subject: [PATCH 18/22] util-docker: Replace gem5 v24.0 clone with wget This is more efficient. Change-Id: Idd57343183a8667425dbc036ad0c7c18581898f5 --- util/dockerfiles/devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/dockerfiles/devcontainer/Dockerfile b/util/dockerfiles/devcontainer/Dockerfile index d85a681008..105b67dedc 100644 --- a/util/dockerfiles/devcontainer/Dockerfile +++ b/util/dockerfiles/devcontainer/Dockerfile @@ -40,7 +40,8 @@ # there is a pre-built gem5 binary in each devcontainer. This can save time # if the container is used for education or demonstration purposes. FROM ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest as builder -RUN git clone --branch v24.0 https://github.com/gem5/gem5 +RUN wget https://github.com/gem5/gem5/archive/refs/tags/v24.0.tar.gz && \ + tar xzf v24.0.tar.gz && mv gem5-24.0 gem5 && rm v24.0.tar.gz WORKDIR /gem5 RUN scons build/ALL/gem5.opt -j`nproc` RUN scons defconfig build/ALL_CHI build_opts/ALL && \ From 646df63e56b3c396eaaf44753893e7c27c1b0c4e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 15 Aug 2024 10:45:53 -0700 Subject: [PATCH 19/22] misc: Fix typos in util/dockerfiles/README.md Change-Id: I5488301543bfff21279b6c0b1aae841574efee95 Co-authored-by: Harshil Patel --- util/dockerfiles/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/dockerfiles/README.md b/util/dockerfiles/README.md index 8985b94ed9..1f909c241c 100644 --- a/util/dockerfiles/README.md +++ b/util/dockerfiles/README.md @@ -28,7 +28,7 @@ The Dockerfiles are built using the Docker buildx feature. The buildx feature is For more information on the Docker buildx feature, refer to the [Docker documentation](https://docs.docker.com/buildx/working-with-buildx/). In this setup we store the buildx configurations in the "docker-bake.hcl" file. -It is worth contsulting this files and noting the "targerts" and "groups" these can be passed to the buildx command to build that target image or group of images. +It is worth consulting these files and noting the "targets" and "groups", these can be passed to the buildx command to build that target image or group of images. For example, the following will build the "ubuntu-24.04_all-dependencies" image: From cad43079512273c4e55358c4a8a2cf007eafee7e Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 19 Aug 2024 10:04:26 -0700 Subject: [PATCH 20/22] util-docker: Re-add env variables to SST Change-Id: I653baeb69f8be1501766b57337f6643e00d7dd60 --- util/dockerfiles/sst/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/dockerfiles/sst/Dockerfile b/util/dockerfiles/sst/Dockerfile index 6dafd3a19a..8bd02067ce 100644 --- a/util/dockerfiles/sst/Dockerfile +++ b/util/dockerfiles/sst/Dockerfile @@ -66,3 +66,7 @@ RUN wget https://github.com/sstsimulator/sst-elements/releases/download/v13.0.0_ make all -j $(nproc) && \ make install && \ cd /sst && rm -rf sstelements-13.0.0.tar.gz sst-elements-library-13.0.0 + +#Setting the environmental variables +ENV PATH=$PATH:$SST_CORE_HOME/bin +ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/ From 1512eddd43dfd37d22e0109ba155def4b9163db6 Mon Sep 17 00:00:00 2001 From: Ali Nezhadi Khelejani <10778765+ali10129@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:15:33 +0200 Subject: [PATCH 21/22] misc: Update on-create.sh (#1477) After merging the old personal gem5 repository with the stable version v24, I tried to run the project inside the `.devcontainer` environment. During the image build process, I encountered the following error: ```sh [7683 ms] Start: Run in container: /bin/sh -c ./.devcontainer/on-create.sh fatal: detected dubious ownership in repository at '/workspaces/gem5' To add an exception for this directory, call: git config --global --add safe.directory /workspaces/gem5 [7724 ms] onCreateCommand failed with exit code 128. Skipping any further user-provided commands. ``` This error occurred due to an ownership permission problem, which I resolved by adding the following line. --- .devcontainer/on-create.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/on-create.sh b/.devcontainer/on-create.sh index 77f642c32b..8593f4568e 100755 --- a/.devcontainer/on-create.sh +++ b/.devcontainer/on-create.sh @@ -31,6 +31,9 @@ set -e +# Making the downloaded repository safe as the owner might differ for .devcontainer env. +git config --global --add safe.directory /workspaces/gem5 + # Refresh the git index. git update-index From e7442036a57afd4f570aedd4021fb9a8c1908ab2 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 20 Aug 2024 14:18:51 -0700 Subject: [PATCH 22/22] tests,gpu-compute: Fix Daily/Weekly GPU tests failures (#1485) Without specifying the "gem5/gpu" directory, this test attempted to run the entire test suite. This caused the daily and weekly tests to fail. This change fixes this. --- .github/workflows/daily-tests.yaml | 2 +- .github/workflows/weekly-tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily-tests.yaml b/.github/workflows/daily-tests.yaml index 45e9e58dd4..fa18f78134 100644 --- a/.github/workflows/daily-tests.yaml +++ b/.github/workflows/daily-tests.yaml @@ -94,7 +94,7 @@ jobs: - name: Run Testlib GPU Tests working-directory: ${{ github.workspace }}/tests - run: ./main.py run --length=long --skip-build -vvv -t $(nproc) --host gcn_gpu + run: ./main.py run --length=long --skip-build -vvv -t $(nproc) --host gcn_gpu gem5/gpu - name: Upload results if: success() || failure() diff --git a/.github/workflows/weekly-tests.yaml b/.github/workflows/weekly-tests.yaml index e80761e986..70c6412848 100644 --- a/.github/workflows/weekly-tests.yaml +++ b/.github/workflows/weekly-tests.yaml @@ -74,7 +74,7 @@ jobs: - name: Run Testlib GPU Tests working-directory: ${{ github.workspace }}/tests - run: ./main.py run --length=very-long --skip-build -vvv -t $(nproc) --host gcn_gpu + run: ./main.py run --length=very-long --skip-build -vvv -t $(nproc) --host gcn_gpu gem5/gpu - name: Upload results if: success() || failure()