Skip to content

Commit e81f14e

Browse files
authored
Build-in a Linux source mirror repository (#87)
To reduce the amount of network traffic used by BPF CI jobs, make a full clone kernel-patches/bpf local to the runner image. This mirror repo can later be used by libbpf/ci/get-linux-source action as --reference [1]. [1] https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---reference-if-ablerepository Signed-off-by: Ihor Solodrai <[email protected]>
1 parent cb507c9 commit e81f14e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ FROM myoung34/github-runner:ubuntu-${UBUNTU_VERSION}
55
ARG UBUNTU_VERSION
66

77
COPY install-dependencies.sh /tmp/install-dependencies.sh
8-
RUN /tmp/install-dependencies.sh
8+
RUN bash /tmp/install-dependencies.sh
99

1010
RUN apt-get clean
1111

1212
COPY token.sh /token.sh
1313

14+
COPY setup-mirror-repos.sh /tmp/setup-mirror-repos.sh
15+
RUN bash /tmp/setup-mirror-repos.sh

s390x.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ RUN curl -Lf https://raw.githubusercontent.com/myoung34/docker-github-actions-ru
5959
# RUN curl -Lf https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${RUNNER_VERSION}/token.sh -o /token.sh && chmod 755 /token.sh
6060
COPY token.sh /token.sh
6161

62+
COPY setup-mirror-repos.sh /tmp/setup-mirror-repos.sh
63+
RUN bash /tmp/setup-mirror-repos.sh
64+
6265
RUN useradd -d ${RUNNER_HOME} -m runner
6366
RUN echo "runner ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
6467
RUN echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >>/etc/sudoers

setup-mirror-repos.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
mkdir -p /libbpfci/mirrors
6+
git clone https://github.com/kernel-patches/bpf.git /libbpfci/mirrors/linux
7+
chmod -R a+rX /libbpfci/mirrors

0 commit comments

Comments
 (0)