Skip to content

Instantly share code, notes, and snippets.

View andrewmagill's full-sized avatar

Andrew Magill andrewmagill

View GitHub Profile
@andrewmagill
andrewmagill / message_sorting.py
Created October 25, 2017 21:13
sorting messages in vector timestamp sim -not working, think i just mixed something up
from collections import namedtuple
import pprint
## parsing user input ##
# named tuples to make things more organized?
Event = namedtuple('Event','process event')
Message = namedtuple('Message', 'sender receiver')
# raw input, ostensibly from the user

Design Document

Environment

VMs

  • Main CMS portal
    • Public Facing portal
    • Admin portal (behind VPN)
  • Main API
@andrewmagill
andrewmagill / rels.txt
Created July 25, 2016 22:28
Relationships between IDS Objects
Relationships between IDS Objects:
----------------------------
Project to Specimen
[Contains, <specimen_id>] (alternate option: HasPart)
Specimen to Project
@andrewmagill
andrewmagill / README.rst
Created July 25, 2016 21:50 — forked from mrhanlon/README.rst
Testing linking metadata together via embedded relationships instead of associationIds.

You can query against relationships using mongodb's $elemMatch syntax. E.g.,

$ metadata-list -v -Q '{"value._relationships": {"$elemMatch": {"@id": "1539251546393416166-242ac11f-0001-012"}}}'
#!/bin/bash
export PATH=$PATH:"$HOME/.aspera/connect/bin"
# get UUID and SRA number
UUID=${UUID}
SRA_NUM=${SRA}
AGAVE_FILE=${AGAVE_URL}
EXTERNAL_URL=${URL}
SRA_PATH="./SRA/"
{
"id": "demo.execute.example.com", # id (string): Unique identifier for this system.
"name": "Demo SGE + GSISSH demo vm", # name (string): Common name for this system.
"status": "UP", # status (string) = ['UP' or 'DOWN' or 'UNKNOWN']: The functional status of this system. Systems must be in UP status to be used.
"type": "EXECUTION", # type (string) = ['EXECUTION' or 'STORAGE']: The type of this system.
"description": "My example system using gsissh and gridftp to submit jobs used for testing.", # description (string, optional): Verbose description of this system.
"site": "example.com", # site (string, optional): The site associated with this system.
"executionType": "HPC", # executionType (string) = ['HPC' or 'CONDOR' or 'CLI']: The execution paradigm used to run jobs on this system.
"queues": [ # queues (List[BatchQueue]): The execution paradigm used to run jobs on this system.
[check] metatest 1: {"name":"metadata-test","value":"1","associationIds":["4096302858573966875-242ac11d-0001-012","4320264451024490981-242ac11d-0001-012","3705648026154823195-242ac1110-0001-012","4154082056836607515-242ac1110-0001-012","1995049352723501541-242ac1110-0001-012"]}
[check] metatest 2: {"name":"metadata-test","value":"2","associationIds":["4320264451024490981-242ac11d-0001-012","3705648026154823195-242ac1110-0001-012","4154082056836607515-242ac1110-0001-012","1995049352723501541-242ac1110-0001-012"]}
[check] metatest 3: {"name":"metadata-test","value":"3","associationIds":["3705648026154823195-242ac1110-0001-012","4154082056836607515-242ac1110-0001-012","1995049352723501541-242ac1110-0001-012"]}
[check] metatest 4: {"name":"metadata-test","value":"4","associationIds":"4320264451024490981-242ac11d-0001-012"}
### expect one match
test 1: {"associationIds": { $in: ["4096302858573966875-242ac11d-0001-012"]}}
--> {"name": "metadata-test", "value": 1}
@andrewmagill
andrewmagill / output.py
Last active March 9, 2016 23:25
some examples sending information to the console in python.
import logging
import pdb
# this config may already be done for you, if you're working on a shared project
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
# you'll have to do this to get the configured logger though
logger = logging.getLogger(__name__)
# variables we'll work with