Skip to content

Commit

Permalink
Migrate to Docker Compose V2 (#328)
Browse files Browse the repository at this point in the history
* Migrate to Docker Compose V2

From https://docs.docker.com/compose/migrate/:

> From July 2023 Compose V1 stopped receiving updates. It’s also
> no longer available in new releases of Docker Desktop.

* Skip forging+serverless test within Docker test

Ref #108

* Fix test
  • Loading branch information
garrison authored Jul 17, 2023
1 parent 7b48a6b commit 38a3c12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ This workflow is triggered by a maintainer pushing a tag that represents a relea

## Docker (`docker.yml`)

This workflow runs periodically (weekly, at the time of writing) to ensure that the [`Dockerfile`](/Dockerfile) and [`docker-compose.yml`](/docker-compose.yml) files at the root of the repository result in a successful build with notebooks that execute without error.
This workflow runs periodically (weekly, at the time of writing) to ensure that the [`Dockerfile`](/Dockerfile) and [`compose.yaml`](/compose.yaml) files at the root of the repository result in a successful build with notebooks that execute without error.
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Docker notebook tests
on:
push:
branches: [ main ]
paths: ['Dockerfile', '.dockerignore', 'docker-compose.yml']
paths: ['Dockerfile', '.dockerignore', 'compose.yaml']
pull_request:
branches: [ main ]
paths: ['Dockerfile', '.dockerignore', 'docker-compose.yml']
paths: ['Dockerfile', '.dockerignore', 'compose.yaml']
schedule:
- cron: '0 20 * * 3'

Expand All @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker-compose build
run: docker compose build
- name: Test notebooks
shell: bash
run: docker-compose run notebook "bash" "-c" "pip install pytest nbmake && pytest --nbmake docs"
run: docker compose run notebook "bash" "-c" "pip install pytest nbmake && pytest --nbmake docs --ignore=docs/circuit-knitting-toolbox/entanglement_forging/tutorials/tutorial_2_forging_with_quantum_serverless.ipynb"
13 changes: 5 additions & 8 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,18 @@ Option 3: Use within Docker

We have provided a `Dockerfile <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/Dockerfile>`__, which can be used to
build a Docker image, as well as a
`docker-compose.yml <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/docker-compose.yml>`__ file, which allows one
to use the Docker image with just a few simple commands. If you have
Docker installed but not `Docker
Compose <https://pypi.org/project/docker-compose/>`__, the latter can be
installed by first running ``pip install docker-compose``.
`compose.yaml <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/compose.yaml>`__ file, which allows one
to use the Docker image with just a few simple commands.

.. code:: sh
git clone [email protected]:Qiskit-Extensions/circuit-knitting-toolbox.git
cd circuit-knitting-toolbox
docker-compose build
docker-compose up
docker compose build
docker compose up
Depending on your system configuration, you may need to type ``sudo``
before each ``docker-compose`` command.
before each ``docker compose`` command.

.. note::

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml → compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

services:
notebook:
build: .
Expand Down

0 comments on commit 38a3c12

Please sign in to comment.