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

fix Docker and Bazel CIs #628

Merged
merged 3 commits into from
Oct 18, 2023
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: 4 additions & 0 deletions .github/workflows/bazeltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ jobs:
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Upgrade libc
# An LLVM update broke this test, fix per is https://bugs.llvm.org/show_bug.cgi?id=27310.
run: |
sudo apt-get upgrade libc-bin=2.31-0ubuntu9.9
- name: Run C++ tests
run: |
bazel test --config=avx --config=openmp \
Expand Down
8 changes: 7 additions & 1 deletion install/tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ FROM debian

# Install requirements
RUN apt-get update
RUN apt-get install -y python3-dev python3-pip
RUN apt-get install -y python3-dev python3-pip python3-venv
RUN apt-get install -y cmake git

# Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps.
RUN python3 -m venv test_env

# Activate venv.
ENV PATH="test_env/bin:$PATH"

COPY ./ /qsim/
RUN pip3 install /qsim/

Expand Down
16 changes: 12 additions & 4 deletions pybind_interface/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
FROM qsim

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

# The --force flag is used mainly so that the old numpy installation from pybind
# gets replaced with the one cirq requires
RUN pip3 install --prefer-binary cirq-core --force
# Create venv to avoid collision between system packages (e.g. numpy) and Cirq's deps.
RUN python3 -m venv test_env

# Activate venv.
ENV PATH="test_env/bin:$PATH"

# break-system-packages flag to override system packages (e.g. numpy) with Cirq's deps.
RUN pip3 install --prefer-binary cirq-core

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

# Install pytest
RUN pip3 install pytest

# Compile and run qsim tests
ENTRYPOINT make -C /qsim/ run-py-tests
Loading