Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use CI_E2E_FILENAME in s3 prefix #1255

Merged
merged 2 commits into from
Oct 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions misc/e2elive.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ def main():
from botocore.config import Config
from botocore import UNSIGNED
s3 = boto3.client("s3", config=Config(signature_version=UNSIGNED))
prefix = "indexer/e2e4"
if "/" in tarname:
tarname = tarname.split("/")[1]
cmhash_tarnme = tarname.split("/")
cmhash = cmhash_tarnme[0]
tarname =cmhash_tarnme[1]
prefix+="/"+cmhash
tarpath = os.path.join(tempdir, tarname)
Copy link
Contributor

@winder winder Oct 3, 2022

Choose a reason for hiding this comment

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

Could you elaborate on whats happening here?

If I'm reading right it looks like this supports tarname with one slash in it. Should we support multiple slashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is for parsing string like fafa8862/rel-nightly and creating the correct prefix. boto3 client isn't able to find a file named fafa8862/rel-nightly.tar.bz2 ats3://algorand-testdata/indexer/e2e4/${RSTAMP}. So, we need to provide it the exact s3 folder path, s3://algorand-testdata/indexer/e2e4/${RSTAMP}/fafa8862, and the tarname rel-nightly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's possible to support filenames with / without having to update the prefix.

else:
tarpath = os.path.join(tempdir, tarname)
prefix = "indexer/e2e4"

success = firstFromS3Prefix(s3, bucket, prefix, tarname, outpath=tarpath)
if not success:
raise Exception(
Expand Down Expand Up @@ -203,7 +207,7 @@ def countblocks(path):
return row[0]


def tryhealthurl(healthurl, verbose=False, waitforround=100):
def tryhealthurl(healthurl, verbose=False, waitforround=200):
try:
response = urllib.request.urlopen(healthurl)
if response.code != 200:
Expand Down