-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
177 lines (165 loc) · 6.73 KB
/
Dockerfile
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# Configure local ubuntu mirror as package source
RUN \
sed -i -re 's|(http://)([^/]+.*)/|\1linux.mirrors.es.net/ubuntu|g' /etc/apt/sources.list
# Install packages required for running the vivado installer
RUN \
ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
ca-certificates \
libtinfo5 \
locales \
lsb-release \
net-tools \
patch \
pigz \
unzip \
wget \
&& \
apt-get autoclean && \
apt-get autoremove && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/*
# Set up the base address for where installer binaries are stored within ESnet's private network
#
# NOTE: This URL is NOT REACHABLE outside of ESnet's private network. Non-ESnet users must follow
# the instructions in the README.md file and download their own copies of the installers
# directly from the AMD/Xilinx website and drop them into the vivado-installer directory
#
ARG DISPENSE_BASE_URL="https://dispense.es.net/Linux/xilinx"
# Install the Xilinx Vivado tools and updates in headless mode
# ENV var to help users to find the version of vivado that has been installed in this container
ENV VIVADO_VERSION=2023.2
# Xilinx installer tar file originally from: https://www.xilinx.com/support/download.html
ARG VIVADO_INSTALLER="FPGAs_AdaptiveSoCs_Unified_${VIVADO_VERSION}_1013_2256.tar.gz"
ARG VIVADO_UPDATE="Vivado_Vitis_Update_2023.2.2_0209_0950.tar.gz"
# Installer config file
ARG VIVADO_INSTALLER_CONFIG="/vivado-installer/install_config_vivado.${VIVADO_VERSION}.txt"
COPY vivado-installer/ /vivado-installer/
RUN \
mkdir -p /vivado-installer/install && \
( \
if [ -e /vivado-installer/$VIVADO_INSTALLER ] ; then \
pigz -dc /vivado-installer/$VIVADO_INSTALLER | tar xa --strip-components=1 -C /vivado-installer/install ; \
else \
wget -qO- $DISPENSE_BASE_URL/$VIVADO_INSTALLER | pigz -dc | tar xa --strip-components=1 -C /vivado-installer/install ; \
fi \
) && \
if [ ! -e ${VIVADO_INSTALLER_CONFIG} ] ; then \
/vivado-installer/install/xsetup \
-p 'Vivado' \
-e 'Vivado ML Enterprise' \
-b ConfigGen && \
echo "No installer configuration file was provided. Generating a default one for you to modify." && \
echo "-------------" && \
cat /root/.Xilinx/install_config.txt && \
echo "-------------" && \
exit 1 ; \
fi ; \
/vivado-installer/install/xsetup \
--agree 3rdPartyEULA,XilinxEULA \
--batch Install \
--config ${VIVADO_INSTALLER_CONFIG} && \
rm -r /vivado-installer/install && \
mkdir -p /vivado-installer/update && \
if [ ! -z "$VIVADO_UPDATE" ] ; then \
( \
if [ -e /vivado-installer/$VIVADO_UPDATE ] ; then \
pigz -dc /vivado-installer/$VIVADO_UPDATE | tar xa --strip-components=1 -C /vivado-installer/update ; \
else \
wget -qO- $DISPENSE_BASE_URL/$VIVADO_UPDATE | pigz -dc | tar xa --strip-components=1 -C /vivado-installer/update ; \
fi \
) && \
/vivado-installer/update/xsetup \
--agree 3rdPartyEULA,XilinxEULA \
--batch Update \
--config ${VIVADO_INSTALLER_CONFIG} && \
rm -r /vivado-installer/update && \
rm -rf /vivado-installer ; \
fi
# ONLY REQUIRED FOR Ubuntu 20.04 (focal) but harmless on other distros
# Hack: replace the stock libudev1 with a newer one from Ubuntu 22.04 (jammy) to avoid segfaults when invoked
# from the flexlm license code within Vivado
RUN \
if [ "$(lsb_release --short --release)" = "20.04" ] ; then \
wget -q -P /tmp http://linux.mirrors.es.net/ubuntu/pool/main/s/systemd/libudev1_249.11-0ubuntu3_amd64.deb && \
dpkg-deb --fsys-tarfile /tmp/libudev1_*.deb | \
tar -C /tools/Xilinx/Vivado/${VIVADO_VERSION}/lib/lnx64.o/Ubuntu/20 --strip-components=4 -xavf - ./usr/lib/x86_64-linux-gnu/ && \
rm /tmp/libudev1_*.deb ; \
fi
# Hack: Install libssl 1.1.1 package from Ubuntu 20.04 (focal) since it is transitively required by the p4bm-vitisnet
# executable and is not properly vendored by the Xilinx runtime environment.
#
# Ubuntu 20.04/focal provides libssl 1.1
# Ubuntu 22.04/jammy provides libssl 3.3
#
# p4bm-vitisnet is dynamically linked against
# libthrift-0.11.0.so (now vendored properly in 22.04)
# libssl.so.1.1 (not vendored, pull the old version from Ubuntu 20.04)
# libcrypto.so.1.1 (not vendored, pull the old version from Ubuntu 20.04)
#
# The libssl .deb package provides both libssl and libcrypto.
#
# This is a sketchy hack to grab a deb from a different Ubuntu release by reaching directly into the package mirror's
# pool and grabbing the .deb directly. This is how we'll deal with it until Xilinx fixes this issue (again).
RUN \
if [ "$(lsb_release --short --release)" = "22.04" ] ; then \
wget -q -P /tmp http://linux.mirrors.es.net/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb && \
dpkg-deb --fsys-tarfile /tmp/libssl1.*.deb | \
tar -C /tools/Xilinx/Vivado/${VIVADO_VERSION}/lib/lnx64.o/Ubuntu/22 --strip-components=4 -xavf - ./usr/lib/x86_64-linux-gnu/ && \
rm /tmp/libssl1.*.deb ; \
fi
# Apply post-install patches to fix issues found on each OS release
# Common patches
# * Disable workaround for X11 XSupportsLocale bug. This workaround triggers additional requirements on the host
# to have an entire suite of X11 related libraries installed even though we only use vivado in batch/tcl mode.
# See: https://support.xilinx.com/s/article/62553?language=en_US
COPY patches/ /patches
RUN \
if [ -e "/patches/ubuntu-$(lsb_release --short --release)-vivado-${VIVADO_VERSION}-postinstall.patch" ] ; then \
patch -p 1 < /patches/ubuntu-$(lsb_release --short --release)-vivado-${VIVADO_VERSION}-postinstall.patch ; \
fi ; \
if [ -e "/patches/vivado-${VIVADO_VERSION}-postinstall.patch" ] ; then \
patch -p 1 < /patches/vivado-${VIVADO_VERSION}-postinstall.patch ; \
fi
# Install specific packages required by esnet-smartnic build
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
git \
jq \
less \
libconfig-dev \
libpci-dev \
libsmbios-c2 \
make \
pax-utils \
python3-click \
python3-jinja2 \
python3-libsmbios \
python3-pip \
python3-scapy \
python3-yaml \
rsync \
tcpdump \
tshark \
vim-tiny \
wireshark-common \
zip \
zstd \
&& \
pip3 install pyyaml-include && \
pip3 install yq && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Set up the container to pre-source the vivado environment
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["/bin/bash", "-l"]