diff --git a/poetry.lock b/poetry.lock index ad898e09..93497487 100644 --- a/poetry.lock +++ b/poetry.lock @@ -701,34 +701,34 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "41.0.2" +version = "41.0.3" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-41.0.2-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711"}, - {file = "cryptography-41.0.2-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83"}, - {file = "cryptography-41.0.2-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5"}, - {file = "cryptography-41.0.2-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58"}, - {file = "cryptography-41.0.2-cp37-abi3-win32.whl", hash = "sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76"}, - {file = "cryptography-41.0.2-cp37-abi3-win_amd64.whl", hash = "sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0"}, - {file = "cryptography-41.0.2.tar.gz", hash = "sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c"}, + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507"}, + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae"}, + {file = "cryptography-41.0.3-cp37-abi3-win32.whl", hash = "sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306"}, + {file = "cryptography-41.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4"}, + {file = "cryptography-41.0.3.tar.gz", hash = "sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34"}, ] [package.dependencies] diff --git a/src/algokit/cli/localnet.py b/src/algokit/cli/localnet.py index 8008b065..14cdc2a0 100644 --- a/src/algokit/cli/localnet.py +++ b/src/algokit/cli/localnet.py @@ -60,6 +60,8 @@ def localnet_group() -> None: def start_localnet() -> None: sandbox = ComposeSandbox() compose_file_status = sandbox.compose_file_status() + sandbox.check_docker_compose_for_new_image_versions() + if compose_file_status is ComposeFileStatus.MISSING: logger.debug("Sandbox compose file does not exist yet; writing it out for the first time") sandbox.write_compose_file() @@ -101,6 +103,9 @@ def reset_localnet(*, update: bool) -> None: sandbox.write_compose_file() if update: sandbox.pull() + else: + sandbox.check_docker_compose_for_new_image_versions() + sandbox.up() diff --git a/src/algokit/core/sandbox.py b/src/algokit/core/sandbox.py index 04b0bab5..9939b5a9 100644 --- a/src/algokit/core/sandbox.py +++ b/src/algokit/core/sandbox.py @@ -120,6 +120,55 @@ def ps(self, service_name: str | None = None) -> list[dict[str, Any]]: assert isinstance(data, list) return cast(list[dict[str, Any]], data) + def _get_local_image_version(self, image_name: str) -> str | None: + """ + Get the local version of a Docker image + """ + try: + arg = '{{index (split (index .RepoDigests 0) "@") 1}}' + local_version = run( + ["docker", "image", "inspect", image_name, "--format", arg], + cwd=self.directory, + bad_return_code_error_message="Failed to get image inspect", + ) + + return local_version.output.strip() + except Exception: + return None + + def _get_latest_image_version(self, image_name: str) -> str | None: + """ + Get the latest version of a Docker image from Docker Hub + """ + args = image_name.split(":") + name = args[0] + tag = args[1] if len(args) > 1 else "latest" + url = f"https://registry.hub.docker.com/v2/repositories/{name}/tags/{tag}" + try: + data = httpx.get(url=url) + return str(data.json()["digest"]) + except Exception as err: + logger.debug(f"Error checking indexer status: {err}", exc_info=True) + return None + + def is_image_up_to_date(self, image_name: str) -> bool: + local_version = self._get_local_image_version(image_name) + latest_version = self._get_latest_image_version(image_name) + return local_version is None or latest_version is None or local_version == latest_version + + def check_docker_compose_for_new_image_versions(self) -> None: + is_indexer_up_to_date = self.is_image_up_to_date(INDEXER_IMAGE) + if is_indexer_up_to_date is False: + logger.warning( + "indexer has a new version available, run `algokit localnet reset --update` to get the latest version" + ) + + is_algorand_up_to_date = self.is_image_up_to_date(ALGORAND_IMAGE) + if is_algorand_up_to_date is False: + logger.warning( + "algod has a new version available, run `algokit localnet reset --update` to get the latest version" + ) + DEFAULT_ALGOD_SERVER = "http://localhost" DEFAULT_ALGOD_TOKEN = "a" * 64 @@ -128,6 +177,8 @@ def ps(self, service_name: str | None = None) -> list[dict[str, Any]]: DEFAULT_WAIT_FOR_ALGOD = 60 DEFAULT_HEALTH_TIMEOUT = 1 ALGOD_HEALTH_URL = f"{DEFAULT_ALGOD_SERVER}:{DEFAULT_ALGOD_PORT}/v2/status" +INDEXER_IMAGE = "makerxau/algorand-indexer-dev:latest" +ALGORAND_IMAGE = "algorand/algod:latest" def _wait_for_algod() -> bool: @@ -171,7 +222,7 @@ def get_docker_compose_yml( services: algod: container_name: {name}_algod - image: algorand/algod:latest + image: {ALGORAND_IMAGE} ports: - {algod_port}:8080 - {kmd_port}:7833 @@ -188,7 +239,7 @@ def get_docker_compose_yml( indexer: container_name: {name}_indexer - image: makerxau/algorand-indexer-dev:latest + image: {INDEXER_IMAGE} ports: - {indexer_port}:8980 restart: unless-stopped diff --git a/tests/localnet/conftest.py b/tests/localnet/conftest.py index 13f4f772..65f5b628 100644 --- a/tests/localnet/conftest.py +++ b/tests/localnet/conftest.py @@ -1,8 +1,10 @@ import pytest -from algokit.core.sandbox import ALGOD_HEALTH_URL +from algokit.core.sandbox import ALGOD_HEALTH_URL, ALGORAND_IMAGE, INDEXER_IMAGE from pytest_httpx import HTTPXMock from pytest_mock import MockerFixture +from tests.utils.proc_mock import ProcMock + @pytest.fixture(autouse=True) def algod_health_fast_timings(mocker: MockerFixture) -> None: # noqa: ignore[PT004] @@ -13,3 +15,31 @@ def algod_health_fast_timings(mocker: MockerFixture) -> None: # noqa: ignore[PT @pytest.fixture() def health_success(httpx_mock: HTTPXMock) -> None: # noqa: ignore[PT004] httpx_mock.add_response(url=ALGOD_HEALTH_URL) + + +@pytest.fixture() +def _localnet_up_to_date(proc_mock: ProcMock, httpx_mock: HTTPXMock) -> None: + arg = '{{index (split (index .RepoDigests 0) "@") 1}}' + proc_mock.set_output( + ["docker", "image", "inspect", ALGORAND_IMAGE, "--format", arg], + ["sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"], + ) + + proc_mock.set_output( + ["docker", "image", "inspect", INDEXER_IMAGE, "--format", arg], + ["sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n"], + ) + + httpx_mock.add_response( + url="https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest", + json={ + "digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + }, + ) + + httpx_mock.add_response( + url="https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest", + json={ + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + }, + ) diff --git a/tests/localnet/test_localnet_reset.py b/tests/localnet/test_localnet_reset.py index e53d3164..63931d4d 100644 --- a/tests/localnet/test_localnet_reset.py +++ b/tests/localnet/test_localnet_reset.py @@ -22,7 +22,7 @@ def test_localnet_reset_without_existing_sandbox(app_dir_mock: AppDirs) -> None: ) -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_reset_with_existing_sandbox_with_out_of_date_config(app_dir_mock: AppDirs) -> None: (app_dir_mock.app_config_dir / "sandbox").mkdir() (app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text("out of date config") @@ -44,7 +44,7 @@ def test_localnet_reset_with_existing_sandbox_with_out_of_date_config(app_dir_mo ) -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_reset_with_existing_sandbox_with_up_to_date_config(app_dir_mock: AppDirs) -> None: (app_dir_mock.app_config_dir / "sandbox").mkdir() (app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text(get_docker_compose_yml()) diff --git a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt index 4072659b..8560e307 100644 --- a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt +++ b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt @@ -8,6 +8,12 @@ DEBUG: Running 'docker compose down' in '{app_config}/sandbox' DEBUG: docker: STDOUT DEBUG: docker: STDERR Sandbox definition is out of date; updating it to latest +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' docker: STDOUT diff --git a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_up_to_date_config.approved.txt b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_up_to_date_config.approved.txt index b1dbd83a..da1f580f 100644 --- a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_up_to_date_config.approved.txt +++ b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_up_to_date_config.approved.txt @@ -7,6 +7,12 @@ Deleting any existing LocalNet... DEBUG: Running 'docker compose down' in '{app_config}/sandbox' DEBUG: docker: STDOUT DEBUG: docker: STDERR +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' docker: STDOUT diff --git a/tests/localnet/test_localnet_start.py b/tests/localnet/test_localnet_start.py index 8ecc9199..16ad371c 100644 --- a/tests/localnet/test_localnet_start.py +++ b/tests/localnet/test_localnet_start.py @@ -2,7 +2,13 @@ import httpx import pytest -from algokit.core.sandbox import ALGOD_HEALTH_URL, get_config_json, get_docker_compose_yml +from algokit.core.sandbox import ( + ALGOD_HEALTH_URL, + ALGORAND_IMAGE, + INDEXER_IMAGE, + get_config_json, + get_docker_compose_yml, +) from pytest_httpx import HTTPXMock from tests import get_combined_verify_output @@ -12,7 +18,42 @@ from tests.utils.proc_mock import ProcMock -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.fixture() +def _localnet_out_of_date(proc_mock: ProcMock, httpx_mock: HTTPXMock) -> None: + arg = '{{index (split (index .RepoDigests 0) "@") 1}}' + proc_mock.set_output( + ["docker", "image", "inspect", ALGORAND_IMAGE, "--format", arg], + ["sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n"], + ) + + proc_mock.set_output( + ["docker", "image", "inspect", INDEXER_IMAGE, "--format", arg], + ["sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"], + ) + + httpx_mock.add_response( + url="https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest", + json={ + "digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + }, + ) + + httpx_mock.add_response( + url="https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest", + json={ + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + }, + ) + + +@pytest.fixture() +def _localnet_img_check_cmd_error(proc_mock: ProcMock) -> None: + arg = '{{index (split (index .RepoDigests 0) "@") 1}}' + proc_mock.should_fail_on(["docker", "image", "inspect", ALGORAND_IMAGE, "--format", arg]) + proc_mock.should_fail_on(["docker", "image", "inspect", INDEXER_IMAGE, "--format", arg]) + + +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_start(app_dir_mock: AppDirs) -> None: result = invoke("localnet start") @@ -26,7 +67,7 @@ def test_localnet_start(app_dir_mock: AppDirs) -> None: ) -@pytest.mark.usefixtures("proc_mock") +@pytest.mark.usefixtures("proc_mock", "_localnet_up_to_date") def test_localnet_start_health_failure(app_dir_mock: AppDirs, httpx_mock: HTTPXMock) -> None: httpx_mock.add_exception(httpx.RemoteProtocolError("No response"), url=ALGOD_HEALTH_URL) result = invoke("localnet start") @@ -41,7 +82,7 @@ def test_localnet_start_health_failure(app_dir_mock: AppDirs, httpx_mock: HTTPXM ) -@pytest.mark.usefixtures("proc_mock") +@pytest.mark.usefixtures("proc_mock", "_localnet_up_to_date") def test_localnet_start_health_bad_status(app_dir_mock: AppDirs, httpx_mock: HTTPXMock) -> None: httpx_mock.add_response(status_code=500, url=ALGOD_HEALTH_URL) result = invoke("localnet start") @@ -56,6 +97,7 @@ def test_localnet_start_health_bad_status(app_dir_mock: AppDirs, httpx_mock: HTT ) +@pytest.mark.usefixtures("_localnet_up_to_date") def test_localnet_start_failure(app_dir_mock: AppDirs, proc_mock: ProcMock) -> None: proc_mock.should_bad_exit_on("docker compose up") @@ -65,7 +107,7 @@ def test_localnet_start_failure(app_dir_mock: AppDirs, proc_mock: ProcMock) -> N verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_start_up_to_date_definition(app_dir_mock: AppDirs) -> None: (app_dir_mock.app_config_dir / "sandbox").mkdir() (app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text(get_docker_compose_yml()) @@ -77,7 +119,7 @@ def test_localnet_start_up_to_date_definition(app_dir_mock: AppDirs) -> None: verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_start_out_of_date_definition(app_dir_mock: AppDirs) -> None: (app_dir_mock.app_config_dir / "sandbox").mkdir() (app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text("out of date config") @@ -99,7 +141,7 @@ def test_localnet_start_out_of_date_definition(app_dir_mock: AppDirs) -> None: ) -@pytest.mark.usefixtures("proc_mock", "health_success") +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_up_to_date") def test_localnet_start_out_of_date_definition_and_missing_config(app_dir_mock: AppDirs) -> None: (app_dir_mock.app_config_dir / "sandbox").mkdir() (app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text("out of date config") @@ -158,7 +200,7 @@ def test_localnet_start_with_old_docker_compose_version(proc_mock: ProcMock) -> verify(result.output) -@pytest.mark.usefixtures("health_success") +@pytest.mark.usefixtures("health_success", "_localnet_up_to_date") def test_localnet_start_with_unparseable_docker_compose_version(app_dir_mock: AppDirs, proc_mock: ProcMock) -> None: proc_mock.set_output("docker compose version --format json", [json.dumps({"version": "v2.5-dev123"})]) @@ -168,7 +210,7 @@ def test_localnet_start_with_unparseable_docker_compose_version(app_dir_mock: Ap verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) -@pytest.mark.usefixtures("health_success") +@pytest.mark.usefixtures("health_success", "_localnet_up_to_date") def test_localnet_start_with_gitpod_docker_compose_version(app_dir_mock: AppDirs, proc_mock: ProcMock) -> None: proc_mock.set_output("docker compose version --format json", [json.dumps({"version": "v2.10.0-gitpod.0"})]) @@ -176,3 +218,19 @@ def test_localnet_start_with_gitpod_docker_compose_version(app_dir_mock: AppDirs assert result.exit_code == 0 verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) + + +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_out_of_date") +def test_localnet_start_out_date(app_dir_mock: AppDirs) -> None: + result = invoke("localnet start") + + assert result.exit_code == 0 + verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) + + +@pytest.mark.usefixtures("proc_mock", "health_success", "_localnet_img_check_cmd_error") +def test_localnet_img_check_cmd_error(app_dir_mock: AppDirs) -> None: + result = invoke("localnet start") + + assert result.exit_code == 0 + verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/")) diff --git a/tests/localnet/test_localnet_start.test_localnet_img_check_cmd_error.approved.txt b/tests/localnet/test_localnet_start.test_localnet_img_check_cmd_error.approved.txt new file mode 100644 index 00000000..2e34cd0e --- /dev/null +++ b/tests/localnet/test_localnet_start.test_localnet_img_check_cmd_error.approved.txt @@ -0,0 +1,21 @@ +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.5.0"} +DEBUG: Running 'docker version' in '{current_working_directory}' +DEBUG: docker: STDOUT +DEBUG: docker: STDERR +DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: Error checking indexer status: No response can be found for GET request on https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest amongst: +Match all requests on http://localhost:4001/v2/status +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: Error checking indexer status: No response can be found for GET request on https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest amongst: +Match all requests on http://localhost:4001/v2/status +DEBUG: Sandbox compose file does not exist yet; writing it out for the first time +Starting AlgoKit LocalNet now... +DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' +docker: STDOUT +docker: STDERR +DEBUG: AlgoKit LocalNet started, waiting for health check +DEBUG: HTTP Request: GET http://localhost:4001/v2/status "HTTP/1.1 200 OK" +DEBUG: AlgoKit LocalNet health check successful, algod is ready +Started; execute `algokit explore` to explore LocalNet in a web user interface. diff --git a/tests/localnet/test_localnet_start.test_localnet_start.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start.approved.txt index 4e1752a2..a7b02d69 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start.approved.txt @@ -4,6 +4,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_failure.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_failure.approved.txt index f7e79781..c8ca0fe8 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_failure.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_failure.approved.txt @@ -4,6 +4,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt index 715cbfbb..a9d157b3 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt @@ -4,6 +4,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt index f2df9504..27baff7f 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt @@ -4,6 +4,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_out_date.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_out_date.approved.txt new file mode 100644 index 00000000..a0f02ff6 --- /dev/null +++ b/tests/localnet/test_localnet_start.test_localnet_start_out_date.approved.txt @@ -0,0 +1,23 @@ +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.5.0"} +DEBUG: Running 'docker version' in '{current_working_directory}' +DEBUG: docker: STDOUT +DEBUG: docker: STDERR +DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +WARNING: indexer has a new version available, run `algokit localnet reset --update` to get the latest version +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" +WARNING: algod has a new version available, run `algokit localnet reset --update` to get the latest version +DEBUG: Sandbox compose file does not exist yet; writing it out for the first time +Starting AlgoKit LocalNet now... +DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' +docker: STDOUT +docker: STDERR +DEBUG: AlgoKit LocalNet started, waiting for health check +DEBUG: HTTP Request: GET http://localhost:4001/v2/status "HTTP/1.1 200 OK" +DEBUG: AlgoKit LocalNet health check successful, algod is ready +Started; execute `algokit explore` to explore LocalNet in a web user interface. diff --git a/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition.approved.txt index 3fa1dbc6..5797c259 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition.approved.txt @@ -3,6 +3,12 @@ DEBUG: docker: {"version": "v2.5.0"} DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" WARNING: Sandbox definition is out of date; please run algokit localnet reset Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition_and_missing_config.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition_and_missing_config.approved.txt index c5f8ee29..1e5e1ea5 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition_and_missing_config.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_out_of_date_definition_and_missing_config.approved.txt @@ -3,6 +3,12 @@ DEBUG: docker: {"version": "v2.5.0"} DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" WARNING: Sandbox definition is out of date; please run algokit localnet reset Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_up_to_date_definition.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_up_to_date_definition.approved.txt index 95dd4d7c..a69b9907 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_up_to_date_definition.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_up_to_date_definition.approved.txt @@ -3,6 +3,12 @@ DEBUG: docker: {"version": "v2.5.0"} DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not require updating Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_with_gitpod_docker_compose_version.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_with_gitpod_docker_compose_version.approved.txt index 7aa5152a..1ea88d52 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_with_gitpod_docker_compose_version.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_with_gitpod_docker_compose_version.approved.txt @@ -4,6 +4,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox' diff --git a/tests/localnet/test_localnet_start.test_localnet_start_with_unparseable_docker_compose_version.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_with_unparseable_docker_compose_version.approved.txt index 95a7b9f1..3d15a939 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_with_unparseable_docker_compose_version.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_with_unparseable_docker_compose_version.approved.txt @@ -7,6 +7,12 @@ DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT DEBUG: docker: STDERR DEBUG: Sandbox directory does not exist yet; creating it +DEBUG: Running 'docker image inspect makerxau/algorand-indexer-dev:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxau/algorand-indexer-dev/tags/latest "HTTP/1.1 200 OK" +DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (split (index .RepoDigests 0) "@") 1}}' in '{app_config}/sandbox' +DEBUG: docker: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/algorand/algod/tags/latest "HTTP/1.1 200 OK" DEBUG: Sandbox compose file does not exist yet; writing it out for the first time Starting AlgoKit LocalNet now... DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox'