Skip to content

Commit

Permalink
Merge pull request #500 from golemfactory/km/stable-by-default
Browse files Browse the repository at this point in the history
Use stable releases by default
  • Loading branch information
kmazurek authored Apr 28, 2021
2 parents 29e21ac + 61e5bd8 commit 9be7631
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [#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 [#500](https://github.com/golemfactory/goth/pull/500)

## [0.2.3] - 2021-04-19

### Other changes
Expand Down
5 changes: 3 additions & 2 deletions goth/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 10 additions & 2 deletions goth/runner/download/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"]
)
Expand Down Expand Up @@ -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.
Expand All @@ -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. "
Expand Down
10 changes: 9 additions & 1 deletion scripts/download_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
)
4 changes: 2 additions & 2 deletions test/yagna/e2e/test_e2e_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9be7631

Please sign in to comment.