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 Wed, 05 Jun 2019 19:33:40 +0000. Up 8.95 seconds. Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'init' at Wed, 05 Jun 2019 19:33:42 +0000. Up 10.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.44.44 | 255.255.240.0 | global | 0a:3b:a6:ce:6a:92 | ci-info: | eth0 | True | fe80::83b:a6ff:fece:6a92/64 | . | link | 0a:3b:a6:ce:6a:92 | 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: +-------+-------------+---------+-----------+-------+ 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:zitQ1jFRzzxQ6ZU4fWIAVk6gGyiC3gbEAvtXfwtynz0 root@ip-172-31-44-44 The key's randomart image is: +---[RSA 2048]----+ |+. .o*=== . | |o+ .oo B+ * .| |+.. . o.oo .*+ o | |..o. oo..o .. | | ..o.o. S . | | ... = + + | | . 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:IX7BHgajXhgCn54LCcAFUXdHOe47x+6he9SJFdV2F1M root@ip-172-31-44-44 The key's randomart image is: +---[DSA 1024]----+ |++*o..o..o. .+E| |.o o.+.+.o . *| |. o o o B . ..o| |.o o o + = . | |o o . . S + . | | . . . . o o | | . +. | | o.+. | | oBo | +----[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:/xFRUnHkIjcM8qwtGKmmH0A2pWunC/HlxZnD7pp6TCY root@ip-172-31-44-44 The key's randomart image is: +---[ECDSA 256]---+ | . . o.+oo| | o . + = o | | = o = = .| | o o + = o + o | | . + = S o o | | +EOoo o . . | | . +=o . . . | | . oo+ . . | | oo+.. . | +----[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:B03PrELj9fNPbnLcqsVcQVJNoQCv0yFUdqEeOh1Ci9M root@ip-172-31-44-44 The key's randomart image is: +--[ED25519 256]--+ | +++ +o=+| | =o+++ + .| | o+Eo*+. . | | o.+Oo+ .| | S=o+o .| | oo = . | | =.o| | ..+=| | ...=o| +----[SHA256]-----+ Cloud-init v. 19.1-1-gbaa47854-0ubuntu1~16.04.1 running 'modules:config' at Wed, 05 Jun 2019 19:33:45 +0000. Up 14.07 seconds. SOURCE: ======================================== #!/usr/bin/env python3 import os, sys, time, datetime, boto3 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 = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'} def 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'): 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 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", buffering=0) as f: check_call("make", shell=True, stdout=f, stderr=f) try: with open("tests.out", "w", buffering=0) as f: check_call("make test-all", shell=True, stdout=f, stderr=f) result = 'PASS' except: result = 'FAIL' except: 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() # kill the VM (it has been configured to terminate on shutdown) 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(): 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 += ['

%s [COMMIT: %s]

' % (vm, commit)] html += [''] html += ['', ''] html = '\n'.join(html) s3_put('tests.html', html, 'text/html') return html def main(): if len(sys.argv) == 1: run_all() elif sys.argv[1] == 'report': print(gen_report()) if __name__ == '__main__': main() ========================================