Skip to content

Instantly share code, notes, and snippets.

@mark-burnett
mark-burnett / post_workflow.json
Created December 4, 2014 14:17
Sketch of the ptero-workflow POST /v1/workflows json-schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "POST /v1/workflows",
"definitions": {
"name": {
"type": "string",
"minLength": 1
},
@mark-burnett
mark-burnett / Basic.pm
Created September 11, 2014 10:31
A sketch of using Genome::WorkflowBuilder to build import workflows
package Genome::InstrumentData::Command::Import::Basic;
use Genome::InstrumentData::Command::Import::WorkflowBuilder;
# <snip>
sub execute {
# <snip>
# Instead of Workflow::Simple::run_workflow
@mark-burnett
mark-burnett / gist:051039de22406a4b19c3
Created September 10, 2014 13:16
alternative protected endpoint implementation
class AuthException(Exception): pass
class MissingAuthHeader(AuthException): pass
class MissingIdentHeader(AuthException): pass
class InvalidBearerToken(AuthException): pass
class ProtectedEndpoint(object):
def __init__(self, realm=None, scopes=None, claims=None, aud=None):
self._exception_map = _setup_exception_map(realm, scopes, claims, aud)
self.target = None
@mark-burnett
mark-burnett / client.rb
Created November 8, 2012 21:35
Ruote iterator timings vs # workers
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'json'
require 'ruote'
require 'amqp'
require 'ruote-amqp'
@mark-burnett
mark-burnett / benchmark.rb
Created November 8, 2012 04:49
Ruote iterator benchmarks
require 'rubygems'
require 'ruote'
$start_time = nil
$stop_time = nil
class StartTime
include Ruote::LocalParticipant
def on_workitem
@mark-burnett
mark-burnett / grid-service.rb
Created November 6, 2012 23:03
Launching managing grid jobs with ruote
require 'amqp'
require 'drmaa'
require 'json'
AMQP.settings[:user] = 'guest'
AMQP.settings[:pass] = 'guest'
AMQP.settings[:host] = 'localhost'
AMQP.settings[:vhost] = '/development/workflow'
$command_wrapper_path = '/home/vagrant/rw/workflow-grid-service/command_wrapper'