mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Because some implementations, like OpenDAL does not work with AWS IMDSv2, but this script will bridge the gap and enables more recent `sccache` releases(that switched from simple-s3 to OpenDAL) to work in current CI system When launched it prints something like: ``` export AWS_ACCESS_KEY_ID=XXXXX export AWS_SECRET_ACCESS_KEY=YYYY export AWS_SESSION_TOKEN=ZZZZ ``` which can be `eval`ed and passed then sccache can use those failures. Validated in https://github.com/pytorch/pytorch/pull/121323 Pull Request resolved: https://github.com/pytorch/pytorch/pull/121426 Approved by: https://github.com/Skylion007
14 lines
405 B
Python
Executable File
14 lines
405 B
Python
Executable File
#!/usr/bin/env python3
|
|
import boto3 # type: ignore[import]
|
|
|
|
|
|
def main() -> None:
|
|
creds_dict = boto3.Session().get_credentials().get_frozen_credentials()._asdict()
|
|
print(f"export AWS_ACCESS_KEY_ID={creds_dict['access_key']}")
|
|
print(f"export AWS_SECRET_ACCESS_KEY={creds_dict['secret_key']}")
|
|
print(f"export AWS_SESSION_TOKEN={creds_dict['token']}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|