From 63fa726c72595250064fcfe12e9828d598513619 Mon Sep 17 00:00:00 2001 From: Kuba Mazurek Date: Tue, 27 Apr 2021 15:52:36 +0200 Subject: [PATCH 1/3] Use stable releases by default --- CHANGELOG.md | 12 ++++++++++++ goth/runner/download/__init__.py | 12 ++++++++++-- scripts/download_release.py | 10 +++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a264ea545..6ed094924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,18 @@ ### Other changes +## [0.2.4] - 2021-04-27 + +### Features +- added optional `extra_monitors` parameter to `Runner#check_assertion_errors` [#495](https://github.com/golemfactory/goth/pull/495) +- added the `--unstable` option to release downloader script [#496](https://github.com/golemfactory/goth/pull/496) + +### Bugfixes +- fixed reporting of assertion success and failure in `EventMonitor` [#495](https://github.com/golemfactory/goth/pull/495) + +### Other changes +- changed the `yagna` Docker image builder to use stable releases by default [#496](https://github.com/golemfactory/goth/pull/496) + ## [0.2.3] - 2021-04-19 ### Other changes diff --git a/goth/runner/download/__init__.py b/goth/runner/download/__init__.py index 9b944a597..4373baa1d 100644 --- a/goth/runner/download/__init__.py +++ b/goth/runner/download/__init__.py @@ -217,7 +217,10 @@ def __init__(self, repo: str, *args, **kwargs): self.repo_name = repo def _get_latest_release( - self, tag_substring: str, content_type: str + self, + tag_substring: str, + content_type: str, + use_unstable: bool = False, ) -> Optional[dict]: """Get the latest version, this includes pre-releases. @@ -228,6 +231,9 @@ def _get_latest_release( logger.debug("releases=%s", json.dumps(obj2dict(all_releases))) def release_filter(release: dict, tag_substring: str) -> bool: + if not use_unstable and release["prerelease"]: + return False + has_matching_asset = any( asset["content_type"] == content_type for asset in release["assets"] ) @@ -270,6 +276,7 @@ def download( content_type: str = DEFAULT_CONTENT_TYPE, output: Optional[Path] = None, tag_substring: str = "", + use_unstable: bool = False, ) -> Path: """Download the latest release (or pre-release) from a given GitHub repo. @@ -280,8 +287,9 @@ def download( :param content_type: content-type string for the asset to download :param output: file path to where the asset should be saved :param tag_substring: substring the release's tag name must contain + :param use_unstable: if True, pre-releases will be included """ - release = self._get_latest_release(tag_substring, content_type) + release = self._get_latest_release(tag_substring, content_type, use_unstable) if not release: raise AssetNotFound( f"Could not find release. " diff --git a/scripts/download_release.py b/scripts/download_release.py index 694ed9093..143aafe93 100755 --- a/scripts/download_release.py +++ b/scripts/download_release.py @@ -24,6 +24,12 @@ help="Output path, may be either a file or a directory.", type=Path, ) +parser.add_argument( + "-u", + "--unstable", + help="If set, pre-releases will be included.", + action="store_true", +) parser.add_argument("-t", "--token", default=DEFAULT_TOKEN) parser.add_argument( "-v", "--verbose", help="If set, enables debug logging.", action="store_true" @@ -40,4 +46,6 @@ if __name__ == "__main__": args = parser.parse_args() downloader = ReleaseDownloader(args.repo, token=args.token, verbose=args.verbose) - downloader.download(args.name, args.content_type, args.output, args.tag) + downloader.download( + args.name, args.content_type, args.output, args.tag, args.unstable + ) From 3c2e9efad59c9a961bc7a23d866728455dc78f30 Mon Sep 17 00:00:00 2001 From: Kuba Mazurek Date: Tue, 27 Apr 2021 17:34:30 +0200 Subject: [PATCH 2/3] Update package repository URL in VM test --- CHANGELOG.md | 4 ++-- test/yagna/e2e/test_e2e_vm.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed094924..2b7095e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,13 @@ ### Features - added optional `extra_monitors` parameter to `Runner#check_assertion_errors` [#495](https://github.com/golemfactory/goth/pull/495) -- added the `--unstable` option to release downloader script [#496](https://github.com/golemfactory/goth/pull/496) +- added the `--unstable` option to release downloader script [#500](https://github.com/golemfactory/goth/pull/500) ### Bugfixes - fixed reporting of assertion success and failure in `EventMonitor` [#495](https://github.com/golemfactory/goth/pull/495) ### Other changes -- changed the `yagna` Docker image builder to use stable releases by default [#496](https://github.com/golemfactory/goth/pull/496) +- changed the `yagna` Docker image builder to use stable releases by default [#500](https://github.com/golemfactory/goth/pull/500) ## [0.2.3] - 2021-04-19 diff --git a/test/yagna/e2e/test_e2e_vm.py b/test/yagna/e2e/test_e2e_vm.py index 35767dfa8..07cd2dc0a 100644 --- a/test/yagna/e2e/test_e2e_vm.py +++ b/test/yagna/e2e/test_e2e_vm.py @@ -83,7 +83,7 @@ async def test_e2e_vm_success( async with runner(topology): task_package = ( "hash:sha3:9a3b5d67b0b27746283cb5f287c13eab1beaa12d92a9f536b747c7ae:" - "http://3.249.139.167:8000/local-image-c76719083b.gvmi" + "http://yacn2.dev.golem.network:8000/local-image-c76719083b.gvmi" ) output_file = "out0000.png" From 61e5bd89c3b14be1478886105a7c41fbd50b1a5d Mon Sep 17 00:00:00 2001 From: Kuba Mazurek Date: Wed, 28 Apr 2021 14:56:36 +0200 Subject: [PATCH 3/3] Adjust cyclic broadcast intervals --- goth/node.py | 5 +++-- test/yagna/e2e/test_e2e_vm.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/goth/node.py b/goth/node.py index 92f47b807..2edf2ac75 100644 --- a/goth/node.py +++ b/goth/node.py @@ -23,8 +23,9 @@ def node_environment( "CENTRAL_NET_HOST": f"{ROUTER_HOST}:{ROUTER_PORT}", "ERC20_RINKEBY_GETH_ADDR": "http://ethereum:8545", "GSB_URL": YAGNA_BUS_URL.substitute(host="0.0.0.0"), - "MEAN_CYCLIC_BCAST_INTERVAL": "10s", - "MEAN_CYCLIC_UNSUBSCRIBES_INTERVAL": "10s", + "IDLE_AGREEMENT_TIMEOUT": "600s", + "MEAN_CYCLIC_BCAST_INTERVAL": "5s", + "MEAN_CYCLIC_UNSUBSCRIBES_INTERVAL": "5s", "REQUIRED_CONFIRMATIONS": "1", "RINKEBY_TGLM_CONTRACT_ADDRESS": "0xFDFEF9D10d929cB3905C71400ce6be1990EA0F34", "RUST_BACKTRACE": "1", diff --git a/test/yagna/e2e/test_e2e_vm.py b/test/yagna/e2e/test_e2e_vm.py index 07cd2dc0a..fe022e0bf 100644 --- a/test/yagna/e2e/test_e2e_vm.py +++ b/test/yagna/e2e/test_e2e_vm.py @@ -149,7 +149,7 @@ async def test_e2e_vm_success( await provider.wait_for_exeunit_started() batch_id = await requestor.call_exec(activity_id, json.dumps(exe_script)) await requestor.collect_results( - activity_id, batch_id, num_commands, timeout=300 + activity_id, batch_id, num_commands, timeout=600 ) await requestor.destroy_activity(activity_id) await provider.wait_for_exeunit_finished()