Skip to content

Commit 4b0f167

Browse files
PaulkaToastmemfrob
authored andcommitted
[libc] Add docker container for llvm-libc buildbot worker.
Summary: Created a docker container to provide transparency and easy changes to the llvm-libc buildbot intfra. Reviewers: sivachandra Reviewed By: sivachandra Subscribers: MaskRay, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D75596
1 parent 4d12fd8 commit 4b0f167

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

libc/utils/buildbot/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM debian:10
2+
3+
# Installing dependecies.
4+
RUN dpkg --add-architecture i386
5+
RUN apt-get update
6+
RUN apt-get install -y build-essential clang subversion git vim \
7+
zip libstdc++6:i386 file binutils-dev binutils-gold cmake python-pip \
8+
ninja-build
9+
RUN python -m pip install buildbot-slave==0.8.12
10+
11+
# Change linker to gold.
12+
RUN update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
13+
14+
# Create and switch to buildbot user.
15+
RUN useradd buildbot --create-home
16+
USER buildbot
17+
18+
WORKDIR /home/buildbot
19+
20+
# Use clang as the compiler.
21+
ENV CC=/usr/bin/clang
22+
ENV CXX=/usr/bin/clang++
23+
24+
ENV WORKER_NAME="libc-x86_64-debian"
25+
26+
# Set up buildbot host and maintainer info.
27+
RUN mkdir -p "${WORKER_NAME}/info/"
28+
RUN bash -c "(uname -a ; \
29+
gcc --version | head -n1 ; ld --version \
30+
| head -n1 ; cmake --version | head -n1 ) > ${WORKER_NAME}/info/host"
31+
RUN echo "Paula Toth <[email protected]>" > "${WORKER_NAME}/info/admin"
32+
33+
ADD --chown=buildbot:buildbot run.sh .
34+
ENTRYPOINT ["./run.sh"]

libc/utils/buildbot/README.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This folder contains resources needed to create a docker container for
2+
llvm-libc builbot worker.
3+
4+
Dockerfile: Sets up the docker image with all pre-requisites.
5+
6+
run.sh: Script to create and start buildbot worker with supplied password.
7+
8+
cmd to build the docker container:
9+
```
10+
docker build -t llvm-libc-buildbot-worker .
11+
```
12+
13+
cmd to run the buildbot:
14+
```
15+
docker run -it llvm-libc-buildbot-worker <passwd>
16+
```

libc/utils/buildbot/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This serves as the entrypoint for docker to allow us to
4+
# run and start the buildbot while supplying the password
5+
# as an argument.
6+
buildslave create-slave --keepalive=200 "${WORKER_NAME}" \
7+
lab.llvm.org:9990 "${WORKER_NAME}" "$1"
8+
9+
buildslave start "${WORKER_NAME}"
10+
tail -f ${WORKER_NAME}/twistd.log

0 commit comments

Comments
 (0)