Skip to content

Instantly share code, notes, and snippets.

View ianseyer's full-sized avatar

Ian Seyer ianseyer

View GitHub Profile
1/25/2017 11:38:42 AMINFO - com.fatfractal.service.datastore.api.elasticSearch.ESConnector - 2017.01.25 04 at 05:38:42.359 PM UTC - initialize() : === Waiting for green status
1/25/2017 11:38:42 AMINFO - com.fatfractal.service.datastore.api.elasticSearch.ESConnector - 2017.01.25 04 at 05:38:42.364 PM UTC - Cluster health: ClusterHealthResponse - status [GREEN]
1/25/2017 11:38:42 AMtimedOut [false]
1/25/2017 11:38:42 AMclustername [elasticsearch]
1/25/2017 11:38:42 AMnumberOfNodes [1]
1/25/2017 11:38:42 AMnumberOfDataNodes [1]
1/25/2017 11:38:42 AMactiveShards [0]
1/25/2017 11:38:42 AMrelocatingShards [0]
1/25/2017 11:38:42 AMactivePrimaryShards [0]
1/25/2017 11:38:42 AMinitializingShards [0]
@ianseyer
ianseyer / make
Last active January 13, 2017 19:21
b5030x$ make run
python MLS_Hermosa.py SDB066.intellisis.com &
sleep 60
Received non zero response 33554432
Default port denied. Removing request
Received non zero response 16777216
Device 99 denied
Connected to flitbridge as device 100
python ws_client.py
2017-01-13 19:21:19+0000 [-] Log opened.
1/3/2017 1:05:40 PMINFO | com.fatfractal.noserver.actions.Extension | 2017.01.03 01 at 07:05:40.310 PM UTC | /ff/ext/jobNum | ian.seyer@gmail.com | ekuCWBrK5nbryndvjHsXJ7 | Executing script require('scripts/Extensions').jobNum();
1/3/2017 1:05:40 PMINFO | com.fatfractal.noserver.service.MainAppDataService | 2017.01.03 01 at 07:05:40.312 PM UTC | /ff/ext/jobNum | ian.seyer@gmail.com | ekuCWBrK5nbryndvjHsXJ7 | Running query with sort parameters [SortParam{fieldName='createdAt', ascending=true}]
1/3/2017 1:05:40 PMINFO | com.fatfractal.noserver.actions.AbstractAction | 2017.01.03 01 at 07:05:40.326 PM UTC | /ff/ext/jobNum | ian.seyer@gmail.com | ekuCWBrK5nbryndvjHsXJ7 | RESPONSE : METHOD: GET, HEADERS: [Content-Type=application/json, X-Ff-Req-Id=ekuCWBrK5nbryndvjHsXJ7], CODE: 200
1/3/2017 1:05:44 PMERROR | com.fatfractal.noserver.actions.AbstractAction | 2017.01.03 01 at 07:05:44.677 PM UTC | /ff/ext/updateJob/148c3241-81f6-44c0-b111-4c880706e09f | NoUser | 53KTJoyxp5gsXC9rjr6eh5 | *** /ff/ext/updateJob/148c32
output = json.dumps({'stdout':str(out), 'stderr':str(err), 'payload':json.dumps(payload),
'task-id':os.environ['TASK_ID']})
print(output)
callback(os.environ['TASK_ID'], output)
#######################################
def callback(task_id, results, endpoint="https://staging-sandbox.knuedge.com/queue/ff/ext/setJobResult/"):
"""
A simple POST method via requests using basic HTTP auth
"""
print("JOB ID:", task_id)
1/3/2017 11:31:31 AMINFO | com.fatfractal.noserver.actions.AbstractAction | 2017.01.03 01 at 05:31:31.084 PM UTC | /ff/ext/setJobResult/83907e7e-e255-4f4d-b181-86157eefeadf | system | exujmoQcR09ozrogB6nIG6 | RESPONSE : METHOD: POST, HEADERS: [Content-Type=application/json, Set-Cookie=userGuid=system; max-age=129600; expires=5 Jan 2017 05:31:31 GMT; domain=staging-sandbox.knuedge.com; path=/queue/, Set-Cookie=sessionId=_fK_3sQ1xL9GXF_Cvhqrs5; max-age=129600; expires=5 Jan 2017 05:31:31 GMT; domain=staging-sandbox.knuedge.com; path=/queue/, X-Ff-Req-Id=exujmoQcR09ozrogB6nIG6], CODE: 500
1/3/2017 11:31:35 AMERROR | com.fatfractal.noserver.actions.AbstractAction | 2017.01.03 01 at 05:31:35.589 PM UTC | /ff/ext/setJobResult/528b3795-b44f-4309-8494-1072e345d85b | NoUser | 3CKutTuzHchDVSSccoxUr4 | *** /ff/ext/setJobResult/528b3795-b44f-4309-8494-1072e345d85b should be accessed via a secure HttpS connection !!! ***
1/3/2017 11:31:35 AMINFO | com.fatfractal.noserver.actions.AbstractAction | 2017.01.03 01 at 05:31:3
1/3/2017 11:31:35 AMTraceback (most recent call last):
1/3/2017 11:31:35 AM File "knureon.py", line 113, in <module>
1/3/2017 11:31:35 AM makeallrun()
1/3/2017 11:31:35 AM File "knureon.py", line 107, in makeallrun
1/3/2017 11:31:35 AM callback(os.environ['TASK_ID'], output)
1/3/2017 11:31:35 AM File "knureon.py", line 36, in callback
1/3/2017 11:31:35 AM if r.raise_for_status() != None:
1/3/2017 11:31:35 AM File "/home/knuser/.local/lib/python2.7/site-packages/requests/models.py", line 893, in raise_for_status
1/3/2017 11:31:35 AM raise HTTPError(http_error_msg, response=self)
1/3/2017 11:31:35 AMrequests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://staging-sandbox.knuedge.com/queue/ff/ext/setJobResult/528b3795-b44f-4309-8494-1072e345d85b
#here is our rudimentary tooling for assigning kworkers to specific DUT boards
#True = in use
#False = available
AVAILABLE_DEVICES = {
"high":["SDB065":False, "SDB066":False],
"low":{"SDB065":False, "SDB066":False, "SDB067":False, "SDB068":False, "SDB069":False}
}
boardIsFree = False
while(boardIsFree == False):
destination = select_device(priority)
if DEVICE_MANIFEST[destination] == False: #the destination is vacant
boardIsFree == True #exit loop, we are using this board
worker = docker_client.containers.run(os.environ['KWORKER_IMAGE'], \
environment={'KNU_DEVICE':select_device(priority), \
'GIT_REPO':git_repo, 'TASK_ID':delegate.request.id}, \
command="python knureon.py",\
volumes = {'/tasks/':{'bind':'/var/opt', 'mode':'rw'}},\
links=[('Queue-Redis-1', 'redis'), \
('Queue-RabbitMQ-1', 'rabbit')],\
stderr=True)
('OUTPUT:', "{'example_output.csv': 'Operating on 64 clusters.\\n\\nIteration, W
orld Size, coordsPerRank, # Samples, Iteration RunTime (Sec), Pi Value\\n1, 511,
10, 5119, 0.006737, 3.15381\\n2, 511, 100, 51199, 0.018423, 3.14011\\n3,
511, 1000, 511999, 0.006923, 3.14331\\n4, 511, 10000, 5.12e+06, 0.006141,
3.14133\\n5, 511, 100000, 5.12e+07, 0.008708, 3.14157\\n6, 511, 1000000, 5.1
2e+08, 0.007596, 3.14169\\n7, 1078530154, 10000000, 5.12e+09, 0.00691, 7.17
465e-43\\n8, 511, 100000000, 5.12e+10, 0.006897, 3.14158\\n9, 511, 1000000000
, 5.12e+11, 0.007107, 3.14159\\n\\nTotal Time (sec): 0.089407\\n'}")
Traceback (most recent call last):
File "knureon.py", line 98, in <module>