Skip to content
Closed
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: 8 additions & 2 deletions .github/workflows/ci_docker_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ jobs:
submodules: recursive

- 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 set COMPOSE_PARALLEL_LIMIT or use --parallel 1. That fails b/c
# the qsim-base image is not available to the other two build jobs.
docker compose build qsim-base-image
docker compose build qsim-cxx-tests-image qsim-py-tests-image

- name: Run C++ tests
run: docker run --rm qsim-cxx-tests:latest
Expand All @@ -75,7 +81,7 @@ jobs:
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