Skip to content

Commit

Permalink
Add requirements.txt file for nightly image (#412)
Browse files Browse the repository at this point in the history
* add requirements.txt file, install in docker image

* pass base repo as context to docker build
  • Loading branch information
justice-adams-apple authored Sep 3, 2024
1 parent 0ba5db9 commit 2928d6a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def get_dockerfiles():
filename = file_info['filename']
print(filename)
if "Dockerfile" in filename and not "windows" in filename:
file_dir = filename.replace("Dockerfile", "")
dockerfiles.append(file_dir)
dockerfiles.append(filename)
return dockerfiles


Expand All @@ -69,15 +68,15 @@ def main():
sys.stdout.flush()
log_file = dockerfile.replace(docker_dir,"").replace("/", "_")
log_file = "{}.log".format(log_file)
cmd = f"docker build --no-cache=true {dockerfile}"
cmd = "docker build --no-cache=true -f {dockerfile} .".format(dockerfile=dockerfile)
if "buildx" in dockerfile:
# if "buildx" is part of the path, we want to use the new buildx build system and build
# for both amd64 and arm64.
cmd = "docker buildx create --use"
run_command(cmd, log_file)
cmd = "docker buildx inspect --bootstrap"
run_command(cmd, log_file)
cmd = f"docker buildx build --platform linux/arm64,linux/amd64 --no-cache=true {dockerfile}"
cmd = "docker buildx build --platform linux/arm64,linux/amd64 --no-cache=true -f {dockerfile} .".format(dockerfile=dockerfile)
status = run_command(cmd, log_file)
results[dockerfile] = status
if status != 0:
Expand Down
7 changes: 7 additions & 0 deletions swift-ci/dependencies/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The following come from https://github.com/llvm/llvm-project/blob/main/lldb/test/requirements.txt
# These Python packages are required to be able to run the LLDB test suite.
psutil>=5.9.4
# Pexpect tests are known not to work on Windows, so are disabled.
# See llvm.org/pr22274.
pexpect>=4.9.0; sys_platform != 'win32'
packaging
3 changes: 3 additions & 0 deletions swift-ci/main/amazon-linux/2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ RUN yum -y install \

RUN mkdir -p /usr/local/lib/python3.7/site-packages/

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt

RUN easy_install-3.7 six

ARG SWIFT_PLATFORM=amazonlinux2
Expand Down
3 changes: 3 additions & 0 deletions swift-ci/main/ubuntu/18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ RUN apt -y update && apt -y install \
uuid-dev \
zip

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt

ARG SWIFT_PLATFORM=ubuntu18.04
ARG SWIFT_VERSION=5.8.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
Expand Down
3 changes: 3 additions & 0 deletions swift-ci/main/ubuntu/20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ RUN apt-get -y update && apt-get -y install \
uuid-dev \
zip

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt

ARG SWIFT_PLATFORM=ubuntu20.04
ARG SWIFT_VERSION=5.8.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
Expand Down
3 changes: 3 additions & 0 deletions swift-ci/main/ubuntu/22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ RUN apt-get -y update && apt-get -y install \
uuid-dev \
zip

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt

ARG SWIFT_PLATFORM=ubuntu22.04
ARG SWIFT_VERSION=5.8.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
Expand Down
3 changes: 3 additions & 0 deletions swift-ci/main/ubuntu/23.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ RUN apt-get -y update && apt-get -y install \
uuid-dev \
zip

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt --break-system-packages

ARG SWIFT_PLATFORM=ubuntu23.10
ARG SWIFT_VERSION=5.10.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
Expand Down
3 changes: 3 additions & 0 deletions swift-ci/main/ubuntu/24.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ RUN apt-get -y update && apt-get -y install \
uuid-dev \
zip

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt --break-system-packages

ARG SWIFT_PLATFORM=ubuntu24.04
ARG SWIFT_VERSION=5.10.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
Expand Down

0 comments on commit 2928d6a

Please sign in to comment.