Skip to content

Commit

Permalink
Downgrade from gcc11 to gcc9 on ubuntu 20.04 (#243)
Browse files Browse the repository at this point in the history
Co-authored-by: Hien To <[email protected]>
  • Loading branch information
hiento09 and hientominh authored Sep 23, 2024
1 parent 3fc6973 commit acc9aa8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 65 deletions.
24 changes: 3 additions & 21 deletions .github/runners/actions-runner-ubuntu-cuda-11-7.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,18 @@ RUN apt-get update -y \
zstd \
pkg-config \
ccache \
cargo \
gcc \
g++ \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install sccache --locked

RUN chmod +x /root/.cargo/bin/sccache && cp /root/.cargo/bin/sccache /usr/local/bin/sccache

# Add Kitware's APT repository for CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y cmake

# Add PPA for newer versions of GCC
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-11 g++-11 cpp-11 && \
# Clean up
apt-get clean

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

# Download latest git-lfs version
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y --no-install-recommends git-lfs
Expand All @@ -91,7 +73,7 @@ RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \

ENV HOME=/home/runner

ARG RUNNER_VERSION=2.317.0
ARG RUNNER_VERSION=2.319.1

# cd into the user directory, download and unzip the github actions runner
RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,23 @@ RUN apt-get update -y \
zstd \
pkg-config \
ccache \
cargo \
gcc \
g++ \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install sccache --locked

RUN chmod +x /root/.cargo/bin/sccache && cp /root/.cargo/bin/sccache /usr/local/bin/sccache

# Add Kitware's APT repository for CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y cmake

# Add PPA for newer versions of GCC
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-11 g++-11 cpp-11 && \
# Clean up
apt-get clean

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

# Download latest git-lfs version
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y --no-install-recommends git-lfs

ARG RUNNER_VERSION=2.317.0
ARG RUNNER_VERSION=2.319.1

RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
&& groupadd docker --gid $DOCKER_GID \
Expand Down
28 changes: 5 additions & 23 deletions .github/runners/actions-runner-ubuntu-cuda-12-0.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,22 @@ RUN apt-get update -y \
zstd \
pkg-config \
ccache \
cargo \
gcc \
g++ \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install sccache --locked

RUN chmod +x /root/.cargo/bin/sccache && cp /root/.cargo/bin/sccache /usr/local/bin/sccache

# Add Kitware's APT repository for CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y cmake

# Add PPA for newer versions of GCC
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && \
apt-get install -y gcc-11 g++-11 cpp-11 && \
# Clean up
apt-get clean

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

# Download latest git-lfs version
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y --no-install-recommends git-lfs

ARG RUNNER_VERSION=2.317.0

RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
&& groupadd docker --gid $DOCKER_GID \
&& usermod -aG sudo runner \
Expand All @@ -93,6 +73,8 @@ RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \

ENV HOME=/home/runner

ARG RUNNER_VERSION=2.319.1

# cd into the user directory, download and unzip the github actions runner
RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
&& curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
Expand All @@ -109,4 +91,4 @@ ENV LD_LIBRARY_PATH=/usr/local/cuda-11.7/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_

ENTRYPOINT ["/bin/bash", "/home/runner/start.sh"]

USER runner
USER runner

0 comments on commit acc9aa8

Please sign in to comment.