Skip to content

Commit 96a6e13

Browse files
authored
Merge pull request #90 from JuliaCI/tb/config
Introduce a Config object, and other clean-ups.
2 parents fcc9d88 + 76d6c10 commit 96a6e13

File tree

7 files changed

+206
-114
lines changed

7 files changed

+206
-114
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
jobs:
88
test:
9-
name: Julia ${{ matrix.version }} - ${{ matrix.build_version }}
9+
name: Julia ${{ matrix.version }} - ${{ matrix.build_spec }}
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
fail-fast: false
@@ -17,14 +17,14 @@ jobs:
1717
- ubuntu-latest
1818
arch:
1919
- x64
20-
build_version:
20+
build_spec:
2121
- v1.5.0 # entry straight in Versions.toml
2222
- nightly # entry from Builds.toml
2323
- 8cb458c6dcd8e067a3bd430b006efb0dfde56cf9 # directly from Git, never built
2424
- master # directly from Git, likely built
2525
env:
2626
JULIA_DEBUG: PkgEval
27-
JULIA_VERSION: ${{ matrix.build_version }}
27+
JULIA_SPEC: ${{ matrix.build_spec }}
2828
steps:
2929
- uses: actions/checkout@v2
3030
- uses: julia-actions/setup-julia@v1

runner/Dockerfile.arch

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM archlinux:base-devel
2+
3+
RUN pacman -Suy --noconfirm --needed \
4+
# download engines
5+
curl ca-certificates \
6+
# essential tools
7+
git unzip sudo \
8+
# toolchain
9+
gcc-fortran \
10+
# Any package that needs a display (e.g. Gtk.jl)
11+
xorg-server-xvfb \
12+
# clean-up
13+
&& find /var/cache/pacman/ -type f -delete
14+
15+
RUN mkdir /storage /cache
16+
17+
COPY ./entrypoint.sh /
18+
ENTRYPOINT ["/entrypoint.sh"]

runner/Dockerfile runner/Dockerfile.ubuntu

+3-11
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ FROM ubuntu:20.04
33
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install --no-install-recommends -y \
6-
# container tools
7-
dumb-init \
86
# download engines
97
curl ca-certificates \
108
# essential tools
@@ -16,13 +14,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
1614
# clean-up
1715
&& rm -rf /var/lib/apt/lists/*
1816

19-
RUN useradd --create-home --shell /bin/bash --groups sudo pkgeval && \
20-
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
17+
RUN mkdir /storage /cache
2118

22-
RUN mkdir /storage /cache && \
23-
chown pkgeval /storage /cache
24-
25-
WORKDIR /home/pkgeval
26-
USER pkgeval
27-
28-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
19+
COPY ./entrypoint.sh /
20+
ENTRYPOINT ["/entrypoint.sh"]

runner/entrypoint.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash -ue
2+
3+
4+
# prepare the user
5+
6+
USER=$1
7+
USER_ID=$2
8+
GROUP=$3
9+
GROUP_ID=$4
10+
shift 4
11+
12+
groupadd --gid $GROUP_ID $GROUP
13+
echo "$GROUP ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
14+
15+
useradd --uid $USER_ID --gid $GROUP_ID --shell /bin/bash --no-create-home --no-user-group $USER
16+
# manual home creation because it might be mounted tmpfs already
17+
mkdir -p /home/$USER
18+
chown $USER:$GROUP /home/$USER
19+
20+
# make the storage and cache writable, in case we didn't mount one
21+
chown $USER:$GROUP /storage /cache
22+
23+
24+
# prepare the depot
25+
26+
mkdir /home/$USER/.julia
27+
chown $USER:$GROUP /home/$USER/.julia
28+
29+
mkdir -p /storage/artifacts
30+
chown $USER:$GROUP /storage/artifacts
31+
ln -s /storage/artifacts /home/$USER/.julia/artifacts
32+
33+
mkdir -p /cache/registries
34+
chown $USER:$GROUP /cache/registries
35+
ln -s /cache/registries /home/$USER/.julia/registries
36+
37+
38+
# run the command
39+
40+
# discover libraries (which may be mounted at run time, e.g., libcuda by the Docker runtime)
41+
ldconfig
42+
43+
cd /home/$USER
44+
sudo --user $USER --set-home \
45+
CI=true PKGEVAL=true JULIA_PKGEVAL=true \
46+
JULIA_PKG_PRECOMPILE_AUTO=0 \
47+
PYTHON="" R_HOME="*" \
48+
-- "$@"

src/report.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ function print_status(io::IO, status, val=status)
4848
end
4949
end
5050

51-
function compare(result, julia_reference, julia_version)
51+
function compare(result, config_against, config)
5252
pkg_names = unique(result.name)
5353

54-
builds = result[result[!, :julia] .== julia_version, :]
55-
reference = result[result[!, :julia] .== julia_reference, :]
54+
builds = result[result[!, :config] .== config, :]
55+
reference = result[result[!, :config] .== config_against, :]
5656

5757
# overview
5858
o = count(==(:ok), builds[!, :status])
@@ -62,7 +62,7 @@ function compare(result, julia_reference, julia_version)
6262
x = o + s + k + f
6363
nrow(builds)
6464
@assert x == nrow(builds)
65-
print("On v$julia_version, out of $x packages ")
65+
print("On v$config, out of $x packages ")
6666
print_status(:ok, o)
6767
print(" passed, ")
6868
print_status(:fail, f)
@@ -75,7 +75,7 @@ function compare(result, julia_reference, julia_version)
7575
println()
7676

7777
# summary of differences
78-
println("Comparing against v$(julia_reference):")
78+
println("Comparing against $(config_against):")
7979
new_failures = 0
8080
new_successes = 0
8181
for current in eachrow(builds)

0 commit comments

Comments
 (0)