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 Mon, 01 Jan 2024 21:38:40 +0000. Up 5.52 seconds. Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'init' at Mon, 01 Jan 2024 21:38:43 +0000. Up 7.79 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.46.224 | 255.255.240.0 | global | 0a:32:5a:72:39:33 | ci-info: | eth0 | True | fe80::832:5aff:fe72:3933/64 | . | link | 0a:32:5a:72:39:33 | 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:G1MyQ64u0xJby0iWUBBHBUnflbXmU1JG6uvYCrXVZuU root@ip-172-31-46-224 The key's randomart image is: +---[RSA 3072]----+ | o=*+. . .o..+ | | o.. + .. = | | . . * . = . .| | . . . = + + o | | = o S . = + E| | o O . = 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:pSWUeeNYYl7pDnvyt+jgYhTRkjk6Gd/9+wUsZ8gQs4o root@ip-172-31-46-224 The key's randomart image is: +---[DSA 1024]----+ | +.oo. | | . *.* *+ | | = B.X=. | | + o.=*+o o | | .E.S+ .+ = | | . o o .+ . | | . .+ . .| | o. ...o . | | . ...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:rYSRV0NGwOIE+hE7BOWd5/BebwyhGy/GmtBb5/DHx+o root@ip-172-31-46-224 The key's randomart image is: +---[ECDSA 256]---+ | .o=. ..+* | | + +oo.o . | | . =o*.o . | | . o.O o . | | . . S + | | . + * + | | . . X o.+. | | . * * .o o | | + ooEo | +----[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:IHuZ/+YU0GOoalGOp14VDRoWZ2jL27CMppZDNueRUzw root@ip-172-31-46-224 The key's randomart image is: +--[ED25519 256]--+ | +o+ | | .o= = | | .++.+ = | | *E= + . | | +=B*S . | | + B*+o. . | | o B+o. . . | | =o.. o. | | . .. oo | +----[SHA256]-----+ Cloud-init v. 21.4-0ubuntu1~20.04.1 running 'modules:config' at Mon, 01 Jan 2024 21:38:55 +0000. Up 19.97 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': '53828dc0-49f4-ef49-b7d7-05cacad2bc88', 'detail-type': 'Scheduled Event', 'source': 'aws.events', 'account': '667147198405', 'time': '2024-01-01T21: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 += ['