Skip to content

Commit 5fff1a5

Browse files
committedOct 5, 2023
fix Docker and Bazel CIs
1 parent 235ae2f commit 5fff1a5

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed
 

‎.github/workflows/bazeltest.yml

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
- name: Install requirements
6161
run: |
6262
python3 -m pip install -r requirements.txt
63+
- name: Upgrade libc
64+
# An LLVM update broke this test, fix per is https://bugs.llvm.org/show_bug.cgi?id=27310.
65+
run: |
66+
sudo apt-get upgrade libc-bin=2.31-0ubuntu9.9
6367
- name: Run C++ tests
6468
run: |
6569
bazel test --config=avx --config=openmp \

‎install/tests/Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ FROM debian
33

44
# Install requirements
55
RUN apt-get update
6-
RUN apt-get install -y python3-dev python3-pip
6+
RUN apt-get install -y python3-dev python3-pip python3-venv
77
RUN apt-get install -y cmake git
88

9+
# Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps.
10+
RUN python3 -m venv test_env
11+
12+
# Activate venv.
13+
ENV PATH="test_env/bin:$PATH"
14+
915
COPY ./ /qsim/
1016
RUN pip3 install /qsim/
1117

‎pybind_interface/Dockerfile

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
FROM qsim
33

44
# Install additional requirements
5-
RUN apt-get install -y python3-dev python3-pybind11 python3-pytest python3-pip
5+
RUN apt-get install -y python3-dev python3-pybind11 python3-pip python3-venv
66

7-
# The --force flag is used mainly so that the old numpy installation from pybind
8-
# gets replaced with the one cirq requires
9-
RUN pip3 install --prefer-binary cirq-core --force
7+
# Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps.
8+
RUN python3 -m venv test_env
9+
10+
# Activate venv.
11+
ENV PATH="test_env/bin:$PATH"
12+
13+
# break-system-packages flag to override system packages (e.g. numpy) with Cirq's deps.
14+
RUN pip3 install --prefer-binary cirq-core
1015

1116
# Copy relevant files
1217
COPY ./pybind_interface/ /qsim/pybind_interface/
@@ -18,5 +23,8 @@ WORKDIR /qsim/
1823
# Build pybind code early to cache the results
1924
RUN make -C /qsim/ pybind
2025

26+
# Install pytest
27+
RUN pip3 install pytest
28+
2129
# Compile and run qsim tests
2230
ENTRYPOINT make -C /qsim/ run-py-tests

0 commit comments

Comments
 (0)
Please sign in to comment.