diff --git a/ci/build.py b/ci/build.py index 8798c7ed2ef2..a21ec44942a8 100755 --- a/ci/build.py +++ b/ci/build.py @@ -268,9 +268,9 @@ def load_docker_cache(tag, docker_registry) -> None: def log_environment(): - instance_id = ec2_instance_id_hostname() - if instance_id: - logging.info("EC2 Instance id: %s", instance_id) + instance_info = ec2_instance_info() + if instance_info: + logging.info("EC2: %s", instance_info) pp = pprint.PrettyPrinter(indent=4) logging.debug("Build environment: %s", pp.pformat(dict(os.environ))) diff --git a/ci/safe_docker_run.py b/ci/safe_docker_run.py index e3b55bccdff8..97ece4aecd2f 100755 --- a/ci/safe_docker_run.py +++ b/ci/safe_docker_run.py @@ -143,6 +143,7 @@ def run(self, *args, **kwargs) -> int: logging.info("Executed command for reproduction:\n\n%s\n", " ".join(sys.argv)) else: logging.info("Container exited with success 👍") + logging.info("Executed command for reproduction:\n\n%s\n", " ".join(sys.argv)) except Exception as err: logging.exception(err) return 150 diff --git a/ci/util.py b/ci/util.py index cd5665d04df8..a2dfe82bd377 100644 --- a/ci/util.py +++ b/ci/util.py @@ -94,11 +94,14 @@ def under_ci() -> bool: return 'JOB_NAME' in os.environ -def ec2_instance_id_hostname() -> str: +def ec2_instance_info() -> str: import requests if under_ci(): result = [] try: + r = requests.get("http://instance-data/latest/meta-data/instance-type") + if r.status_code == 200: + result.append(r.content.decode()) r = requests.get("http://instance-data/latest/meta-data/instance-id") if r.status_code == 200: result.append(r.content.decode())