Skip to content

CI: use free runners for i686-gnu jobs #133256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/i686-gnu-nopt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ RUN echo "[rust]" > /config/nopt-std-config.toml
RUN echo "optimize = false" >> /config/nopt-std-config.toml

ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
ENV SCRIPT python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std \
&& python3 ../x.py --stage 2 test
ARG SCRIPT_ARG
ENV SCRIPT=${SCRIPT_ARG}
9 changes: 2 additions & 7 deletions src/ci/docker/host-x86_64/i686-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
# Skip some tests that are unlikely to be platform specific, to speed up
# this slow job.
ENV SCRIPT python3 ../x.py --stage 2 test \
--skip src/bootstrap \
--skip tests/rustdoc-js \
--skip src/tools/error_index_generator \
--skip src/tools/linkchecker
ARG SCRIPT_ARG
ENV SCRIPT=${SCRIPT_ARG}
35 changes: 22 additions & 13 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# It seems that it cannot be the same as $IMAGE_TAG, otherwise it overwrites the cache
CACHE_IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci-cache:${cksum}

# Docker build arguments.
build_args=(
"build"
"--rm"
"-t" "rust-ci"
"-f" "$dockerfile"
"$context"
)

# If the environment variable DOCKER_SCRIPT is defined,
# set the build argument SCRIPT_ARG to DOCKER_SCRIPT.
# In this way, we run the script defined in CI,
# instead of the one defined in the Dockerfile.
if [ -n "${DOCKER_SCRIPT+x}" ]; then
build_args+=("--build-arg" "SCRIPT_ARG=${DOCKER_SCRIPT}")
fi

# On non-CI jobs, we try to download a pre-built image from the rust-lang-ci
# ghcr.io registry. If it is not possible, we fall back to building the image
# locally.
Expand All @@ -115,7 +132,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
docker tag "${IMAGE_TAG}" rust-ci
else
echo "Building local Docker image"
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
retry docker "${build_args[@]}"
fi
# On PR CI jobs, we don't have permissions to write to the registry cache,
# but we can still read from it.
Expand All @@ -127,13 +144,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# Build the image using registry caching backend
retry docker \
buildx \
build \
--rm \
-t rust-ci \
-f "$dockerfile" \
"${build_args[@]}" \
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
--output=type=docker \
"$context"
--output=type=docker
# On auto/try builds, we can also write to the cache.
else
# Log into the Docker registry, so that we can read/write cache and the final image
Expand All @@ -147,14 +160,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# Build the image using registry caching backend
retry docker \
buildx \
build \
--rm \
-t rust-ci \
-f "$dockerfile" \
"${build_args[@]}" \
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
--cache-to type=registry,ref=${CACHE_IMAGE_TAG},compression=zstd \
--output=type=docker \
"$context"
--output=type=docker

# Print images for debugging purposes
docker images
Expand Down
55 changes: 51 additions & 4 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ envs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1

# Different set of tests to run tests in parallel in multiple jobs.
stage_2_test_set1: &stage_2_test_set1
DOCKER_SCRIPT: >-
python3 ../x.py --stage 2 test
--skip compiler
--skip src

stage_2_test_set2: &stage_2_test_set2
DOCKER_SCRIPT: >-
python3 ../x.py --stage 2 test
--skip tests
--skip coverage-map
--skip coverage-run
--skip library
--skip tidyselftest

production:
&production
DEPLOY_BUCKET: rust-lang-ci2
Expand Down Expand Up @@ -212,11 +228,42 @@ auto:
- image: dist-x86_64-netbsd
<<: *job-linux-4c

- image: i686-gnu
<<: *job-linux-8c
# The i686-gnu job is split into multiple jobs to run tests in parallel.
# i686-gnu-1 skips tests that run in i686-gnu-2.
- image: i686-gnu-1
env:
IMAGE: i686-gnu
<<: *stage_2_test_set1
<<: *job-linux-4c

- image: i686-gnu-nopt
<<: *job-linux-8c
# Skip tests that run in i686-gnu-1
- image: i686-gnu-2
env:
IMAGE: i686-gnu
<<: *stage_2_test_set2
<<: *job-linux-4c

# The i686-gnu-nopt job is split into multiple jobs to run tests in parallel.
# i686-gnu-nopt-1 skips tests that run in i686-gnu-nopt-2
- image: i686-gnu-nopt-1
env:
IMAGE: i686-gnu-nopt
<<: *stage_2_test_set1
<<: *job-linux-4c

# Skip tests that run in i686-gnu-nopt-1
- image: i686-gnu-nopt-2
env:
IMAGE: i686-gnu-nopt
DOCKER_SCRIPT: >-
python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std &&
python3 ../x.py --stage 2 test
--skip tests
--skip coverage-map
--skip coverage-run
--skip library
--skip tidyselftest
<<: *job-linux-4c

- image: mingw-check
<<: *job-linux-4c
Expand Down
Loading