Skip to content
Closed
Show file tree
Hide file tree
Changes from 15 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
15 changes: 13 additions & 2 deletions .github/workflows/ci_docker_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,19 @@
fetch-depth: 1
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Comment thread Fixed
Comment thread Fixed
Comment thread Fixed
with:
driver: docker

- name: Build Docker images
run: docker compose build
run: |
# Running locally, a plain "docker compose build" works as expected.
# On GitHub, buildx tries to build all 3 images in parallel even if
# you use env var COMPOSE_PARALLEL_LIMIT or option --parallel 1.
# The build then fails because the qsim-base image is not available
# to the other two build processes.
docker compose --parallel 1 build

- name: Run C++ tests
run: docker run --rm qsim-cxx-tests:latest
Expand All @@ -75,7 +86,7 @@
run: docker run --rm qsim-py-tests:latest

- name: Run a sample simulation
run: docker run --rm qsim:latest -c /qsim/circuits/circuit_q24
run: docker run --rm qsim-base:latest -c /qsim/circuits/circuit_q24

- name: Test installation process
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base OS
FROM ubuntu:24.04
FROM ubuntu:24.04 AS qsim-base

# Allow passing this variable in from the outside.
ARG CUDA_PATH
Expand Down
21 changes: 12 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
services:
qsim:
image: qsim
container_name: qsim
qsim-base-image:
image: qsim-base
platform: linux/amd64
build:
context: ./
dockerfile: Dockerfile
qsim-cxx-tests:
target: qsim-base

qsim-cxx-tests-image:
image: qsim-cxx-tests
container_name: qsim-cxx-tests
build:
context: ./
dockerfile: tests/Dockerfile
target: qsim-cxx-tests
depends_on:
- qsim
qsim-py-tests:
- qsim-base-image

qsim-py-tests-image:
image: qsim-py-tests
container_name: qsim-py-tests
build:
context: ./
dockerfile: pybind_interface/Dockerfile
target: qsim-py-tests
depends_on:
- qsim
- qsim-base-image
2 changes: 1 addition & 1 deletion pybind_interface/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base OS
FROM qsim
FROM qsim-base AS qsim-py-tests

# Copy relevant files
COPY ./pybind_interface/ /qsim/pybind_interface/
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base OS
FROM qsim
FROM qsim-base AS qsim-cxx-tests

# Copy relevant files
COPY ./tests/ /qsim/tests/
Expand Down
Loading