-
Notifications
You must be signed in to change notification settings - Fork 406
Expand file tree
/
Copy pathinstall-base-deps.sh
More file actions
executable file
·49 lines (42 loc) · 2.51 KB
/
Copy pathinstall-base-deps.sh
File metadata and controls
executable file
·49 lines (42 loc) · 2.51 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
#!/usr/bin/env bash
set -ex
apt-get update && apt-get install --no-install-recommends -y \
wget curl ca-certificates valgrind \
git openssh-client hwinfo jq procps \
software-properties-common build-essential libnss3-dev
# Prebuilt, relocatable CPython from python-build-standalone (the same builds uv ships).
# Avoids a slow from-source pyenv compile and stays version-pinned + checksum-verified.
# Pinned to 3.9.x: the Benchmarking Platform tooling (bp-runner, benchmark-analyzer,
# github-tools) targets Python 3.9 across the fleet; 3.9.23 is the final 3.9 release
# and the last one python-build-standalone publishes. x86_64 only; this image is
# built for linux/amd64 (sirun ships no arm64 binary).
wget -O /tmp/python.tar.gz https://github.com/astral-sh/python-build-standalone/releases/download/20250902/cpython-3.9.23+20250902-x86_64-unknown-linux-gnu-install_only.tar.gz
echo "9038680028e006d13ea1ff68fdcab0a5494d2026cdd2dbdfb067c5b80b6272f1 /tmp/python.tar.gz" | sha256sum -c -
tar -xzf /tmp/python.tar.gz -C /opt
rm /tmp/python.tar.gz
# bp-install's install.sh runs `pyenv local 3.9` before `python3 -m venv`. CPython
# 3.9 from python-build-standalone is already first on PATH, so selection is a no-op;
# stub pyenv rather than compiling the full pyenv the fleet uses.
cat > /usr/local/bin/pyenv <<'PYENV_STUB'
#!/usr/bin/env bash
exit 0
PYENV_STUB
chmod +x /usr/local/bin/pyenv
# awscli 1.45+ dropped Python 3.9 (requires >=3.10); hold at the last 1.44.x until
# the CPython pin above moves to 3.10+, or pip can't resolve awscli on this image.
pip3 install awscli==1.44.87 virtualenv==21.4.2 setuptools==82.0.1
# Poetry 2.3+ also requires Python >=3.10; 2.2.1 is the last 3.9-compatible release.
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 - --version 2.2.1
# Bootstrap bp-install so the Dockerfile can install the Benchmarking Platform
# packages (bp-runner, benchmark-analyzer, github-tools) the same way the rest of
# the fleet does. Mirrors dd-trace-go's container/install-base-deps.sh.
if [ ! -d "/tmp/benchmarking-platform-tools" ]; then
if [ -n "$CI_JOB_TOKEN" ]; then
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform-tools /tmp/benchmarking-platform-tools
else
mkdir -p ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git clone git@github.com:DataDog/benchmarking-platform-tools /tmp/benchmarking-platform-tools
fi
fi
mkdir -p /app
cp -r /tmp/benchmarking-platform-tools/images/templates/linux/bp-install /app/bp-install