Create a counter component with
- Some text displaying total count
- An "increment" button
- A "decrement" button
# Define a docker workflow (independent of KBase) | |
# - output and input files | |
# - minimum node requirements for a job | |
# - whether to exit on any failure or continue on failure | |
# - pass through environment variables | |
# - htcondor, etc backend | |
# - automatically figure out serial and concurrent execution based on task input and output | |
def subsample(): |
# A task is a docker image, a command, and optional hardware prefs | |
# A pipeline is a collection of sequential or parallel tasks with a shared volume mount | |
# Pipelines are submitted to HTCondor | |
# A small application layer would handle the job submission to HTCondor, | |
# pulling docker images and running containers with correct mounts and settings | |
# Define an HTCondor job with a docker image, command, and node requirements or preferences | |
subsample = Task( | |
image='jgi/subsample', |
workflow jgi_read_qc | |
{ | |
File raw_fastq | |
Array[String] sketch_dbs = [ "nt", "refseq", "silva" ] | |
call subsample | |
{ | |
input: | |
infile=raw_fastq | |
} |
import time | |
import zmq | |
import atexit | |
import logging | |
from zmq.devices import ProcessDevice | |
from zmq.log.handlers import PUBHandler | |
from multiprocessing import Process | |
# All child processes we create | |
procs = [] # type: list |
import time | |
from threading import Thread | |
from queue import Queue | |
# Advantages: | |
# - a little simpler, uses only builtins | |
# - doesn't require another lib | |
# Disadvantages: | |
# - harder to migrate to other architectures (eg. request/reply, processes, fair share) |
import time | |
import zmq | |
import zmq.devices | |
from threading import Thread | |
# Advantages: | |
# - Easier to change the architecture around | |
# - Easier to add other processes, workers, remote workers, etc | |
# Disadvantages: | |
# - Need a little knowledge of zmq |
# Register-based -- all varaibles are stored in registers. Sub-function calls are templated and expanded inline | |
# Compute the nth factorial | |
fun factorial n:int -> int | |
| count <- n | |
$ loop while (gt count 1) | |
| count <- dec count | |
| n <- mul count n | |
$ repeat | |
$ return n |
# Sum of multiples of `n` up to `limit | |
# eg: 18 is the sum of multiples of 3 up to 10 (3, 6, 9) | |
fun mul_sum n:int lim:int -> int | |
| sum <- 0 | |
| counter <- 1 | |
| mul <- n | |
$ loop while !lt mul lim | |
| counter <- !inc counter | |
| mul <- !add mul n | |
| sum <- !add sum mul |
group :num | |
:int :float | |
type :bintree:leaf a | |
@val a | |
type :bintree:branch a | |
@left :bintree a | |
@right :bintree a |