From 38a3c12071450f880d53efdaa733710619e18c2a Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Mon, 17 Jul 2023 15:57:54 -0400 Subject: [PATCH] Migrate to Docker Compose V2 (#328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .github/workflows/README.md | 2 +- .github/workflows/docker.yml | 8 ++++---- INSTALL.rst | 13 +++++-------- docker-compose.yml => compose.yaml | 2 -- 4 files changed, 10 insertions(+), 15 deletions(-) rename docker-compose.yml => compose.yaml (95%) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 9b442a6f9..96c575fda 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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. diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 78ebfa31b..c0ceb0caa 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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' @@ -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" diff --git a/INSTALL.rst b/INSTALL.rst index 7b09aef83..f6dd121c7 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -122,21 +122,18 @@ Option 3: Use within Docker We have provided a `Dockerfile `__, which can be used to build a Docker image, as well as a -`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 `__, the latter can be -installed by first running ``pip install docker-compose``. +`compose.yaml `__ file, which allows one +to use the Docker image with just a few simple commands. .. code:: sh git clone git@github.com: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:: diff --git a/docker-compose.yml b/compose.yaml similarity index 95% rename from docker-compose.yml rename to compose.yaml index 9c93ff0d1..2b70ab8d1 100644 --- a/docker-compose.yml +++ b/compose.yaml @@ -1,5 +1,3 @@ -version: "3.4" - services: notebook: build: .