-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow a broader range of distro pytest versions
- Loading branch information
1 parent
fcd8433
commit 189686b
Showing
11 changed files
with
204 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
function prune_if_too_big() { | ||
path=$1 | ||
limit_mb=$2 | ||
size_mb=$(du -m -d0 "${path}" | cut -f 1) | ||
if (( size_mb > limit_mb )); then | ||
echo "${path} is too large (${size_mb}mb), pruning it." | ||
rm -rf "${path}" | ||
fi | ||
} | ||
|
||
prune_if_too_big ~/.cache/pants/setup 512 | ||
prune_if_too_big ~/.cache/pants/named_caches 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ubuntu:latest as base | ||
|
||
SHELL ["bash", "-l", "-c"] | ||
ENV SHELL=/bin/bash | ||
|
||
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime | ||
RUN <<EOT bash | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update | ||
apt-get install -y curl git build-essential pkg-config gdb lcov pkg-config \ | ||
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \ | ||
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \ | ||
lzma lzma-dev tk-dev uuid-dev zlib1g-dev | ||
EOT | ||
|
||
WORKDIR /tmp | ||
COPY apt.txt /tmp/apt.txt | ||
RUN xargs apt-get install -y <apt.txt | ||
|
||
RUN useradd dev | ||
USER dev | ||
WORKDIR /home/dev | ||
|
||
# =================================================================== | ||
FROM base as pyenv | ||
|
||
RUN curl https://pyenv.run | bash | ||
RUN <<EOT bash | ||
echo 'export PYENV_ROOT="\$HOME/.pyenv"' >> ~/.bashrc | ||
echo 'command -v pyenv >/dev/null || export PATH="\$PYENV_ROOT/bin:\$PATH"' >> ~/.bashrc | ||
echo 'eval "\$(pyenv init -)"' >> ~/.bashrc | ||
echo 'export PYENV_ROOT="\$HOME/.pyenv"' >> ~/.profile | ||
echo 'command -v pyenv >/dev/null || export PATH="\$PYENV_ROOT/bin:\$PATH"' >> ~/.profile | ||
echo 'eval "\$(pyenv init -)"' >> ~/.profile | ||
EOT | ||
|
||
# =================================================================== | ||
FROM pyenv as py38 | ||
RUN pyenv install 3.8 | ||
|
||
# =================================================================== | ||
FROM pyenv as py39 | ||
RUN pyenv install 3.9 | ||
|
||
# =================================================================== | ||
FROM pyenv as py310 | ||
RUN pyenv install 3.10 | ||
|
||
# =================================================================== | ||
FROM pyenv as py311 | ||
RUN pyenv install 3.11 | ||
|
||
# =================================================================== | ||
FROM base as pants | ||
RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash | ||
|
||
# =================================================================== | ||
FROM pyenv as shell | ||
|
||
ENV PATH="${PATH}:/home/dev/bin" | ||
|
||
# the pants installer puts things in ~/cache/nce and it needs to be persistent | ||
RUN mkdir -p .cache && chown dev:dev .cache | ||
|
||
COPY --from=pants /home/dev/bin ./bin | ||
|
||
# these are all separate stages to make them build in parallel | ||
COPY --from=py38 /home/dev/.pyenv/versions ./.pyenv/versions/ | ||
COPY --from=py39 /home/dev/.pyenv/versions ./.pyenv/versions/ | ||
COPY --from=py310 /home/dev/.pyenv/versions ./.pyenv/versions/ | ||
COPY --from=py311 /home/dev/.pyenv/versions ./.pyenv/versions/ | ||
|
||
VOLUME /home/dev/.cache | ||
WORKDIR /home/dev/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
libxml2-dev | ||
libxmlsec1-dev | ||
libxmlsec1-openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.