Skip to content

Commit 3eca6ec

Browse files
committed
ci: Consolidate APT package install steps
Consolidate the installation steps for the components that are packaged using APT. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent aa464b0 commit 3eca6ec

File tree

1 file changed

+33
-36
lines changed

1 file changed

+33
-36
lines changed

‎Dockerfile.ci‎

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,39 @@ ARG FVP_CORSTONE320_VERSION=11.27_25
3636
ENV FVP_CORSTONE320_VERSION=$FVP_CORSTONE320_VERSION
3737
ARG WGET_ARGS="-q --show-progress --progress=bar:force:noscroll"
3838

39+
# Install APT packages
40+
RUN <<EOF
41+
# Install renode (x86 only)
42+
# NOTE: Renode is currently only available for x86_64 host.
43+
if [ "${HOSTTYPE}" = "x86_64" ]; then
44+
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
45+
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
46+
apt-get -y update
47+
wget ${WGET_ARGS} https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/renode_${RENODE_VERSION}_amd64.deb
48+
apt-get install -y ./renode_${RENODE_VERSION}_amd64.deb
49+
rm renode_${RENODE_VERSION}_amd64.deb
50+
pip3 install -r /opt/renode/tests/requirements.txt --no-cache-dir
51+
fi
52+
53+
# Install LLVM and Clang
54+
wget ${WGET_ARGS} https://apt.llvm.org/llvm.sh
55+
chmod +x llvm.sh
56+
./llvm.sh ${LLVM_VERSION} all
57+
rm -f llvm.sh
58+
59+
# Install Python 3.9 for FVP
60+
add-apt-repository -y ppa:deadsnakes/ppa
61+
apt-get update -y
62+
apt-get install -y python3.9-dev
63+
64+
# Clean up stale packages
65+
apt-get autoremove --purge -y
66+
67+
# Clean up local repository
68+
apt-get clean -y
69+
rm -rf /var/lib/apt/lists/*
70+
EOF
71+
3972
# Install Kitware ninja
4073
# NOTE: Pre-built Kitware ninja binaries are only available for x86_64 host.
4174
RUN <<EOF
@@ -69,21 +102,6 @@ RUN <<EOF
69102
fi
70103
EOF
71104

72-
73-
# Install renode (x86 only)
74-
# NOTE: Renode is currently only available for x86_64 host.
75-
RUN <<EOF
76-
if [ "${HOSTTYPE}" = "x86_64" ]; then
77-
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
78-
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
79-
apt-get -y update
80-
wget ${WGET_ARGS} https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/renode_${RENODE_VERSION}_amd64.deb
81-
apt-get install -y ./renode_${RENODE_VERSION}_amd64.deb
82-
rm renode_${RENODE_VERSION}_amd64.deb
83-
pip3 install -r /opt/renode/tests/requirements.txt --no-cache-dir
84-
fi
85-
EOF
86-
87105
# Install BSIM
88106
# Note: west needs an extra folder level, so we create a link to the old location to be backwards compatible
89107
RUN <<EOF
@@ -116,14 +134,6 @@ RUN <<EOF
116134
~/.cargo/bin/rustup target install x86_64-unknown-none
117135
EOF
118136

119-
# Install LLVM and Clang
120-
RUN <<EOF
121-
wget ${WGET_ARGS} https://apt.llvm.org/llvm.sh
122-
chmod +x llvm.sh
123-
./llvm.sh ${LLVM_VERSION} all
124-
rm -f llvm.sh
125-
EOF
126-
127137
# Install sparse package for static analysis
128138
RUN <<EOF
129139
mkdir -p /opt/sparse
@@ -151,12 +161,6 @@ EOF
151161
#
152162
# Ecosystem FVP License permits redistribution (refer to the relevant license available in the container).
153163
RUN <<EOF
154-
set -o pipefail
155-
apt update
156-
apt install software-properties-common
157-
add-apt-repository -y ppa:deadsnakes/ppa
158-
apt install -y python3.9-dev
159-
160164
mkdir -p /opt/fvps
161165
cd /opt/fvps
162166

@@ -205,13 +209,6 @@ RUN <<EOF
205209
rm zephyr-sdk-${ZSDK_VERSION}_linux-${HOSTTYPE}.tar.xz
206210
EOF
207211

208-
# Clean up stale packages
209-
RUN <<EOF
210-
apt-get clean -y
211-
apt-get autoremove --purge -y
212-
rm -rf /var/lib/apt/lists/*
213-
EOF
214-
215212
# Run the Zephyr SDK setup script as 'user' in order to ensure that the
216213
# `Zephyr-sdk` CMake package is located in the package registry under the
217214
# user's home directory.

0 commit comments

Comments
 (0)