Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init-local' at Thu, 06 Jan 2022 19:30:19 +0000. Up 6.89 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init' at Thu, 06 Jan 2022 19:30:23 +0000. Up 10.49 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.35.76 | 255.255.240.0 | global | 0a:7a:f2:21:46:9e | ci-info: | eth0 | True | fe80::87a:f2ff:fe21:469e/64 | . | link | 0a:7a:f2:21:46:9e | 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.32.1 | 0.0.0.0 | eth0 | UG | ci-info: | 1 | 172.31.32.0 | 0.0.0.0 | 255.255.240.0 | eth0 | U | ci-info: | 2 | 172.31.32.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:+qCJEWkcSyLgz+NoaWIKZQUCQIglko4o7EPrIXKNwWw root@ip-172-31-35-76 The key's randomart image is: +---[RSA 3072]----+ |&+o | |Bo . | |B+o . | |=BE= | |+.XB S | |oO*.o . | |*B+. o | |B. o o o | |. . 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:oczIYAQ3UzzGK7ux/0tjv17PDbSQ5vscBxMl7TLpnCs root@ip-172-31-35-76 The key's randomart image is: +---[DSA 1024]----+ |..=+. ... | | o o= o. | | o. o . .o | | ..o.+ . . .+.. | | oo + S +o++ | | o o o++ | | + + o +.. | | o o o .E=.= | | ...oo+..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:8PjttSnnyQJhunPkGOVk7VQjjMf9hxSOsKK7FqiSV1A root@ip-172-31-35-76 The key's randomart image is: +---[ECDSA 256]---+ | +.. .. | | E . =o+o. | | . . .o.o.+.. | | . =*.o o .| | . .oBS+ . | | o +o+.. | | . o .B... . | |o o =.o.oo.+ | | o ..o .=* | +----[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:BwoKZ0sXi40soGUZWsSxqhugUWenpgfqn3mzqIJcAnA root@ip-172-31-35-76 The key's randomart image is: +--[ED25519 256]--+ |.oB+. | |+*E= o | |*.X B . . | |.O * + . . | |= + o . S . | |++ = . | |B + . | |++ .+o | |ooo=..o | +----[SHA256]-----+ Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:config' at Thu, 06 Jan 2022 19:30:34 +0000. Up 22.01 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:final' at Thu, 06 Jan 2022 19:30:37 +0000. Up 24.94 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 finished at Thu, 06 Jan 2022 19:30:38 +0000. Datasource DataSourceEc2Local. Up 25.56 seconds Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init-local' at Sat, 15 Jan 2022 21:38:48 +0000. Up 5.46 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init' at Sat, 15 Jan 2022 21:38:51 +0000. Up 8.26 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.245 | 255.255.240.0 | global | 02:8a:a1:ee:93:a0 | ci-info: | eth0 | True | fe80::8a:a1ff:feee:93a0/64 | . | link | 02:8a:a1:ee:93:a0 | 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:TDqUKGLfdXTtfhVM18o4TBVGnX8+CgNby08T7tZcHbg root@ip-172-31-8-245 The key's randomart image is: +---[RSA 3072]----+ | . ..oB++| | . .. . .o ++| |... . o... o.o..o| |.......+.. .++o.+| | . .o S = +.o.=| | . . = E o+| | * * o| | = 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:envr9fix/9FxppvM1iH5VQG+otJXyhm7JtCtpKUIgw4 root@ip-172-31-8-245 The key's randomart image is: +---[DSA 1024]----+ | .. | | . . | | . .| | . .| | . S .o o..+| |E. o o.+o.Bo +=| |o o o.Bo.*. =o+| | . . +.+oo.=.*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:V0Tt3ypGrWfkW3cqUj/rXS/9qW5Gbomhb2V+YloNUas root@ip-172-31-8-245 The key's randomart image is: +---[ECDSA 256]---+ | .o. . | | . o .| | .o . | | . + | | S . E ..| | . .o+= o| | .oO*.+=| | ..o*XO=B| | o=BOO*=| +----[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:pDYim/s2cpb7nwMp1z7l2dF6A5+/ZRsTKfNfSHyu2eU root@ip-172-31-8-245 The key's randomart image is: +--[ED25519 256]--+ | | | | | . | | o . .| | . . +oS +oo.| | +.o+.. . o.=+.| | o + o o o =.=*| | ..* +.o o =*O| | .*o+..oo .o=E| +----[SHA256]-----+ Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:config' at Sat, 15 Jan 2022 21:39:02 +0000. Up 19.60 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': '15b1f44e-7539-a8b8-a022-bbbc360ecf55', 'detail-type': 'Scheduled Event', 'source': 'aws.events', 'account': '667147198405', 'time': '2022-01-15T21: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 += ['