Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init-local' at Tue, 15 Feb 2022 20:50:34 +0000. Up 7.12 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init' at Tue, 15 Feb 2022 20:50:38 +0000. Up 10.27 seconds. ci-info: ++++++++++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++++++++ ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: | Device | Up | Address | Mask | Scope | Hw-Address | ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: | eth0 | True | 172.31.3.217 | 255.255.240.0 | global | 02:41:ec:31:dc:24 | ci-info: | eth0 | True | fe80::41:ecff:fe31:dc24/64 | . | link | 02:41:ec:31:dc:24 | ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . | ci-info: | lo | True | ::1/128 | . | host | . | ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: +++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++ ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: | 0 | 0.0.0.0 | 172.31.0.1 | 0.0.0.0 | eth0 | UG | ci-info: | 1 | 172.31.0.0 | 0.0.0.0 | 255.255.240.0 | eth0 | U | ci-info: | 2 | 172.31.0.1 | 0.0.0.0 | 255.255.255.255 | eth0 | UH | ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | Route | Destination | Gateway | Interface | Flags | ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | 1 | fe80::/64 | :: | eth0 | U | ci-info: | 3 | local | :: | eth0 | U | ci-info: | 4 | multicast | :: | eth0 | U | ci-info: +-------+-------------+---------+-----------+-------+ Generating public/private rsa key pair. Your identification has been saved in /etc/ssh/ssh_host_rsa_key Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub The key fingerprint is: SHA256:MyqAfKziPs52tEBnt5sUifqk/GUmBo6HTQcV9Y04PYg root@ip-172-31-3-217 The key's randomart image is: +---[RSA 3072]----+ | oo. | | . . = o | | . E = = . | |.o.= + . . | |oo*oo o S | |o*+= o . o | |=oOo+++ | |+*.+=+ | |+=+. | +----[SHA256]-----+ Generating public/private dsa key pair. Your identification has been saved in /etc/ssh/ssh_host_dsa_key Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub The key fingerprint is: SHA256:Bwysn/CzqGF/x55oUeXxAnGnJBGMFRzWrtkCQUoH2vM root@ip-172-31-3-217 The key's randomart image is: +---[DSA 1024]----+ | o++=XBo . | | + o+++++o | | . +. .o=.o | | oo. ..+ . | | +E+S+.. | | * +.. | | o . = . | | . o. +.o. | | ...o.oo | +----[SHA256]-----+ Generating public/private ecdsa key pair. Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub The key fingerprint is: SHA256:p9SwuaP0musrotSIwGRw/fMjp5rXJkOhyOq95jWPkdw root@ip-172-31-3-217 The key's randomart image is: +---[ECDSA 256]---+ |. .. | |.. . | | o . . | |+ + = | |.o . . +S o | |o = o =.++ | |.+ . B.E+. | |o o.ooX+o. | |ooo=+*BO. | +----[SHA256]-----+ Generating public/private ed25519 key pair. Your identification has been saved in /etc/ssh/ssh_host_ed25519_key Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub The key fingerprint is: SHA256:RWbGcj8Xv5cI0yzFDEsYCvf+fGmh+yLK0QSsqbcZ+6c root@ip-172-31-3-217 The key's randomart image is: +--[ED25519 256]--+ | . . oBo+ | | + +*+ .+. | | + +.o+ o | | o o. +oo. .| | o So ++. o| | . o o ..oo.| | . o . . + + .| | . * .o .+ | | +.E+ ..o. | +----[SHA256]-----+ Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:config' at Tue, 15 Feb 2022 20:50:50 +0000. Up 22.31 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:final' at Tue, 15 Feb 2022 20:50:52 +0000. Up 25.02 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 finished at Tue, 15 Feb 2022 20:50:53 +0000. Datasource DataSourceEc2Local. Up 25.62 seconds Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init-local' at Sun, 11 Aug 2024 21:38:44 +0000. Up 6.02 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init' at Sun, 11 Aug 2024 21:38:46 +0000. Up 8.53 seconds. ci-info: ++++++++++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++++++++ ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: | Device | Up | Address | Mask | Scope | Hw-Address | ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: | eth0 | True | 172.31.8.36 | 255.255.240.0 | global | 02:10:dd:8a:e4:ef | ci-info: | eth0 | True | fe80::10:ddff:fe8a:e4ef/64 | . | link | 02:10:dd:8a:e4:ef | ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . | ci-info: | lo | True | ::1/128 | . | host | . | ci-info: +--------+------+----------------------------+---------------+--------+-------------------+ ci-info: +++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++ ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: | 0 | 0.0.0.0 | 172.31.0.1 | 0.0.0.0 | eth0 | UG | ci-info: | 1 | 172.31.0.0 | 0.0.0.0 | 255.255.240.0 | eth0 | U | ci-info: | 2 | 172.31.0.1 | 0.0.0.0 | 255.255.255.255 | eth0 | UH | ci-info: +-------+-------------+------------+-----------------+-----------+-------+ ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | Route | Destination | Gateway | Interface | Flags | ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | 1 | fe80::/64 | :: | eth0 | U | ci-info: | 3 | local | :: | eth0 | U | ci-info: | 4 | multicast | :: | eth0 | U | ci-info: +-------+-------------+---------+-----------+-------+ Generating public/private rsa key pair. Your identification has been saved in /etc/ssh/ssh_host_rsa_key Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub The key fingerprint is: SHA256:K3RktS9lMi4T23+jRx1uXUDrC8LopqXO/cKtXNaSAcU root@ip-172-31-8-36 The key's randomart image is: +---[RSA 3072]----+ | .o .. | | oE. .. | | = + o .. | | o O * . ..| | . S B o o.+| | . o + B ..+o| | ..=.= o.= | | . Ooo.. o.. | | .= ++. .. | +----[SHA256]-----+ Generating public/private dsa key pair. Your identification has been saved in /etc/ssh/ssh_host_dsa_key Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub The key fingerprint is: SHA256:eW4QaEib/+p52+bIEphBgRNS4bYlRDvYy68P+ioRDXE root@ip-172-31-8-36 The key's randomart image is: +---[DSA 1024]----+ |o+E+o. | |.Boo.+ . | |.oBo= o . | |.o.*.o o | | .+ +. S . | |. .o .. + | | .. . .. o | |.. o .+.+. | |+oo...+o++o | +----[SHA256]-----+ Generating public/private ecdsa key pair. Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub The key fingerprint is: SHA256:tvUlzJqwt43yqcfT9okV+0aO+8kz8T3+Bal+YjoT8p4 root@ip-172-31-8-36 The key's randomart image is: +---[ECDSA 256]---+ | | | | | | | o . | | S . + = | | ..=.+ + =.| | o++oo o+=| | ..BB=o+*B| | .*EB++=BO| +----[SHA256]-----+ Generating public/private ed25519 key pair. Your identification has been saved in /etc/ssh/ssh_host_ed25519_key Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub The key fingerprint is: SHA256:14vrk76MhBIIY6oZets8yhcBK2jWf50iv3sl8H05bBQ root@ip-172-31-8-36 The key's randomart image is: +--[ED25519 256]--+ | | | . E | |+..o . | |==.o. . . . | |=.. o. S + + . | |oo .+ + * + B | |+ . ..= o +.+ . | | o +o. o +o. | | +oo. o=o*o | +----[SHA256]-----+ Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:config' at Sun, 11 Aug 2024 21:38:59 +0000. Up 21.00 seconds. SOURCE: ======================================== #!/usr/bin/env python3 import os, sys, time, datetime, boto3, traceback from subprocess import check_call, check_output from os.path import expanduser, exists with open(__file__) as f: print("SOURCE:") print("="*40) print(f.read()) print("="*40) sys.stdout.flush() BUCKET = 'open-lambda-public' URL = 'https://s3.us-east-2.amazonaws.com/open-lambda-public/' s3 = boto3.client("s3") DATA = {'version': '0', 'id': '20ea08fd-481e-b312-d484-5c6e49069d0b', 'detail-type': 'Scheduled Event', 'source': 'aws.events', 'account': '667147198405', 'time': '2024-08-11T21:37:53Z', 'region': 'us-east-2', 'resources': ['arn:aws:events:us-east-2:667147198405:rule/ol-periodic-test'], 'detail': {}} def run(cmd): print("RUN "+cmd) check_call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr) def aws_log(): with open("/var/log/cloud-init-output.log") as f: return f.read() def s3_put(key, value, content_type='text/plain'): print("S3 PUT "+key) r = s3.put_object(Bucket=BUCKET, Key=key, Body=value.encode('utf-8'), ContentType=content_type) def s3_get(key, default): try: r = s3.get_object(Bucket=BUCKET, Key=key) return str(r['Body'].read(), 'utf-8') except Exception as e: print(key, e) return default def s3_all_keys(Prefix): ls = s3.list_objects_v2(Bucket=BUCKET, Prefix=Prefix, MaxKeys=10000) keys = [] while True: contents = [obj['Key'] for obj in ls.get('Contents',[])] keys.extend(contents) if not 'NextContinuationToken' in ls: break ls = s3.list_objects_v2(Bucket=BUCKET, Prefix=Prefix, ContinuationToken=ls['NextContinuationToken'], MaxKeys=10000) return keys def run_all(): now = datetime.datetime.today().strftime("%Y-%m-%d-%H-%M-%S") dirname = 'vm/%s' % now # upload AWS log to S3 (we'll do again later to capture prints after this) s3_put(dirname+'/cloud-init-output.log', aws_log()) # move to user dir os.chdir(expanduser("~")) os.environ["HOME"] = expanduser("~") # why do we need to do this ourselves? # pull/build/test if not "commit" in DATA: run('git clone --depth=1 https://github.com/open-lambda/open-lambda.git') else: run(' && '.join([ 'git clone https://github.com/open-lambda/open-lambda.git', 'cd open-lambda', 'git checkout ' + DATA["commit"] ])) os.chdir("open-lambda") git_commit = check_output('git rev-parse HEAD', shell=True).decode('utf-8').strip() s3_put(dirname+'/commit.txt', git_commit) try: with open("build.out", "w") as f: check_call("make", shell=True, stdout=f, stderr=f) try: with open("tests.out", "w") as f: check_call("make test-all", shell=True, stdout=f, stderr=f) result = 'PASS' except Exception: print(traceback.format_exc()) result = 'FAIL' except Exception: print(traceback.format_exc()) result = 'BUILD-FAIL' # upload test results/logs to S3 s3_put(dirname+'/test.txt', result) if exists('build.out'): with open('build.out') as f: s3_put(dirname+'/build.out', f.read()) if exists('tests.out'): with open('tests.out') as f: s3_put(dirname+'/tests.out', f.read()) if exists('test.json'): with open('test.json') as f: s3_put(dirname+'/test.json', f.read()) if exists('testing/test-cluster/logs/worker-0.out'): with open("testing/test-cluster/logs/worker-0.out") as f: s3_put(dirname+'/worker-0.out', f.read()) # refresh summary gen_report() s3_put(dirname+'/cloud-init-output.log', aws_log()) # kill the VM (it has been configured to terminate on shutdown) if DATA.get("terminate", True): run('poweroff -f') def href(s3_path, all_keys): if not s3_path in all_keys: return '[NOT FOUND]' url = URL + s3_path return '{text}'.format(url=url, text=url.split("/")[-1]) def gen_report(): print("GEN REPORT") vms = set() all_keys = s3_all_keys("vm") for k in all_keys: vms.add(k.split('/')[1]) vms = sorted(vms, reverse=True) html = [] html += ['', '
'] for i, vm in enumerate(vms): if i < 14: commit = s3_get('vm/%s/commit.txt'%vm, 'unkown').strip() result = s3_get('vm/%s/test.txt'%vm, 'unkown').strip() else: # just so we can complete faster without doing too many S3 reads commit = '???' result = '???' html += ['