Skip to content

Commit

Permalink
chore: renaming sandbox log outputs to localnet (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev authored Oct 17, 2023
1 parent 0bc7c06 commit d3b4554
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/algokit/cli/goal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def goal_command(*, console: bool, goal_args: list[str]) -> None:
sandbox = ComposeSandbox()
compose_file_status = sandbox.compose_file_status()
if compose_file_status is not ComposeFileStatus.UP_TO_DATE:
raise click.ClickException("Sandbox definition is out of date; please run `algokit localnet reset` first!")
raise click.ClickException("LocalNet definition is out of date; please run `algokit localnet reset` first!")

if console:
if goal_args:
Expand Down
10 changes: 5 additions & 5 deletions src/algokit/cli/localnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def start_localnet() -> None:
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")
logger.debug("LocalNet compose file does not exist yet; writing it out for the first time")
sandbox.write_compose_file()
elif compose_file_status is ComposeFileStatus.UP_TO_DATE:
logger.debug("Sandbox compose file does not require updating")
logger.debug("LocalNet compose file does not require updating")
else:
logger.warning("Sandbox definition is out of date; please run algokit localnet reset")
logger.warning("LocalNet definition is out of date; please run algokit localnet reset")
sandbox.up()


Expand All @@ -78,7 +78,7 @@ def stop_localnet() -> None:
compose_file_status = sandbox.compose_file_status()
if compose_file_status is ComposeFileStatus.MISSING:
logger.debug(
"Sandbox compose file does not exist yet; run `algokit localnet start` to start the AlgoKit LocalNet"
"LocalNet compose file does not exist yet; run `algokit localnet start` to start the AlgoKit LocalNet"
)
else:
sandbox.stop()
Expand All @@ -99,7 +99,7 @@ def reset_localnet(*, update: bool) -> None:
else:
sandbox.down()
if compose_file_status is not ComposeFileStatus.UP_TO_DATE:
logger.info("Sandbox definition is out of date; updating it to latest")
logger.info("LocalNet definition is out of date; updating it to latest")
sandbox.write_compose_file()
if update:
sandbox.pull()
Expand Down
4 changes: 2 additions & 2 deletions src/algokit/core/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ def up(self) -> None:
def stop(self) -> None:
logger.info("Stopping AlgoKit LocalNet now...")
self._run_compose_command("stop", bad_return_code_error_message="Failed to stop LocalNet")
logger.info("Sandbox Stopped; execute `algokit localnet start` to start it again.")
logger.info("LocalNet Stopped; execute `algokit localnet start` to start it again.")

def down(self) -> None:
logger.info("Deleting any existing LocalNet...")
self._run_compose_command("down", stdout_log_level=logging.DEBUG)

def pull(self) -> None:
logger.info("Looking for latest Sandbox images from DockerHub...")
logger.info("Fetching any container updates from DockerHub...")
self._run_compose_command("pull --ignore-pull-failures --quiet")

def logs(self, *, follow: bool = False, no_color: bool = False, tail: str | None = None) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DEBUG: Running 'docker version' in '{current_working_directory}'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
Error: Sandbox definition is out of date; please run `algokit localnet reset` first!
Error: LocalNet definition is out of date; please run `algokit localnet reset` first!
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deleting any existing LocalNet...
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
LocalNet 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deleting any existing LocalNet...
DEBUG: Running 'docker compose down' in '{app_config}/sandbox'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
Looking for latest Sandbox images from DockerHub...
Fetching any container updates from DockerHub...
DEBUG: Running 'docker compose pull --ignore-pull-failures --quiet' in '{app_config}/sandbox'
docker: STDOUT
docker: STDERR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DEBUG: Running 'docker image inspect algorand/algod:latest --format {{index (spl
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
WARNING: LocalNet 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'
docker: STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
WARNING: LocalNet 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'
docker: STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet compose file does not require updating
Starting AlgoKit LocalNet now...
DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox'
docker: STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DEBUG: HTTP Request: GET https://registry.hub.docker.com/v2/repositories/makerxa
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
DEBUG: LocalNet 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Stopping AlgoKit LocalNet now...
DEBUG: Running 'docker compose stop' in '{app_config}/sandbox'
docker: STDOUT
docker: STDERR
Sandbox Stopped; execute `algokit localnet start` to start it again.
LocalNet Stopped; execute `algokit localnet start` to start it again.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ DEBUG: Running 'docker version' in '{current_working_directory}'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
DEBUG: Sandbox directory does not exist yet; creating it
DEBUG: Sandbox compose file does not exist yet; run `algokit localnet start` to start the AlgoKit LocalNet
DEBUG: LocalNet compose file does not exist yet; run `algokit localnet start` to start the AlgoKit LocalNet

1 comment on commit d3b4554

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py220%1–3
src/algokit/cli
   completions.py105298%80, 95
   deploy.py56591%34–36, 78, 96
   dispenser.py116199%74
   doctor.py48394%142–144
   generate.py57198%116
   goal.py39197%57
   init.py1901692%272–273, 323, 326–328, 339, 383, 409, 449, 458–460, 463–468, 481
   localnet.py93397%162, 183–184
src/algokit/core
   bootstrap.py1612485%103–104, 126, 149, 214, 217, 223–237, 246–251
   conf.py54885%10, 24, 28, 36, 38, 71–73
   deploy.py691184%61–64, 73–75, 79, 84, 91–93
   dispenser.py2022687%88, 120–121, 138–146, 188–189, 195–197, 215–216, 256–257, 315, 329–331, 342–343, 353, 366, 381
   doctor.py65789%67–69, 92–94, 134
   generate.py41295%68, 86
   goal.py56395%27–28, 38
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py1811592%100–107, 118, 278, 294, 309–311, 327
   typed_client_generation.py80594%55–57, 70, 75
   utils.py18289%27–28
   version_prompt.py73889%27–28, 40, 59–62, 80, 109
TOTAL199016092% 

Tests Skipped Failures Errors Time
285 0 💤 0 ❌ 0 🔥 27.234s ⏱️

Please sign in to comment.