Skip to content

Reinstate "Use Swift 5.7 base image for Swift CI jobs to support bootstrapping" #341

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

Closed
Closed
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 swift-ci/master/amazon-linux/2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM amazonlinux:2
FROM swift:5.7-amazonlinux2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be pinned to 5.7 or use the latest release?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned makes sense to me given that we support releases up to 12 months back. So 5.7/5.8/.5.9. Though ideally we'd have a build for 5.8 + 5.9 going as well.


RUN yum install shadow-utils -y

RUN groupadd -g 998 build-user && \
RUN groupadd -g 1000 build-user && \
useradd -m -r -u 42 -g build-user build-user

# The build needs a package from the EPEL repo so that needs to be enabled.
Expand Down
34 changes: 33 additions & 1 deletion swift-ci/master/centos/7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM centos:7

RUN yum install shadow-utils.x86_64 -y

RUN groupadd -g 998 build-user && \
RUN groupadd -g 1000 build-user && \
useradd -m -r -u 42 -g build-user build-user

RUN yum install -y epel-release centos-release-scl
Expand Down Expand Up @@ -48,6 +48,38 @@ RUN ldconfig

RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h

ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
ARG SWIFT_PLATFORM=centos7
ARG SWIFT_BRANCH=swift-5.7.3-release
ARG SWIFT_VERSION=swift-5.7.3-RELEASE
ARG SWIFT_WEBROOT=https://download.swift.org

ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
SWIFT_PLATFORM=$SWIFT_PLATFORM \
SWIFT_BRANCH=$SWIFT_BRANCH \
SWIFT_VERSION=$SWIFT_VERSION \
SWIFT_WEBROOT=$SWIFT_WEBROOT

RUN set -e; \
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)" \
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
&& mkdir -p /opt/swift \
# - Unpack the toolchain, set libs permissions, and clean up.
&& tar -xzf swift.tar.gz --directory /opt/swift/ --strip-components=1 \
&& chmod -R o+r /opt/swift/usr/lib/swift \
&& ln -s /opt/swift/usr/lib/swift /usr/lib/swift \
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

ENV PATH="/opt/swift/usr/bin:${PATH}"

RUN swift --version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a surprising change. why do we need to do this? should we fix the docker image instead if this is fixing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally all our release images would install into /opt/swift/<version> instead of /usr. But we don't want to break current clients, so for now we're just updating the builder image.

Without this change, Swift uses the toolchain-clang to build and then uses the system C++ stdlib instead of devtoolset as it should. The system stdlib is wildly out of date (unsurprising) and thus doesn't have any new C++ features.

@shahmishal given all the other images are using the toolchain clang, perhaps we should make this ENV PATH=/opt/swift/usr/bin:${PATH} instead of appending?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal given all the other images are using the toolchain clang, perhaps we should make this ENV PATH=/opt/swift/usr/bin:${PATH} instead of appending?

Yes, that make sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a surprising change. why do we need to do this? should we fix the docker image instead if this is fixing something?

We can change this in 5.9 release, if the community is ok with the change. I would like to avoid this type of change in dot release.


USER build-user

WORKDIR /home/build-user
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/master/rhel-ubi/9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM redhat/ubi9
FROM swift:5.8-rhel-ubi9

RUN groupadd -g 42 build-user && \
useradd -m -r -u 42 -g build-user build-user
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/master/ubuntu/18.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM swift:5.7-bionic

RUN groupadd -g 998 build-user && \
useradd -m -r -u 998 -g build-user build-user
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/master/ubuntu/20.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM swift:5.7-focal

RUN groupadd -g 998 build-user && \
useradd -m -r -u 998 -g build-user build-user
Expand Down
2 changes: 1 addition & 1 deletion swift-ci/master/ubuntu/22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM swift:5.7-jammy

RUN groupadd -g 998 build-user && \
useradd -m -r -u 998 -g build-user build-user
Expand Down