Skip to content

Commit

Permalink
Merge pull request #90 from JuliaCI/tb/config
Browse files Browse the repository at this point in the history
Introduce a Config object, and other clean-ups.
  • Loading branch information
maleadt authored Apr 15, 2021
2 parents fcc9d88 + 76d6c10 commit 96a6e13
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 114 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.build_version }}
name: Julia ${{ matrix.version }} - ${{ matrix.build_spec }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -17,14 +17,14 @@ jobs:
- ubuntu-latest
arch:
- x64
build_version:
build_spec:
- v1.5.0 # entry straight in Versions.toml
- nightly # entry from Builds.toml
- 8cb458c6dcd8e067a3bd430b006efb0dfde56cf9 # directly from Git, never built
- master # directly from Git, likely built
env:
JULIA_DEBUG: PkgEval
JULIA_VERSION: ${{ matrix.build_version }}
JULIA_SPEC: ${{ matrix.build_spec }}
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
18 changes: 18 additions & 0 deletions runner/Dockerfile.arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM archlinux:base-devel

RUN pacman -Suy --noconfirm --needed \
# download engines
curl ca-certificates \
# essential tools
git unzip sudo \
# toolchain
gcc-fortran \
# Any package that needs a display (e.g. Gtk.jl)
xorg-server-xvfb \
# clean-up
&& find /var/cache/pacman/ -type f -delete

RUN mkdir /storage /cache

COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
14 changes: 3 additions & 11 deletions runner/Dockerfile → runner/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install --no-install-recommends -y \
# container tools
dumb-init \
# download engines
curl ca-certificates \
# essential tools
Expand All @@ -16,13 +14,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# clean-up
&& rm -rf /var/lib/apt/lists/*

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

RUN mkdir /storage /cache && \
chown pkgeval /storage /cache

WORKDIR /home/pkgeval
USER pkgeval

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
48 changes: 48 additions & 0 deletions runner/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash -ue


# prepare the user

USER=$1
USER_ID=$2
GROUP=$3
GROUP_ID=$4
shift 4

groupadd --gid $GROUP_ID $GROUP
echo "$GROUP ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

useradd --uid $USER_ID --gid $GROUP_ID --shell /bin/bash --no-create-home --no-user-group $USER
# manual home creation because it might be mounted tmpfs already
mkdir -p /home/$USER
chown $USER:$GROUP /home/$USER

# make the storage and cache writable, in case we didn't mount one
chown $USER:$GROUP /storage /cache


# prepare the depot

mkdir /home/$USER/.julia
chown $USER:$GROUP /home/$USER/.julia

mkdir -p /storage/artifacts
chown $USER:$GROUP /storage/artifacts
ln -s /storage/artifacts /home/$USER/.julia/artifacts

mkdir -p /cache/registries
chown $USER:$GROUP /cache/registries
ln -s /cache/registries /home/$USER/.julia/registries


# run the command

# discover libraries (which may be mounted at run time, e.g., libcuda by the Docker runtime)
ldconfig

cd /home/$USER
sudo --user $USER --set-home \
CI=true PKGEVAL=true JULIA_PKGEVAL=true \
JULIA_PKG_PRECOMPILE_AUTO=0 \
PYTHON="" R_HOME="*" \
-- "$@"
10 changes: 5 additions & 5 deletions src/report.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ function print_status(io::IO, status, val=status)
end
end

function compare(result, julia_reference, julia_version)
function compare(result, config_against, config)
pkg_names = unique(result.name)

builds = result[result[!, :julia] .== julia_version, :]
reference = result[result[!, :julia] .== julia_reference, :]
builds = result[result[!, :config] .== config, :]
reference = result[result[!, :config] .== config_against, :]

# overview
o = count(==(:ok), builds[!, :status])
Expand All @@ -62,7 +62,7 @@ function compare(result, julia_reference, julia_version)
x = o + s + k + f
nrow(builds)
@assert x == nrow(builds)
print("On v$julia_version, out of $x packages ")
print("On v$config, out of $x packages ")
print_status(:ok, o)
print(" passed, ")
print_status(:fail, f)
Expand All @@ -75,7 +75,7 @@ function compare(result, julia_reference, julia_version)
println()

# summary of differences
println("Comparing against v$(julia_reference):")
println("Comparing against $(config_against):")
new_failures = 0
new_successes = 0
for current in eachrow(builds)
Expand Down
Loading

0 comments on commit 96a6e13

Please sign in to comment.