Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container: Update to Ubuntu 22.04 #157

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# Required by Github checkout action on Ubuntu 18.04-based container,
# see https://github.com/actions/checkout/issues/1590
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

# Run functional regression checks
name: ci
on: [push, pull_request]
Expand Down
53 changes: 29 additions & 24 deletions util/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
# Docker container for Snitch development.

# 1. Stage
FROM ubuntu:18.04 AS builder
FROM ubuntu:22.04 AS builder
ARG CMAKE_VERSION=3.19.4
ARG PYTHON_VERSION=3.9.12
ARG BENDER_VERSION=0.27.1
ARG SPIKE_DASM_VERSION=0.1.0
ARG VERILATOR_VERSION=4.110
# Run dpkg without interactive dialogue
ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -26,11 +27,15 @@ RUN apt-get update && \
lsb-release \
software-properties-common \
unzip \
wget
# Required to install Python
RUN apt-get update && apt-get install -y \
wget \
zlib1g-dev \
libreadline-gplv2-dev \
autoconf \
help2man \
flex \
bison \
llvm-12-dev \
libclang-common-12-dev \
libreadline-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
Expand All @@ -53,10 +58,14 @@ ENV PATH "/root/.cargo/bin:${PATH}"
RUN rustup install 1.70.0
RUN rustup override set 1.70.0

# Get LLVM 12
RUN wget https://apt.llvm.org/llvm.sh
RUN chmod +x llvm.sh
RUN ./llvm.sh 12
# Build Verilator
RUN git clone https://github.com/verilator/verilator && \
cd verilator && \
git checkout "v${VERILATOR_VERSION}" && \
autoconf && \
./configure --prefix /tools/verilator && \
make && \
make install

# Change working directory
WORKDIR /tools
Expand All @@ -82,10 +91,9 @@ RUN wget https://github.com/pulp-platform/riscv-isa-sim/releases/download/snitch
RUN tar xzf snitch-spike-dasm-${SPIKE_DASM_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz

# 2. Stage
FROM ubuntu:18.04 AS snitch_cluster
FROM ubuntu:22.04 AS snitch_cluster
ARG SNITCH_LLVM_VERSION=latest
ARG VERIBLE_VERSION=0.0-776-g09e0b87
ARG VERILATOR_VERSION=4.110
ARG VERIBLE_VERSION=0.0-3318-g8d254167

LABEL version="0.1"
LABEL description="Snitch container for hardware and software development."
Expand All @@ -112,29 +120,21 @@ RUN apt-get update && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# Install Verilator
RUN echo 'deb http://download.opensuse.org/repositories/home:/phiwag:/edatools/xUbuntu_18.04/ /' | tee /etc/apt/sources.list.d/home:phiwag:edatools.list && \
curl -fsSL https://download.opensuse.org/repositories/home:phiwag:edatools/xUbuntu_18.04/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_phiwag_edatools.gpg > /dev/null && \
apt-get update && apt-get install -y verilator-${VERILATOR_VERSION} && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
ENV VLT_ROOT "/usr/share/verilator"

# Get the precompiled LLVM toolchain
RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \
echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \
test "${SNITCH_LLVM_VERSION}" = "latest" && SNITCH_LLVM_VERSION=${latest_tag} || : ; \
LLVM_TAR=riscv32-pulp-llvm-ubuntu1804-$(echo $SNITCH_LLVM_VERSION | cut -d '-' -f3-).tar.gz && \
LLVM_TAR=riscv32-pulp-llvm-ubuntu2004-$(echo $SNITCH_LLVM_VERSION | cut -d '-' -f3-).tar.gz && \
mkdir -p riscv-llvm && \
echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \
wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \
tar xvz --strip-components=1 -C riscv-llvm
ENV LLVM_BINROOT "/tools/riscv-llvm/bin"

# Install Verible
RUN wget https://github.com/google/verible/releases/download/v${VERIBLE_VERSION}/verible-v${VERIBLE_VERSION}-Ubuntu-18.04-bionic-x86_64.tar.gz && \
tar -x -f verible-v${VERIBLE_VERSION}-Ubuntu-18.04-bionic-x86_64.tar.gz --strip-components=1 -C . && \
rm -rf verible-v${VERIBLE_VERSION}-Ubuntu-18.04-bionic-x86_64.tar.gz
RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_VERSION}/verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz && \
tar -x -f verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz --strip-components=1 -C . && \
rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz
ENV PATH "/tools/bin:${PATH}"

# Install git>=2.18, required by Github checkout action to recurse submodules
Expand All @@ -148,6 +148,7 @@ COPY --from=builder /tools/bender bin/
COPY --from=builder /tools/spike-dasm bin/
COPY --from=builder /root/.cargo/bin/banshee bin/
COPY --from=builder /opt/python /opt/python
COPY --from=builder /tools/verilator /tools/verilator/

# Create and activate virtual environment
ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster"
Expand All @@ -159,6 +160,10 @@ COPY docs/requirements.txt /tmp/docs/requirements.txt
COPY sw/dnn/requirements.txt /tmp/sw/dnn/requirements.txt
RUN pip install -r /tmp/python-requirements.txt

# Add Verilator to PATH
ENV PATH "/tools/verilator/bin:${PATH}"
ENV VLT_ROOT "/tools/verilator/share/verilator/"

# Set locale to UTF-8, required because Python 3.6 defaults on ASCII encoding.
# See https://click.palletsprojects.com/en/8.1.x/unicode-support/
ENV LC_ALL "C.UTF-8"
Expand Down
Loading