diff --git a/ClusterStart.yaml b/ClusterStart.yaml deleted file mode 100644 index 415ab13..0000000 --- a/ClusterStart.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: clusterstart -spec: - activeDeadlineSeconds: 180 - template: - metadata: - name: clusterstart - spec: - containers: - - name: clusterstart - image: zilman/kube-addons - command: ["kubectl"] - args: ["create", "-f", "AddOns", "--recursive"] - restartPolicy: Never diff --git a/Demo.yaml b/Demo.yaml deleted file mode 100644 index 4fa4dc3..0000000 --- a/Demo.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: clusterstart -spec: - activeDeadlineSeconds: 180 - template: - metadata: - name: clusterstart - spec: - containers: - - name: clusterstart - image: zilman/cncf-demo - command: ["kubectl"] - args: ["create", "-f", "Demo", "--recursive"] - restartPolicy: Never diff --git a/Docker/icecream/Dockerfile b/Docker/icecream/Dockerfile new file mode 100644 index 0000000..189e710 --- /dev/null +++ b/Docker/icecream/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:jessie-slim + +MAINTAINER Eugene Zilman + +ADD mozconfig /root/mozconfig + +RUN apt install -y git icecc + +COPY runner.sh /runner.sh + +ENTRYPOINT ["/runner.sh"] + diff --git a/Docker/icecream/mozconfig b/Docker/icecream/mozconfig new file mode 100644 index 0000000..c52ade9 --- /dev/null +++ b/Docker/icecream/mozconfig @@ -0,0 +1,8 @@ +mk_add_options MOZ_MAKE_FLAGS="-j24” + +ac_add_options --enable-application=browser +ac_add_options --disable-tests + +# ICE +CC="/usr/lib/icecc/bin/cc" +CXX="/usr/lib/icecc/bin/c++" \ No newline at end of file diff --git a/Docker/icecream/readme.md b/Docker/icecream/readme.md new file mode 100644 index 0000000..5643011 --- /dev/null +++ b/Docker/icecream/readme.md @@ -0,0 +1,4 @@ +This is a debian 8 based image with icecc. + +Beware: +The entry point git clones the firefox source tree and checks out the latest stable release, it is a huge repo, don't attempt lightly. diff --git a/Docker/icecream/runner.sh b/Docker/icecream/runner.sh new file mode 100755 index 0000000..6a37140 --- /dev/null +++ b/Docker/icecream/runner.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -ex + +time git clone https://github.com/mozilla/gecko-dev.git +cd gecko-dev && git checkout release + +export MOZCONFIG=/root/mozconfig + +./mach bootstrap --no-interactive + +export PATH="$HOME/.cargo/bin:$PATH" +export PATH=/usr/lib/icecc/bin:$PATH + +service icecc-scheduler start +service iceccd start # both on same box are fine, need at least one d + +./mach configure +./mach build + +sleep infinity diff --git a/Docker/icecreamd/Dockerfile b/Docker/icecreamd/Dockerfile new file mode 100644 index 0000000..d6b1e54 --- /dev/null +++ b/Docker/icecreamd/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:jessie-slim + +MAINTAINER Eugene Zilman + +RUN apt install -y icecc +COPY runner.sh /runner.sh + +ENTRYPOINT ["/runner.sh"] + diff --git a/Docker/icecreamd/runner.sh b/Docker/icecreamd/runner.sh new file mode 100755 index 0000000..0f3710f --- /dev/null +++ b/Docker/icecreamd/runner.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -ex + +service iceccd start # same as iceccd -s $icemaster +sleep infinity diff --git a/Docker/kubectl/Dockerfile b/Docker/kubectl/Dockerfile index 897b00f..af0857a 100644 --- a/Docker/kubectl/Dockerfile +++ b/Docker/kubectl/Dockerfile @@ -1,6 +1,6 @@ FROM alpine -ENV KUBE_LATEST_VERSION="v1.4.4" +ENV KUBE_LATEST_VERSION="v1.7.3" RUN apk add --update ca-certificates \ && apk add --update -t deps curl \ diff --git a/Demo/ConfigMaps/countly.yaml b/Helm/ConfigMaps/countly.yaml similarity index 100% rename from Demo/ConfigMaps/countly.yaml rename to Helm/ConfigMaps/countly.yaml diff --git a/Demo/Manifests/countly.yaml b/Helm/Manifests/countly.yaml similarity index 100% rename from Demo/Manifests/countly.yaml rename to Helm/Manifests/countly.yaml diff --git a/Demo/Manifests/distcc-daemon.yaml b/Helm/Manifests/distcc-daemon.yaml similarity index 100% rename from Demo/Manifests/distcc-daemon.yaml rename to Helm/Manifests/distcc-daemon.yaml diff --git a/Demo/Manifests/mongo.yaml b/Helm/Manifests/mongo.yaml similarity index 100% rename from Demo/Manifests/mongo.yaml rename to Helm/Manifests/mongo.yaml diff --git a/Helm/README.md b/Helm/README.md new file mode 100644 index 0000000..5edbf3a --- /dev/null +++ b/Helm/README.md @@ -0,0 +1 @@ +Merging a Helm TopChart instead of the standalones. Add the docs here. diff --git a/Images/base/README.md b/Images/base/README.md deleted file mode 100644 index 0a7adf1..0000000 --- a/Images/base/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Centos7 base image - -This image is a minimally modified Centos7 configured with sensible defaults for hosting a Kubernetes cluster. - -## Quickstart - -Simply install and configure [packer](https://www.packer.io/) and fork this repo to customize. - -> packer build packer.json - -## Dependencies - -- Packer 0.11+ -- Ansible 2.1+ installed ([installation instructions] (http://docs.ansible.com/ansible/intro_installation.html)) diff --git a/Images/base/ansible.cfg b/Images/base/ansible.cfg deleted file mode 100644 index 7b150fd..0000000 --- a/Images/base/ansible.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[defaults] -roles_path = ./roles -host_key_checking = False - -remote_user = root -private_key_file = ~/.ssh/your.key diff --git a/Images/base/base.sh b/Images/base/base.sh deleted file mode 100755 index f008d9b..0000000 --- a/Images/base/base.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -region='us-west-2' -productCode='aw0evgkw8e5c1q413zgy5pjce' - -AMI=$(aws --region $region ec2 describe-images --owners aws-marketplace --filters Name=product-code,Values=$productCode --query 'Images | [-1] | ImageId' --out text) - -echo $AMI - -# This is a convenience script to grab the latest CentOS7 AMI id. -# A soon to be released evrsion of Packer has a 'dynamic source AMI' feature -# so once can specifiy the latest image right in the packer template. - -# Otherwise the output of this script would have to be injected into the packer template. diff --git a/Images/base/disable_tty.sh b/Images/base/disable_tty.sh deleted file mode 100644 index 904f3ed..0000000 --- a/Images/base/disable_tty.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sed -i.bak -e '/Defaults.*requiretty/s/^/#/' /etc/sudoers diff --git a/Images/base/packer.json b/Images/base/packer.json deleted file mode 100644 index 4e83271..0000000 --- a/Images/base/packer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - -"builders": [{ - "type": "amazon-ebs", - "region": "us-west-2", - "source_ami_filter": { - "filters": { - "virtualization-type": "hvm", - "name": "*CentOS Linux 7 x86_64 HVM EBS*", - "root-device-type": "ebs" }, - "most_recent": true - }, - "instance_type": "c4.2xlarge", - "ssh_username": "centos", - "ssh_pty" : false, - "ami_name": "cncfbase{{timestamp}}", - "user_data_file": "disable_tty.sh" -}], - -"provisioners": [{ - "type": "ansible", - "playbook_file": "playbook.yml", - "user": "centos", - "sftp_command": "/usr/libexec/openssh/sftp-server", - "extra_arguments": [ "-vvv", "--extra-vars", "packer=yes" ] - }] - -} diff --git a/Images/base/playbook.yml b/Images/base/playbook.yml deleted file mode 100644 index bd371ff..0000000 --- a/Images/base/playbook.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - become: yes - - tasks: - - selinux: state=disabled - - copy: content="overlay" dest=/etc/modules-load.d/overlay.conf - - copy: - content: | - net.bridge.bridge-nf-call-ip6tables = 1 - net.bridge.bridge-nf-call-iptables = 1 - dest: /usr/lib/sysctl.d/90-system.conf - - - yum: name=* state=latest diff --git a/Images/golden/README.md b/Images/golden/README.md deleted file mode 100644 index a934b08..0000000 --- a/Images/golden/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## Run on specific host -Provide a hosts inventory to the i flag, note the trailing comma - -```ansible-playbook playbook.yml -i 42.867.53.09, --step``` - -## Useful ansible tips - -ansible-playbook playbook.yml --list-tasks ---step, --start-at-task="foo" - -## Centos7 based golden Kubernetes image - -This image builds on the [base image](https://github.com/cncf/demo/tree/master/Images/base), -a minimally modified Centos7 configured with sensible defaults for hosting a Kubernetes cluster. - -It bakes in everything needed to run Kubernetes master and/or minion nodes into one AMI. It is suggested to configure an instance to bootstrap as a minion or master via userdata. - -## Configuration via Userdata - - -Simply write a file named `kubernetes-master` _or_ `kubernetes-minion` and specify a `cluster_name` environment variable. That's it. - - -``` - -#!/bin/bash - -set -ex - -HOSTNAME_OVERRIDE=$(curl -s http://169.254.169.254/2007-01-19/meta-data/local-hostname | cut -d" " -f1) - -cat << EOF > /etc/sysconfig/kubernetes-{master,minion} - -CLUSTER_NAME={cncfdemo} -KUBELET_HOSTNAME=--hostname-override=$HOSTNAME_OVERRIDE - -EOF - -``` - -Note: The hostname override is an example specific to AWS. Adjust if needed. - -## Customization Quickstart - -Simply install and configure [packer](https://www.packer.io/) and fork this repo to customize. - -> packer build packer.json - -## Dependencies - -- Packer 0.11+ -- Ansible 2.1+ installed ([installation instructions] (http://docs.ansible.com/ansible/intro_installation.html)) diff --git a/Images/golden/ansible.cfg b/Images/golden/ansible.cfg deleted file mode 100644 index 1b81cd2..0000000 --- a/Images/golden/ansible.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[defaults] -roles_path = ./roles -host_key_checking = False - -remote_user = root -private_key_file = ~/.ssh/cncf-aws.pem diff --git a/Images/golden/disable_tty.sh b/Images/golden/disable_tty.sh deleted file mode 100644 index 904f3ed..0000000 --- a/Images/golden/disable_tty.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sed -i.bak -e '/Defaults.*requiretty/s/^/#/' /etc/sudoers diff --git a/Images/golden/packer.json b/Images/golden/packer.json deleted file mode 100644 index 350757d..0000000 --- a/Images/golden/packer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - -"builders": [{ - "type": "amazon-ebs", - "region": "us-west-2", - "source_ami_filter": { - "filters": { - "virtualization-type": "hvm", - "name": "cncfbase*", - "root-device-type": "ebs" - }, - "owners": ["750548967590"], - "most_recent": true - }, - "instance_type": "c4.2xlarge", - "ssh_username": "centos", - "ssh_pty" : false, - "ami_name": "cncfgolden{{timestamp}}", - "user_data_file": "disable_tty.sh" -}], - -"provisioners": [{ - "type": "ansible", - "playbook_file": "playbook.yml", - "user": "centos", - "sftp_command": "/usr/libexec/openssh/sftp-server", - "extra_arguments": [ "--extra-vars", "packer=yes" ] - }] - -} diff --git a/Images/golden/playbook.yml b/Images/golden/playbook.yml deleted file mode 100644 index e2f91c2..0000000 --- a/Images/golden/playbook.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- hosts: all - gather_facts: False - become: yes - - tasks: - - - yum_repository: - name: Kubernetes - description: Kubernetes Repository - baseurl: http://yum.kubernetes.io/repos/kubernetes-el7-x86_64 - gpgcheck: no - - - yum: name={{ item }} state=latest - with_items: - - docker - - kubernetes-cni - - kubectl - - kubelet - - kubeadm - - - lineinfile: - dest: /etc/sysconfig/docker-storage - regexp: '^DOCKER_STORAGE_OPTIONS=' - line: 'DOCKER_STORAGE_OPTIONS="--storage-driver=overlay"' - - - name: Temp remove of extra args from drop-in - upstream rpm sets incorrectly - lineinfile: - dest: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf - regexp: '^Environment="KUBELET_EXTRA_ARGS' - state: absent - - - lineinfile: - dest: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf - insertafter: '^Environment=\"KUBELET_AUTHZ_ARGS' - line: 'Environment="KUBELET_EXTRA_ARGS=--cgroup-driver=systemd --cloud-provider=aws"' - - - copy: - content: | - kind: MasterConfiguration - apiVersion: kubeadm.k8s.io/v1alpha1 - cloudProvider: aws - dest: /etc/kubernetes/kubeadm.conf - - - file: path=/tmp/helm state=directory - - unarchive: - src: "https://storage.googleapis.com/kubernetes-helm/helm-v2.4.2-linux-amd64.tar.gz" - dest: /tmp/helm - remote_src: True - - copy: - src: "/tmp/helm/linux-amd64/helm" - dest: /usr/local/bin/helm - owner: root - group: root - mode: 0700 - remote_src: True - - - copy: src=services/ dest=/etc/systemd/system/ mode=0644 - - service: name={{ item }} enabled=true - with_items: - - docker - - kubelet - - setup-network-environment - - setup-kubernetes-masters - - setup-kubernetes-minions - diff --git a/Web/api/_tests/gen_mock_run.py b/Web/api/_tests/gen_mock_run.py index bc58486..900c368 100755 --- a/Web/api/_tests/gen_mock_run.py +++ b/Web/api/_tests/gen_mock_run.py @@ -1,8 +1,9 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 from __future__ import print_function import sys +import calendar import time, datetime import json @@ -11,27 +12,66 @@ from hashids import Hashids N = int(sys.argv[1]) if 1 < len(sys.argv) else 2 +# print('N is {}'.format(N)) hashids = Hashids(salt='grabfromenv') -now = int(time.time()) -human = datetime.datetime.fromtimestamp(now).strftime('%a, %d %B %Y - %H:%M UTC') +from datetime import datetime, timedelta + + +n = (datetime.now() - timedelta(days=3, hours=random.randint(1,5), minutes=random.randint(1,30), seconds=random.randint(1,42))) +now=calendar.timegm(n.utctimetuple()) +# now = int(n.timestamp()) +# now = int(time.time()) +human = datetime.fromtimestamp(now).strftime('%a, %d %B %Y - %H:%M UTC') data = [] -for _ in range (0,N): + +aws = { + 'Masters': {'size': 3, 'type': 'm3.large'}, + 'Minions': {'size': 0, 'type': ''}, + 'Provider': 'AWS', + 'RAM': '21.23GiB', + 'Storage': '96GB', + 'id': hashids.encode(int(time.time())), + 'timestart': now, + 'timeend': now + 60*12 + random.randint(60,120), + 'vcpu': 6 + } + +gce = { + 'Masters': {'size': 3, 'type': 'n1-standard-2'}, + 'Minions': {'size': 0, 'type': ''}, + 'Provider': 'GCE', + 'RAM': '21.53GiB', + 'Storage': '0GB', + 'id': hashids.encode(int(time.time())), + 'timestart': now, + 'timeend': now + 60*9 + random.randint(50,80), + 'vcpu': 6 + } + +packer = { + 'Masters': {'size': 3, 'type': 'type-0'}, + 'Minions': {'size': 0, 'type': ''}, + 'Provider': 'Packet', + 'RAM': '23.68GiB', + 'Storage': '0GB', + 'id': hashids.encode(int(time.time())), + 'timestart': now, + 'timeend': now + 60*9 + random.randint(2,40), + 'vcpu': 12 + } + + +for cloud in range (0,1): now += random.randint(1,100) - Metadata = { - 'Masters': {'size': 1, 'type': 'm3.medium'}, - 'Minions': {'size': 3, 'type': 'm4.large'}, - 'Provider': 'AWS', - 'RAM': '24GiB', - 'Storage': '250GB', - 'id': hashids.encode(int(time.time())), - 'timestart': now, - 'timeend': now + 60*14 + random.randint(2,120), - 'vcpu': 6 - } + Metadata = aws + FACTOR = 1.3 + TARGET_LOW = int(540 * FACTOR) + TARGET_HIGH = int(660 * FACTOR) + TARGET = random.randint(TARGET_LOW, TARGET_HIGH) Results = { @@ -41,8 +81,8 @@ 'Boinc_Jobs': 0, 'CPU': Metadata['vcpu'], #random.randint(3,12), - 'DistCC': random.randint(900,1424), - 'HTTP_Requests': random.randint(2000000, 2542424), + 'DistCC': TARGET, + 'HTTP_Requests': random.randint(1000000, 1542424), 'Memory': Metadata['RAM'], 'Provider': Metadata['Provider'] } @@ -56,23 +96,25 @@ { "timestart" : now + 3, - "timeend" : now + random.randint(45, 70), - "title": "Creating AWS Resources" + "timeend" : now + random.randint(305, 370), + "title": "Provisioning Cloud Resources", + "stdout_url": "https://s3-us-west-2.amazonaws.com/data.cncfdemo.io/{}/01-Provisioning-Cloud-Resources.stdout".format(Results['id']) }] events.append({ "timestart" : events[-1]['timeend'] + 3, - "timeend" : events[-1]['timeend'] + random.randint(45, 70), - "content": """""", - + "timeend" : events[-1]['timeend'] + random.randint(185, 250), "title": "Instances Booting", + "stdout_url": "https://s3-us-west-2.amazonaws.com/data.cncfdemo.io/{}/02-Instances-Booting.stdout".format(Results['id']) + }) events.append({ "timestart" : events[-1]['timeend'] + 14, "timeend" : events[-1]['timeend'] + random.randint(25, 42), - "title": "Installing Kubernetes AddOns" + "title": "Helm Chart", + "content": "" }) events.append({ @@ -82,8 +124,9 @@ events.append({ "timestart" : events[-2]['timeend'] + 4, - "timeend" : events[-2]['timeend'] + random.randint(65, 77), - "title": "Mongo Cluster Ready" + "timeend" : events[-2]['timeend'] + random.randint(65, 87), + "title": "Mongo Cluster Ready", + "stdout_url": "https://s3-us-west-2.amazonaws.com/data.cncfdemo.io/{}/04-Mongo-Cluster-Ready.stdout".format(Results['id']) }) events.append({ @@ -98,47 +141,26 @@ }) events.append({ - "timestart" : events[-2]['timeend'] + 4, - "timeend" : Metadata['timeend'], - "title": "Boinc Started" - }) - - events.append({ - "timestart" : events[-1]['timeend'] + 1, - "timeend" : events[-1]['timeend'] + Results['DistCC'], - "title": "DistCC Started" - }) - - events.append({ - "timestart" : events[-1]['timeend'] + random.randint(0,3), - "timeend" : events[-1]['timeend'] + random.randint(-10,33), - "title": "HTTP Load Started" - }) - - events.append({ - "raw": "
", - "title": "" - }) - - events.append({ - "timestart" : events[-3]['timestart'], - "timeend" : events[-3]['timeend'], + "timestart" : events[-2]['timestart'], + "timeend" : events[-2]['timeend'] + TARGET, "title": "DistCC Finished" }) events.append({ - "timestart" : events[-3]['timestart'], - "timeend" : events[-3]['timeend'], - "title": "WRK Stopped ({} requests completed)".format(Results['HTTP_Requests']) + "timestart" : events[-1]['timestart'] - random.randint(21, 52), + "timeend" : events[-1]['timeend'] + random.randint(4, 18), + "title": "HTTP Load Stopped ({} requests completed)".format(Results['HTTP_Requests']) }) events.append({ - "timestart" : events[-6]['timestart'], - "timeend" : events[-6]['timeend'], - "title": "Boinc Stopped (0 completed)" + "timestart" : events[-1]['timestart'] + random.randint(2,10), + "timeend" : events[-1]['timeend'] + random.randint(52,94), + "title": "Boinc Stopped (0 completed)", + "content": "" + }) - human = datetime.datetime.fromtimestamp(events[-1]['timeend']).strftime('%a, %d %B %Y - %H:%M UTC') + human = datetime.fromtimestamp(events[-1]['timeend']).strftime('%a, %d %B %Y - %H:%M UTC') events.append({ "raw": r"""Demo Finished On {}""".format(human), @@ -151,3 +173,6 @@ 'events': events } print(json.dumps(data)) + + + diff --git a/Web/results/main.css b/Web/results/main.css index f18f944..0e0175e 100644 --- a/Web/results/main.css +++ b/Web/results/main.css @@ -378,11 +378,15 @@ input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-i overflow: scroll; } +<<<<<<< HEAD +.tty ol, .tty ul { +======= .tty li { min-height: 1.5em; } .tty ol { +>>>>>>> e584002dc2ac1512138bc7d5ec34ad329f3c29ef list-style-type: none; margin: 0; padding: 0; @@ -390,6 +394,7 @@ input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-i .tty li { min-height: 1.5em; + list-style: none; } .content-extra { diff --git a/Web/results/search.html b/Web/results/search.html index 5db83ce..453d33a 100644 --- a/Web/results/search.html +++ b/Web/results/search.html @@ -1,10 +1,10 @@ cncfdemo - - + + @@ -57,11 +63,11 @@