Cloud-init v. 0.7.7 running 'init-local' at Tue, 28 May 2019 20:06:43 +0000. Up 9.40 seconds. Cloud-init v. 0.7.7 running 'init' at Tue, 28 May 2019 20:06:44 +0000. Up 10.38 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.177 | 255.255.240.0 | . | 0a:7c:4c:ae:b1:d0 | ci-info: | eth0 | True | fe80::87c:4cff:feae:b1d0/64 | . | link | 0a:7c:4c:ae:b1:d0 | ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . | . | 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: +-------+-------------+-------------+---------------+-----------+-------+ 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:k+w4e3HhZ7odiRPdpMKuYm1QF2ESZYfx994adfjT3Qg root@ip-172-31-46-177 The key's randomart image is: +---[RSA 2048]----+ | oo*+. | | +oo | | .. o | | ..oo. = o | | .So+.E o +| | .o.oo+oo =*| | oo.o++o o.B| | oo+..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:QzZRZxeYiThf1Tm5tavybvsXefjOwX33qApb67kKQhs root@ip-172-31-46-177 The key's randomart image is: +---[DSA 1024]----+ | .o..o=+oo| | o..o=. +o| | +o . =| | o .. o | | E S .o| | . o . o+o| | o . . . .+*| | . . + + o oB| | 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:pimOIZzTc2C2kyvI+Fv8kMKrnFXqLXKl9YciY2Fimbk root@ip-172-31-46-177 The key's randomart image is: +---[ECDSA 256]---+ | | | | | | | | | ++ . S | |.B=+*+ + | |*+BO@.+ . | |+E=#*= o . | |.=X+=.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:reGQvwUnYYbXfsd1Ku7Zb0G0hTFKbeKjI13gG3UgxPg root@ip-172-31-46-177 The key's randomart image is: +--[ED25519 256]--+ | +o oooo | | ...ooo.=o.| | . =o.+.+. =| | = +E +. =.| | o S.+=o.= | | +.*=o o . | | +.... .| | o . o .| | . o .o.| +----[SHA256]-----+ Generating locales (this might take a while)... Generation complete. Cloud-init v. 0.7.7 running 'modules:config' at Tue, 28 May 2019 20:06:51 +0000. Up 17.60 seconds. Cloud-init v. 0.7.7 running 'modules:final' at Tue, 28 May 2019 20:06:53 +0000. Up 18.95 seconds. Cloud-init v. 0.7.7 finished at Tue, 28 May 2019 20:06:53 +0000. Datasource DataSourceEc2. Up 19.12 seconds Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'init-local' at Tue, 28 May 2019 20:10:59 +0000. Up 9.23 seconds. 2019-05-28 20:11:04,665 - util.py[WARNING]: Failed fetching dynamic/instance-identity from url http://169.254.169.254/2009-04-04/dynamic/instance-identity Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'init' at Tue, 28 May 2019 20:11:06 +0000. Up 15.99 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.177 | 255.255.240.0 | global | 0a:7c:4c:ae:b1:d0 | ci-info: | eth0 | True | fe80::87c:4cff:feae:b1d0/64 | . | link | 0a:7c:4c:ae:b1:d0 | 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: +-------+-------------+-------------+---------------+-----------+-------+ ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | Route | Destination | Gateway | Interface | Flags | ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | 0 | fe80::/64 | :: | eth0 | U | ci-info: | 3 | ff00::/8 | :: | eth0 | U | ci-info: +-------+-------------+---------+-----------+-------+ Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'modules:config' at Tue, 28 May 2019 20:11:08 +0000. Up 18.11 seconds. Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'modules:final' at Tue, 28 May 2019 20:11:09 +0000. Up 18.84 seconds. Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 finished at Tue, 28 May 2019 20:11:09 +0000. Datasource DataSourceEc2Local. Up 19.04 seconds Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'init-local' at Fri, 11 Sep 2020 21:39:00 +0000. Up 20.98 seconds. Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'init' at Fri, 11 Sep 2020 21:39:13 +0000. Up 34.24 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.9.170 | 255.255.240.0 | global | 02:e9:53:56:8d:0c | ci-info: | eth0 | True | fe80::e9:53ff:fe56:8d0c/64 | . | link | 02:e9:53:56:8d:0c | 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: +-------+-------------+------------+---------------+-----------+-------+ ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | Route | Destination | Gateway | Interface | Flags | ci-info: +-------+-------------+---------+-----------+-------+ ci-info: | 0 | fe80::/64 | :: | eth0 | U | ci-info: | 3 | ff00::/8 | :: | 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:QUMjFW6VPoZKFBJItRBfng3UmfZTwUNFlaONMD/Dv6k root@ip-172-31-9-170 The key's randomart image is: +---[RSA 2048]----+ | .+++o*=B+.+o+o.o| | .o =.B=+.o+ o | | o.o.=+ .=.+ .| | ....* B . | | . .S. o + | | . . | | o| | o | | E. | +----[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:lMBuCnr6kiBlB0K6wfC85sSL7XEw5X1PwzIHb77+mmw root@ip-172-31-9-170 The key's randomart image is: +---[DSA 1024]----+ |o. .. | |=o. .. . | |ooo... + | | +++..o. + | |.+Bo.o. S B | |+*.+. . O . | |++= . o | |+. o .Eo | | 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:+WyG+T9iM0dLidlvbo1FLjTkuIWPnQiOrJMgo+4Psi8 root@ip-172-31-9-170 The key's randomart image is: +---[ECDSA 256]---+ | | | . | | = | | .. o = .| | .So = X = | | o . o=+ O = o| |.o o . oo =o o = | |E.. + += + = .| |+=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:yCdnlopHHMzTamg26uqzAJudHFzauq7N5ODb15RJMdg root@ip-172-31-9-170 The key's randomart image is: +--[ED25519 256]--+ | o | | + E | | . = + | | . + + * . | |. + * X S | |.= B = @ | |= B . = | |oO.. o . | |+O@.. | +----[SHA256]-----+ Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'modules:config' at Fri, 11 Sep 2020 21:39:23 +0000. Up 44.23 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': '379b2f96-5284-e41c-7d91-02879ac9bad8', 'detail-type': 'Scheduled Event', 'source': 'aws.events', 'account': '667147198405', 'time': '2020-09-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 += ['