From e95e033e5e61cc2cc99ab444b31a5aa2913b2596 Mon Sep 17 00:00:00 2001 From: Ella Schwarz Date: Thu, 4 Feb 2021 00:29:43 -0800 Subject: [PATCH] Updated dockerfile comments and updated dockerfile readme. Removed ci-dockerfile Added python --- dockerfiles/CI-Dockerfile | 43 --------------------------------------- dockerfiles/Dockerfile | 4 ++-- dockerfiles/README.md | 10 +++++---- scripts/centos-req.sh | 1 + 4 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 dockerfiles/CI-Dockerfile diff --git a/dockerfiles/CI-Dockerfile b/dockerfiles/CI-Dockerfile deleted file mode 100644 index 2ebf119c..00000000 --- a/dockerfiles/CI-Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -### Note: This DockerFile is adapted from: https://github.com/CircleCI-Public/example-images/openjdk -# This is a chipyard setup for CI, no toolchains are initialized - -FROM ubuntu:18.04 -ARG CHIPYARD_HASH - -MAINTAINER https://groups.google.com/forum/#!forum/chipyard - -# Install dependencies for ubuntu-req.sh -RUN apt-get update && \ - apt-get upgrade -y && \ - apt-get install -y \ - curl \ - git \ - sudo - -# Stopping docker keyboard-config from disrupting ubuntu-req.sh -RUN sudo DEBIAN_FRONTEND=noninteractive apt-get install -y keyboard-configuration && \ - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y console-setup - -# Adds a new user called riscvuser -RUN groupadd --gid 3434 riscvuser \ - && useradd --uid 3434 --gid riscvuser --shell /bin/bash --create-home riscvuser \ - && echo 'riscvuser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-riscvuser \ - && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep - -WORKDIR /home/riscvuser -USER riscvuser - -# Update PATH for RISCV toolchain (note: hardcoded for CircleCI) -ENV RISCV="/home/riscvuser/riscv-tools-install" -ENV LD_LIBRARY_PATH="$RISCV/lib" -ENV PATH="$RISCV/bin:$PATH" - -# Install Chipyard and run ubuntu-req.sh to install necessary dependencies -RUN git clone https://github.com/ucb-bar/chipyard.git && \ - cd chipyard && \ - git checkout $CHIPYARD_HASH && \ - ./scripts/ubuntu-req.sh 1>/dev/null - -# END IMAGE CUSTOMIZATIONS - -CMD ["/bin/sh"] diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 2fad661b..1a722a9c 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -1,10 +1,10 @@ -### Note: This DockerFile is adapted from https://github.com/ucb-bar/chipyard/blob/master/.circleci/images/Dockerfile which was adapted from: https://github.com/CircleCI-Public/example-images/openjdk # This is a full chipyard setup # BUILD BASE FOR CI FROM ubuntu:18.04 as base -ARG CHIPYARD_HASH +# Default branch dev for experimental version +ARG CHIPYARD_HASH=dev MAINTAINER https://groups.google.com/forum/#!forum/chipyard diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 12689704..be0e1917 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -2,13 +2,14 @@ General ------- This DockerFile contains the necessary steps to build a Docker container that can run projects with riscv-tools, chisel3, firrtl, and verilator. When run up to the base stage, it installs the necessary -apt-get packages and sets the environment variables needed in CircleCI. When run up to the base-with-tools stage, it initializes and installs the necessary toolchains for running simulations and testing projects. +apt-get packages and sets the environment variables needed for CircleCI. When run up to the base-with-tools stage, it initializes and installs the necessary toolchains for running simulations and testing projects. Build and Deploy the Container ------------------------------ - sudo docker build --target base -f Dockerfile . # to build the image for the CI - sudo docker build --target base-with-tools -f Dockerfile . # to build the full image + sudo docker build --target base . # to build the image for the CI + sudo docker build --target base --build-args CHIPYARD_HASH= . # to build the image for the CI from a specific chipyard commit + sudo docker build --target base-with-tools . # to build the full image sudo docker tag :tag . # to tag the image after the build (ex. 0.0.3) sudo docker login # login into the account to push to sudo docker push :tag # to push to repo with tag @@ -17,4 +18,5 @@ Build and Deploy the Container Path Names ---------- Older docker images (when this Dockerfile was in `riscv-boom/riscv-boom`) can be found in the `riscvboom/riscvboom-images`. -Current up-to-date images are located in `ucbbar/chipyard-image` +Current up-to-date images are located in `ucbbar/chipyard-image`. NOTE: Less recent images in this path may not have toolchains initialized +Current up-to-date CI images are located in `ucbbar/chipyard-ci-image`. diff --git a/scripts/centos-req.sh b/scripts/centos-req.sh index 89e8644c..1a1439d1 100755 --- a/scripts/centos-req.sh +++ b/scripts/centos-req.sh @@ -18,6 +18,7 @@ sudo yum install -y centos-release-scl sudo yum install -y devtoolset-8-make # install DTC sudo yum install -y dtc +sudo yum install -y python # install verilator git clone http://git.veripool.org/git/verilator