Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
ef4daf6b
Commit
ef4daf6b
authored
Jun 09, 2022
by
Jialin Li
Browse files
docker: add Tofino docker image
parent
d6d1d6d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
0 deletions
+99
-0
docker/Dockerfile.tofino
docker/Dockerfile.tofino
+95
-0
docker/rules.mk
docker/rules.mk
+4
-0
No files found.
docker/Dockerfile.tofino
0 → 100644
View file @
ef4daf6b
FROM ubuntu:focal
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
TZ=Europe/Berlin \
apt-get install -y \
apt-utils \
autoconf \
bc \
bison \
build-essential \
doxygen \
g++ \
flex \
git \
kmod \
libboost-coroutine-dev \
libboost-fiber-dev \
libboost-iostreams-dev \
libelf-dev \
libglib2.0-dev \
libgoogle-perftools-dev \
libpcap-dev \
libpixman-1-dev \
libprotobuf-dev \
ninja-build \
protobuf-compiler \
python-is-python3 \
python3-dev \
python3-sphinx \
python3-sphinx-rtd-theme \
rsync \
scons \
unzip \
wget \
nano \
vim \
&& rm -rf /var/lib/apt/lists/*
COPY docker/verilator.patch /tmp/
RUN cd /tmp \
&& git clone -b v4.010 https://github.com/verilator/verilator \
&& cd verilator \
&& patch -p1 < /tmp/verilator.patch \
&& autoupdate \
&& autoconf \
&& ./configure \
&& make -j`nproc` \
&& make install \
&& rm -rf /tmp/verilator
# Add non-root user for vs code devcontainer.
ARG USERNAME=simbricks
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \
# Add sudo support for this user and remove the need to type in password.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
COPY . /simbricks
WORKDIR /simbricks
RUN make -j `nproc` ENABLE_VERILATOR=y
RUN git submodule update --init sims/external/qemu \
&& make -j `nproc` sims/external/qemu/ready \
&& bash docker/cleanup_external.sh
RUN git submodule update --init sims/external/gem5 \
&& make -j `nproc` sims/external/gem5/ready \
&& bash docker/cleanup_gem5.sh
RUN git submodule update --init sims/external/femu \
&& make -j `nproc` sims/external/femu/ready
RUN git submodule update --init sims/external/ns-3 \
&& make -j `nproc` sims/external/ns-3/ready
RUN make -j `nproc` build-images-min COMPRESSED_IMAGES=true \
&& bash docker/cleanup_images.sh
ENV PYTHONPATH=/simbricks/experiments
RUN sudo cp docker/simbricks-run /usr/bin/ \
&& sudo chmod 755 /usr/bin/simbricks-run
RUN mkdir /tofino
COPY docker/bf-sde.tgz /tofino
WORKDIR /tofino
RUN tar xf bf-sde.tgz \
&& rm bf-sde.tgz \
&& mv bf-sde-* bf-sde
WORKDIR /tofino/bf-sde/p4studio
RUN sudo -E ./install-p4studio-dependencies.sh
RUN ./p4studio profile apply ./profiles/p4-16-programs-tofino.yaml
ENV SDE=/tofino/bf-sde
ENV SDE_INSTALL=/tofino/bf-sde/install
WORKDIR /tofino/bf-sde
RUN mkdir tools
COPY docker/p4_build.sh tools/
RUN ./tools/p4_build.sh /simbricks/sims/tofino/p4/nopaxos.p4
docker/rules.mk
View file @
ef4daf6b
...
@@ -34,4 +34,8 @@ docker-images:
...
@@ -34,4 +34,8 @@ docker-images:
docker build
-t
simbricks/simbricks-dist-worker:latest
\
docker build
-t
simbricks/simbricks-dist-worker:latest
\
-f
docker/Dockerfile.dist-worker docker
-f
docker/Dockerfile.dist-worker docker
docker-image-tofino
:
docker build
-t
simbricks/simbricks:tofino
\
-f
docker/Dockerfile.tofino .
include
mk/subdir_post.mk
include
mk/subdir_post.mk
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment