Skip to content

Instantly share code, notes, and snippets.

View gregarndt's full-sized avatar

Greg Arndt gregarndt

  • Redox
  • Chicago, IL
View GitHub Profile
import argparse
import json
import sys
import urllib2
QUEUE_PENDING_URL = "https://queue.taskcluster.net/v1/pending/{}/{}"
STATUS_CODE = {'OK': 0, 'WARNING': 1, "CRITICAL": 2, "UNKNOWN": 3}
def get_pending_count_for_worker_type(provisioner, worker_type):
pending_url = QUEUE_PENDING_URL.format(provisioner, worker_type)
import os
from datetime import datetime
import psycopg2
conn = psycopg2.connect(os.environ['PGCONNECTIONSTRING'])
cur = conn.cursor()
# this should be a list that TC could be using that is not currently allocated
# to buildbot
import os
import psycopg2
conn = psycopg2.connect(os.environ['PGCONNECTIONSTRING'])
cur = conn.cursor()
all_worker_ids = set(["t-yosemite-r7-0040", "t-yosemite-r7-0041", "t-yosemite-r7-0042", "t-yosemite-r7-0045"])
try:
cur.execute("select worker_id, count(*) from tasks where provisioner = 'scl3-puppet' and resolved > now() - interval '5 hours' group by worker_id")
Total Tasks (30 days)
5,229,327
Total Task Time (30 days)
225.57 years
Unique machines (30 days)
695,734
Average task duration
@gregarndt
gregarndt / Beer Fridge
Created February 3, 2017 21:01
Current beer fridge goodies
Ayinger celebrator (https://www.ratebeer.com/beer/ayinger-celebrator-doppelbock/1090/)
Ballast point coconut victory at sea (https://www.ratebeer.com/beer/ballast-point-victory-at-sea--coconut/394810/)
Ballast point sea monster (https://www.ratebeer.com/beer/ballast-point-sea-monster-imperial-stout/95775/)
Ballast point haberno sculpin (https://www.ratebeer.com/beer/ballast-point-habanero-sculpin/139749/)
Aventinus (https://www.ratebeer.com/beer/schneider-weisse-aventinus/2224/)
4 hands absence of light (https://www.ratebeer.com/beer/4-hands-absence-of-light/362433/)
Three Floyds Gumballhead (https://www.ratebeer.com/beer/three-floyds-gumballhead/22764/)
Left hand Hard Wired nitro (https://www.ratebeer.com/beer/left-hand-hard-wired-nitro-coffee-porter/390312/)
Solemn oath snaggletooth bandana (https://www.ratebeer.com/beer/solemn-oath-snaggletooth-bandana/179586/)
Bell’s amber (https://www.ratebeer.com/beer/bells-amber-ale/3206/)
import taskcluster from 'taskcluster-client';
let taskGroupId = 'cfMDvTzETHagYx-uSPCOxQ';
async () => {
let queue = new taskcluster.Queue();
let continuationToken;
let cancellations = [];
do {
import taskcluster from 'taskcluster-client'
async () => {
// retrieved from the tc-vcs logs from the task that failed. It shows it
// downloading the last known good version of the tarball and the index namespace
// lines look like:
// GET https://index.taskcluster.net/v1/task/tc-vcs.v1.clones.f0d09fb92317a4a669d300943887f7b8
// and
// GET https://queue.taskcluster.net/v1/task/bohiEJmfRbeB-SxW7WU7Kg/artifacts/public/hg.mozilla.org/releases/mozilla-beta.tar.gz
let taskId = "bohiEJmfRbeB-SxW7WU7Kg";
#!/bin/bash
set -e
mkdir -p /Users/fitzgen/workspace/
npm install -g taskcluster-vcs
tc-vcs checkout /Users/fitzgen/workspace/tooltool https://git.mozilla.org/build/tooltool.git https://git.mozilla.org/build/tooltool.git master --force-clone
ls -lah /Users/fitzgen/workspace/tooltool
{
"provisionerId": "aws-provisioner-v1",
"workerType": "opt-linux64",
"schedulerId": "task-graph-scheduler",
"taskGroupId": "HQx8Zz6VTqC7xPo3-Hjj1w",
"dependencies": [
"KIoxo0SuTmCCiWrUshbfwg"
],
"requires": "all-completed",
"routes": [
@gregarndt
gregarndt / volumes
Last active March 28, 2016 14:11
taskcluster-worker volumes spec
volumes: [
// typical cache volume persisted on the host, basically a name -> path mapping
{
type: persistent,
name: 'gecko-level-1-mozilla-inbound-dbg-linux64-workspace',
mountPath: '/home/worker/workspace',
},
// ramdisk volume
{
type: memory,