Skip to content

Commit

Permalink
Refactor git upgrade for citestwheel
Browse files Browse the repository at this point in the history
This PR refactors how `git` is upgraded in the `citestwheel` image.

Specifically, it adds `APT::Update::Error-Mode=any` to ensure that any transient network errors that occur from `apt update` are treated as errors.

It also moves some code blocks around to consolidate commands and switches a long `RUN` command to use `heredocs`.
  • Loading branch information
ajschmidt8 committed Oct 5, 2023
1 parent 596d5cd commit e1b891b
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions citestwheel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,24 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV PYENV_ROOT="/pyenv"
ENV PATH="/pyenv/bin:/pyenv/shims:$PATH"

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
wget curl git jq ssh \
make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget \
curl llvm libncursesw5-dev xz-utils tk-dev unzip \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
RUN <<EOF
set -e
if [[ "${LINUX_VER}" == "ubuntu18.04" ]]; then
# update git > 2.17
apt-get install -y software-properties-common
add-apt-repository ppa:git-core/ppa -y
fi

apt-get update -o APT::Update::Error-Mode=any
apt-get upgrade -y
apt-get install -y --no-install-recommends \
wget curl git jq ssh \
make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget \
curl llvm libncursesw5-dev xz-utils tk-dev unzip \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
EOF

# Install pyenv
RUN curl https://pyenv.run | bash
Expand All @@ -49,9 +59,6 @@ RUN mkdir -p /aws_install && cd /aws_install && \
cd / && \
rm -rf /aws_install

# update git > 2.17
RUN grep '18.04' /etc/issue && bash -c "apt-get install -y software-properties-common && add-apt-repository ppa:git-core/ppa -y && apt-get update && apt-get install --upgrade -y git" || true;

# Install latest gha-tools
RUN wget https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - \
| tar -xz -C /usr/local/bin
Expand Down

0 comments on commit e1b891b

Please sign in to comment.