Skip to content

Commit

Permalink
fix Docker and Bazel CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
NoureldinYosri committed Oct 5, 2023
1 parent 235ae2f commit 5fff1a5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
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

0 comments on commit 5fff1a5

Please sign in to comment.