forked from ga4gh/task-execution-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
984 additions
and
626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: python | ||
sudo: required | ||
services: | ||
- docker | ||
python: | ||
- "2.7" | ||
os: | ||
- linux | ||
before_install: | ||
- sudo apt-get update | ||
- sudo apt-get install -y golang | ||
install: | ||
- make depends | ||
- make | ||
script: nosetests tests | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
|
||
import json | ||
import time | ||
import requests | ||
import argparse | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-s", "--server", default="http://localhost:8000") | ||
parser.add_argument("task") | ||
args = parser.parse_args() | ||
|
||
with open(args.task) as handle: | ||
task = json.loads(handle.read()) | ||
|
||
r = requests.post("%s/v1/jobs" % (args.server), json=task) | ||
data = r.json() | ||
print data | ||
job_id = data['value'] | ||
|
||
for i in range(10): | ||
r = requests.get("%s/v1/jobs/%s" % (args.server, job_id)) | ||
data = r.json() | ||
if data["state"] not in ['Queued', "Running"]: | ||
break | ||
time.sleep(1) | ||
print data | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get update | ||
sudo apt install -y golang-go | ||
|
||
git clone https://github.com/bmeg/task-execution-server.git | ||
git checkout scaling | ||
|
||
make depends | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
app = angular.module('TESApp', ['ngRoute']) | ||
|
||
app.controller('JobListController', function($scope, $http) { | ||
"use strict"; | ||
|
||
$scope.url = "/v1/jobs"; | ||
$scope.tasks = []; | ||
|
||
$scope.fetchContent = function() { | ||
$http.get($scope.url).then(function(result){ | ||
$scope.jobs = result.data.jobs; | ||
}); | ||
} | ||
|
||
$scope.fetchContent(); | ||
}); | ||
|
||
app.controller('WorkerListController', function($scope, $http) { | ||
"use strict"; | ||
|
||
$scope.url = "/v1/jobs-service"; | ||
$scope.workers = []; | ||
|
||
$scope.fetchContent = function() { | ||
$http.get($scope.url).then(function(result){ | ||
$scope.workers = result.data; | ||
}); | ||
} | ||
|
||
$scope.fetchContent(); | ||
}); | ||
|
||
app.controller('JobInfoController', | ||
function($scope, $http, $routeParams) { | ||
$scope.url = "/v1/jobs/" + $routeParams.job_id | ||
|
||
$scope.job_info = {}; | ||
$scope.fetchContent = function() { | ||
$http.get($scope.url).then(function(result){ | ||
$scope.job_info = result.data | ||
}) | ||
} | ||
$scope.fetchContent(); | ||
} | ||
); | ||
|
||
app.config(['$routeProvider', | ||
function($routeProvider) { | ||
$routeProvider.when('/', { | ||
templateUrl: 'static/list.html', | ||
}). | ||
when('/jobs/:job_id', { | ||
templateUrl: 'static/jobs.html' | ||
}) | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html ng-app="TESApp"> | ||
<head> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script> | ||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-route.js"></script> | ||
<script src="static/app.js"></script> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>TES</h1> | ||
<hr> | ||
<div ng-view></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div id="job_info" ng-controller="JobInfoController"> | ||
<a href="/#/"><---</a> | ||
<h1>Job {{job_info.jobId}}</h1> | ||
|
||
<div>{{job_info.task.name}}</div> | ||
<div>{{job_info.task.description}}</div> | ||
|
||
<div> | ||
<div>Commands</div> | ||
<div ng-repeat="item in job_info.task.docker" content="item"> | ||
<div>Container: {{item.imageName}}</div> | ||
<div>Container: {{item.cmd}}</div> | ||
</div> | ||
</div> | ||
|
||
<div>Requirements</div> | ||
<div ng-repeat="item in job_info.task.resources" content="item"> | ||
{{item}} | ||
</div> | ||
|
||
<div>State: {{job_info.state}}</div> | ||
|
||
<div> | ||
<div>Logs</div> | ||
<div ng-repeat="item in job_info.task.logs" content="item"> | ||
<div>ExitCode</div> | ||
<pre>{{item.exitCode}}</pre> | ||
|
||
<div>STDERR</div> | ||
<pre>{{item.stderr}}</pre> | ||
|
||
<div>STDOUT</div> | ||
<pre>{{item.stdout}}</pre> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
<h2>Tasks</h2> | ||
<div id="task_list" ng-controller="JobListController"> | ||
<table ng-repeat="item in jobs" content="item" width="100%"> | ||
<col width="20%"> | ||
<col width="33%"> | ||
<tr> | ||
<td><a href="#/jobs/{{item.jobId}}">{{item.jobId}}</a></td> | ||
<td>{{item.state}}</td> | ||
</tr> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<div id="task_info" ng-controller="TaskInfoController"> | ||
<a href="#/"><---</a> | ||
<h1>Task {{task_info.id}}</h1> | ||
|
||
<div>Command</div> | ||
<div>{{task_info.command}}</div> | ||
|
||
<div>Depends</div> | ||
<div>{{task_info.task_depends}}</div> | ||
|
||
<div>Container</div> | ||
<div>{{task_info.container}}</div> | ||
|
||
<div>Arguments</div> | ||
<div ng-repeat="item in task_info.args" content="item"> | ||
{{item}} | ||
</div> | ||
|
||
<div>Tags</div> | ||
<div ng-repeat="item in task_info.tags" content="item"> | ||
{{item}} | ||
</div> | ||
|
||
<div>Requirements</div> | ||
<div ng-repeat="item in task_info.requirements" content="item"> | ||
{{item}} | ||
</div> | ||
|
||
<div>State</div> | ||
<div>{{task_info.state}}</div> | ||
|
||
<div>Max Retries</div> | ||
<div>{{task_info.max_retry}}</div> | ||
|
||
|
||
<div>Jobs</div> | ||
<div ng-repeat="item in task_info.status.runs" content="item"> | ||
<a href="#/jobs/{{item}}">{{item}}</a> | ||
</div> | ||
|
||
</div> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.