-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
144 lines (115 loc) · 3.86 KB
/
Dockerfile
File metadata and controls
144 lines (115 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
### This is a full chipyard setup
# BUILD BASE FOR CI
FROM nvidia/cuda:11.2.2-base-ubuntu20.04 as base
ARG CHIPYARD_HASH
MAINTAINER https://groups.google.com/forum/#!forum/chipyard
SHELL ["/bin/bash", "-c"]
# install requirements etc
COPY requirements.txt .
RUN apt update
RUN apt -y install python3.8
RUN apt -y install python3-pip
RUN python3 -m pip install --upgrade pip
RUN apt -y install python3.8-venv
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
SHELL ["/bin/bash", "-c"]
RUN source activate
RUN pip3 install torch torchvision torchaudio
RUN pip3 install -r /requirements.txt
# setup VCS
RUN mkdir data
WORKDIR /bin
RUN rm sh
RUN ln -s bash sh
WORKDIR /home
COPY vcs_setup.sh .
COPY entrypoint.sh .
COPY licensing_SCL_2021.12.tgz .
COPY VCS_2021.09-SP1_RHELx86.tgz .
RUN tar xzvf licensing_SCL_2021.12.tgz
RUN tar xzvf VCS_2021.09-SP1_RHELx86.tgz
ENV VCS_HOME=/home/synopsys/2021-22/RHELx86/VCS_2021.09-SP1
ENV PATH="${PATH}:${VCS_HOME}/bin"
ENV VCS_TARGET_ARCH=amd64
#RUN if [ -n "${MANPATH+xxx}" ] ; then export MANPATH="" ; fi
ENV MANPATH=""
ENV MANPATH="${MANPATH}:${VCS_HOME}/doc/man"
ENV SNPSLMD_LICENSE_FILE=27020@10.1.0.103
RUN PATH=/home/synopsys/licenses/bin/SCL_2021.12/scl/2021.12/linux64/bin:$PATH
RUN apt-get -y install lib32z1
RUN apt-get -y install libncurses5
RUN apt-get -y install gawk
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends texinfo
RUN apt-get -y install bison
RUN apt install -y time
RUN apt install -y nano
# Install dependencies for ubuntu-req.sh
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \
wget \
git \
sudo \
ca-certificates \
keyboard-configuration \
console-setup \
bc \
unzip
RUN apt install -y default-jdk
# Manage TheHuzz etc
# maybe instead of installing the cores everytime -> copy them from data
WORKDIR /home/code
COPY code .
COPY setup_chipyard.sh .
RUN chmod +x setup_chipyard.sh
RUN ./setup_chipyard.sh
#RUN ln -s /data/outputs /home/code/master_code/outputs
WORKDIR /home/code/master_code
RUN source thehuzz_setup.sh
RUN chmod +x -R setup_scripts
#RUN ./setup_scripts/install_chipyard.sh
WORKDIR /home/code/master_code/benchmarks
# Install Chipyard and run ubuntu-req.sh to install necessary dependencies
RUN git clone https://github.com/ucb-bar/chipyard.git chipyard_v1_7_1 && \
cd chipyard_v1_7_1 && \
git checkout 1.7.1
WORKDIR /home/code/master_code/benchmarks/chipyard_v1_7_1
RUN ./scripts/init-submodules-no-riscv-tools.sh
# build toolchain for chipyard
RUN ./scripts/build-toolchains.sh riscv-tools --ignore-qemu
RUN source env.sh
COPY install-conda.sh .
RUN chmod +x install-conda.sh
RUN ./install-conda.sh
# install core
WORKDIR /home/code/master_code
RUN source thehuzz_setup.sh
# RUN ./setup_scripts/install_rc.sh do this manually
ENTRYPOINT ["/home/entrypoint.sh"]
CMD ["/bin/bash"]
# BUILD IMAGE WITH TOOLCHAINS
# Use above build as base
FROM base as base-with-tools
SHELL ["/bin/bash", "-cl"]
# Initialize repo
RUN cd chipyard_v1_7_1 && \
export MAKEFLAGS=-"j $(nproc)" && \
conda activate base && \
./setup.sh --env-name chipyard --skip-validate
SHELL ["/opt/conda/bin/conda", "run", "-n", "chipyard", "/bin/bash", "-cl"]
# Set up FireMarshal. Building and cleaning br-base.json builds the underlying
# buildroot image (which takes a long time) but doesn't keep all the br-base
# stuff around (since that's faster to rebuild).
RUN cd chipyard_v1_7_1 && \
source env.sh && \
cd software/firemarshal && \
./init-submodules.sh && \
pip3 install -r python-requirements.txt && \
./marshal build br-base.json && \
./marshal clean br-base.json
# Run script to set environment variables on entry
ENTRYPOINT ["chipyard/scripts/entrypoint.sh"]
# END IMAGE CUSTOMIZATIONS
CMD ["/bin/bash"]