Skip to content
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

Install QEMU emulator in arm64 variant of cpubuilder image. #13

Merged
merged 1 commit into from
Sep 20, 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
10 changes: 10 additions & 0 deletions build_tools/install_arch_extras_amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

set -euo pipefail

# No extras :D
13 changes: 13 additions & 0 deletions build_tools/install_arch_extras_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

set -euo pipefail

# QEMU for aarch64
wget --no-verbose "https://sharkpublic.blob.core.windows.net/sharkpublic/GCP-Migration-Files/qemu-aarch64"
chmod +x ./qemu-aarch64
mv ./qemu-aarch64 /usr/bin/qemu-aarch64
5 changes: 5 additions & 0 deletions dockerfiles/cpubuilder_ubuntu_jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ WORKDIR /install-sccache
COPY build_tools/install_sccache.sh ./
RUN ./install_sccache.sh "0.8.1" && rm -rf /install-sccache

######## target-architecture-specific installs ########
WORKDIR /install-target-arch
COPY build_tools/install_arch_extras_${TARGETARCH}.sh ./
RUN ./install_arch_extras_${TARGETARCH}.sh && rm -rf /install-target-arch
Copy link
Member

Choose a reason for hiding this comment

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

What about eventually going with something like

Suggested change
RUN ./install_arch_extras_${TARGETARCH}.sh && rm -rf /install-target-arch
RUN if [[ "${TARGETARCH}" = "arm64" ]] ; then ./install_arch_extras_arm64.sh && rm -rf /install-target-arch ; fi

But honestly I don't know if I like this either and the empty bash script could be the better way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I looked at other patterns and this looked cleanest in the .Dockerfile. I don't really mind carrying around empty scripts as long as there are only a few of them.


WORKDIR /
5 changes: 5 additions & 0 deletions dockerfiles/cpubuilder_ubuntu_jammy_ghr.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@ WORKDIR /install-sccache
COPY build_tools/install_sccache.sh ./
RUN ./install_sccache.sh "0.8.1" && rm -rf /install-sccache

######## target-architecture-specific installs ########
WORKDIR /install-target-arch
COPY build_tools/install_arch_extras_${TARGETARCH}.sh ./
RUN ./install_arch_extras_${TARGETARCH}.sh && rm -rf /install-target-arch

# Switch back to the working directory upstream expects.
WORKDIR /actions-runner