From 5961b0ba765278723bd2f7c478ab15778b71cff2 Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Mon, 24 Jun 2024 12:18:51 -0700 Subject: [PATCH 1/2] misc: Change devcontainer for isca tutorial Change-Id: I4e946bf32b5ad362ff34de5d354fe29cd26fc0cb Signed-off-by: Jason Lowe-Power --- util/dockerfiles/devcontainer/Dockerfile | 26 +++- util/dockerfiles/docker-bake.hcl | 2 +- util/dockerfiles/docker-compose.yaml | 148 ----------------------- 3 files changed, 24 insertions(+), 152 deletions(-) delete mode 100644 util/dockerfiles/docker-compose.yaml diff --git a/util/dockerfiles/devcontainer/Dockerfile b/util/dockerfiles/devcontainer/Dockerfile index 59948d9a9b..2ca7b8ef17 100644 --- a/util/dockerfiles/devcontainer/Dockerfile +++ b/util/dockerfiles/devcontainer/Dockerfile @@ -1,3 +1,4 @@ + # Copyright (c) 2024 The Regents of the University of California # All Rights Reserved. # @@ -43,11 +44,30 @@ FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:late RUN git clone --branch v24.0 https://github.com/gem5/gem5 WORKDIR /gem5 RUN scons build/ALL/gem5.opt -j`nproc` +RUN scons defconfig build/ALL_CHI build_opts/ALL && \ + scons setconfig build/ALL_CHI RUBY_PROTOCOL_CHI=y && \ + scons build/ALL_CHI/gem5.opt -j`nproc` +RUN scons build/VEGA_X86/gem5.opt -j`nproc` -# Stage 2: The final stage where we create the devcontainer image. +# Stage 2: Create the devcontainer image. # This includes all dependencies for building and running gem5, the # dependencies for developing gem5, and a pre-built gem5 binary. FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest +COPY --from=builder /gem5/build/ALL/gem5.opt /usr/local/bin/gem5-mesi +COPY --from=builder /gem5/build/ALL_CHI/gem5.opt /usr/local/bin/gem5 +COPY --from=builder /gem5/build/VEGA_X86/gem5.opt /usr/local/bin/gem5-vega + +# Stage 3: Install additional packages. +# While the base image includes all dependencies for building and running gem5, +# we install packages which are useful when running in a dev container and/or +# developing gem5. (e.g. vim to edit files, qemu for building disk images, +# etc.). RUN apt -y update && \ - apt -y install vim -COPY --from=builder /gem5/build/ALL/gem5.opt /usr/local/bin/gem5 + apt -y install \ + vim \ + qemu-system \ + qemu-kvm \ + g++-aarch64-linux-gnu \ + g++-riscv64-linux-gnu \ + gcc-aarch64-linux-gnu \ + gcc-riscv64-linux-gnu diff --git a/util/dockerfiles/docker-bake.hcl b/util/dockerfiles/docker-bake.hcl index 7092d9cdb1..455448415f 100644 --- a/util/dockerfiles/docker-bake.hcl +++ b/util/dockerfiles/docker-bake.hcl @@ -32,7 +32,7 @@ variable "IMAGE_URI" { } variable "TAG" { - default = "latest" + default = "bootcamp-2024" } # A group of targets to be built. Note: groups can contain other groups. diff --git a/util/dockerfiles/docker-compose.yaml b/util/dockerfiles/docker-compose.yaml deleted file mode 100644 index f461dbba51..0000000000 --- a/util/dockerfiles/docker-compose.yaml +++ /dev/null @@ -1,148 +0,0 @@ ---- -version: '2' - -services: - gcn-gpu: - build: - context: gcn-gpu - dockerfile: Dockerfile - image: ghcr.io/gem5/gcn-gpu:latest - gpu-fs: - build: - context: gpu-fs - dockerfile: Dockerfile - image: ghcr.io/gem5/gpu-fs:latest - sst: - build: - context: sst - dockerfile: Dockerfile - image: ghcr.io/gem5/sst-env:latest - systemc: - build: - context: systemc-2.3.3 - dockerfile: Dockerfile - image: ghcr.io/gem5/systemc-env:latest - ubuntu-20.04_all-dependencies: - build: - context: ubuntu-20.04_all-dependencies - dockerfile: Dockerfile - image: ghcr.io/gem5/ubuntu-20.04_all-dependencies:latest - ubuntu-22.04_all-dependencies: - build: - context: ubuntu-22.04_all-dependencies - dockerfile: Dockerfile - image: ghcr.io/gem5/ubuntu-22.04_all-dependencies:latest - ubuntu-24.04_all-dependencies: - build: - context: ubuntu-24.04_all-dependencies - dockerfile: Dockerfile - image: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest - ubuntu-24.04_min-dependencies: - build: - context: ubuntu-24.04_min-dependencies - dockerfile: Dockerfile - image: ghcr.io/gem5/ubuntu-24.04_min-dependencies:latest - gcc-10: - build: - context: ubuntu-20.04_gcc-version - dockerfile: Dockerfile - args: - - version=10 - image: ghcr.io/gem5/gcc-version-10:latest - gcc-11: - build: - context: ubuntu-22.04_gcc-version - dockerfile: Dockerfile - args: - - version=11 - image: ghcr.io/gem5/gcc-version-11:latest - gcc-12: - build: - context: ubuntu-22.04_gcc-version - dockerfile: Dockerfile - args: - - version=12 - image: ghcr.io/gem5/gcc-version-12:latest - gcc-13: - build: - context: ubuntu-22.04_gcc_13-version - dockerfile: Dockerfile - image: ghcr.io/gem5/gcc-version-13:latest - clang-7: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=7 - image: ghcr.io/gem5/clang-version-7:latest - clang-8: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=8 - image: ghcr.io/gem5/clang-version-8:latest - clang-9: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=9 - image: ghcr.io/gem5/clang-version-9:latest - clang-10: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=10 - image: ghcr.io/gem5/clang-version-10:latest - clang-11: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=11 - image: ghcr.io/gem5/clang-version-11:latest - clang-12: - build: - context: ubuntu-20.04_clang-version - dockerfile: Dockerfile - args: - - version=12 - image: ghcr.io/gem5/clang-version-12:latest - clang-13: - build: - context: ubuntu-22.04_clang-version - dockerfile: Dockerfile - args: - - version=13 - image: ghcr.io/gem5/clang-version-13:latest - clang-14: - build: - context: ubuntu-22.04_clang-version - dockerfile: Dockerfile - args: - - version=14 - image: ghcr.io/gem5/clang-version-14:latest - clang-15: - build: - context: ubuntu-22.04_clang-version - dockerfile: Dockerfile - args: - - version=15 - image: ghcr.io/gem5/clang-version-15:latest - clang-16: - build: - context: ubuntu-22.04_clang-16 - dockerfile: Dockerfile - image: ghcr.io/gem5/clang-version-16:latest - llvm-gnu-cross-compiler-riscv64: - build: - context: llvm-gnu-cross-compiler-riscv64 - dockerfile: Dockerfile - image: ghcr.io/gem5/llvm-gnu-cross-compiler-riscv64:latest - gem5-all-min-dependencies: - build: - context: gem5-all-min-dependencies - dockerfile: Dockerfile - image: ghcr.io/gem5/gem5-all-min-dependencies:latest From ace61f40228122ba0fde958cb41a4e30aad28ff7 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 18 Jul 2024 11:46:11 -0700 Subject: [PATCH 2/2] util-docker: Update devcontainer for bootcamp24 Change-Id: Ia19840a3858f2f39ef9d9bdc60d0ba6b9231948e --- util/dockerfiles/devcontainer/Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/util/dockerfiles/devcontainer/Dockerfile b/util/dockerfiles/devcontainer/Dockerfile index 2ca7b8ef17..d85a681008 100644 --- a/util/dockerfiles/devcontainer/Dockerfile +++ b/util/dockerfiles/devcontainer/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (c) 2024 The Regents of the University of California # All Rights Reserved. # @@ -40,7 +39,7 @@ # In the final stage this this is copied into /usr/local/bin/gem5. This ensures # 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 --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest as builder +FROM ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest as builder RUN git clone --branch v24.0 https://github.com/gem5/gem5 WORKDIR /gem5 RUN scons build/ALL/gem5.opt -j`nproc` @@ -52,10 +51,11 @@ RUN scons build/VEGA_X86/gem5.opt -j`nproc` # Stage 2: Create the devcontainer image. # This includes all dependencies for building and running gem5, the # dependencies for developing gem5, and a pre-built gem5 binary. -FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest +FROM ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest COPY --from=builder /gem5/build/ALL/gem5.opt /usr/local/bin/gem5-mesi -COPY --from=builder /gem5/build/ALL_CHI/gem5.opt /usr/local/bin/gem5 +COPY --from=builder /gem5/build/ALL_CHI/gem5.opt /usr/local/bin/gem5-chi COPY --from=builder /gem5/build/VEGA_X86/gem5.opt /usr/local/bin/gem5-vega +RUN ln -s /usr/local/bin/gem5-chi /usr/local/bin/gem5 # Stage 3: Install additional packages. # While the base image includes all dependencies for building and running gem5, @@ -70,4 +70,10 @@ RUN apt -y update && \ g++-aarch64-linux-gnu \ g++-riscv64-linux-gnu \ gcc-aarch64-linux-gnu \ - gcc-riscv64-linux-gnu + gcc-riscv64-linux-gnu \ + locales \ + gdb \ + unzip + +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8