-
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.
Remove additional .DS_Stores in the gitignore
- Loading branch information
Showing
37 changed files
with
4,948 additions
and
4,950 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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
remote/ | ||
post_return.txt | ||
__pycache__/ | ||
node_modules/ | ||
*/.DS_Store | ||
**/.DS_Store | ||
.DS_Store | ||
# TODO: Ignore this | ||
# secrets/ | ||
node_modules/ | ||
.env | ||
remote/ | ||
post_return.txt | ||
__pycache__/ | ||
node_modules/ | ||
**/.DS_Store | ||
# TODO: Ignore this | ||
# secrets/ | ||
node_modules/ | ||
.env |
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
from apiflask import APIBlueprint | ||
from flask import render_template, abort, jsonify, request, Response | ||
import requests | ||
|
||
|
||
perms_blueprint = APIBlueprint('perms', __name__) | ||
|
||
|
||
@perms_blueprint.route("/perms/<string:username>", methods=["GET"]) | ||
def get_team_membership(username): | ||
TOKEN = request.cookies.get('token') | ||
# TOKEN = '' | ||
url = f"https://api.github.com/orgs/ISSUIUC/teams/iss-kamaji-administrators/memberships/{username}" | ||
x = requests.get( | ||
url=url, | ||
headers={ | ||
"Accept": "application/vnd.github+json", | ||
'Authorization': f"Bearer {TOKEN}", | ||
"Content-Type": "text/html; charset=utf-8", | ||
"X-GitHub-Api-Version": "2022-11-28"}) | ||
|
||
return x.status_code == 200 | ||
from apiflask import APIBlueprint | ||
from flask import render_template, abort, jsonify, request, Response | ||
import requests | ||
|
||
|
||
perms_blueprint = APIBlueprint('perms', __name__) | ||
|
||
|
||
@perms_blueprint.route("/perms/<string:username>", methods=["GET"]) | ||
def get_team_membership(username): | ||
TOKEN = request.cookies.get('token') | ||
# TOKEN = '' | ||
url = f"https://api.github.com/orgs/ISSUIUC/teams/iss-kamaji-administrators/memberships/{username}" | ||
x = requests.get( | ||
url=url, | ||
headers={ | ||
"Accept": "application/vnd.github+json", | ||
'Authorization': f"Bearer {TOKEN}", | ||
"Content-Type": "text/html; charset=utf-8", | ||
"X-GitHub-Api-Version": "2022-11-28"}) | ||
|
||
return x.status_code == 200 |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
"""This file defines the schemas used by the Kamaji API when describing Datastreamer boards""" | ||
from apiflask import Schema | ||
from apiflask.fields import Integer, String, Boolean, List, Nested | ||
|
||
|
||
class BoardOuputSchema(Schema): | ||
"""Board state schema data container""" | ||
id = Integer() # The id of the board | ||
is_ready = Boolean() # True when in READY state (? TODO: check if this is true) | ||
job_running = Boolean() # True when actively running job | ||
board_type = String() # The type of board | ||
running = Boolean() # Is the thread currently running | ||
|
||
|
||
class BoardList(Schema): | ||
"""Class representing a collection of boards""" | ||
boards = List(Nested(BoardOuputSchema)) | ||
"""This file defines the schemas used by the Kamaji API when describing Datastreamer boards""" | ||
from apiflask import Schema | ||
from apiflask.fields import Integer, String, Boolean, List, Nested | ||
|
||
|
||
class BoardOuputSchema(Schema): | ||
"""Board state schema data container""" | ||
id = Integer() # The id of the board | ||
is_ready = Boolean() # True when in READY state (? TODO: check if this is true) | ||
job_running = Boolean() # True when actively running job | ||
board_type = String() # The type of board | ||
running = Boolean() # Is the thread currently running | ||
|
||
|
||
class BoardList(Schema): | ||
"""Class representing a collection of boards""" | ||
boards = List(Nested(BoardOuputSchema)) |
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 |
---|---|---|
@@ -1,64 +1,64 @@ | ||
"""This file exposes classes, enums, and interfaces for storing data in relation to jobs.""" | ||
import enum | ||
|
||
from apiflask import Schema | ||
from apiflask.fields import Integer, String, DateTime | ||
from apiflask.validators import Length, OneOf, Regexp | ||
|
||
import internal.sanitizers as sanitizers | ||
|
||
|
||
class JobStatus(enum.Enum): | ||
"""An enum describing the current status of a job""" | ||
QUEUED = 0 | ||
"""Job is queued and will be run on the next available TARS""" | ||
RUNNING = 1 | ||
"""Job is currently running on TARS""" | ||
CANCELED = 2 | ||
"""Job was canceled by someone `#cancelculture`""" | ||
SUCCESS = 3 | ||
"""Job was successfully run""" | ||
FAILED_CRASHED = 4 | ||
"""Job crashed on TARS""" | ||
FAILED_COMPILE_ERROR = 5 | ||
"""Job failed to compile""" | ||
FAILED_TIMEOUT = 6 | ||
"""Job timed out, cancelled `#cancelculturestrikesagain`""" | ||
FAILED_OTHER = 7 | ||
"""Job failed for some other reason""" | ||
SETUP = 8 | ||
"""Job is currently in the process of being set up.""" | ||
|
||
|
||
class JobRequestSchema(Schema): | ||
"""The database schema for a generic job request""" | ||
commit = String( | ||
required=True, validate=Regexp( | ||
sanitizers.git_hash_regexp())) | ||
username = String( | ||
required=True, validate=Regexp( | ||
sanitizers.github_username_regexp())) | ||
branch = String( | ||
required=True, validate=Regexp( | ||
sanitizers.branch_name_regexp())) | ||
description = String(required=False, load_default="", dump_default="") | ||
data_uri = String( | ||
required=False, | ||
load_default="/api/temp/data", | ||
dump_default="/api/temp/data") | ||
|
||
# do keep this updated with the db please | ||
|
||
|
||
class JobOutSchema(Schema): | ||
"""Schema for job outputs""" | ||
run_id = Integer() | ||
user_id = String(validate=Length(max=40)) | ||
branch = String(validate=Length(max=128)) | ||
git_hash = String(validate=Length(max=40)) | ||
submitted_time = DateTime() | ||
run_start = DateTime() | ||
run_end = DateTime() | ||
run_status = String(validate=OneOf([e.name for e in JobStatus])) | ||
description = String(validate=Length(max=512)) | ||
data_uri = String(validate=Length(max=128)) | ||
"""This file exposes classes, enums, and interfaces for storing data in relation to jobs.""" | ||
import enum | ||
|
||
from apiflask import Schema | ||
from apiflask.fields import Integer, String, DateTime | ||
from apiflask.validators import Length, OneOf, Regexp | ||
|
||
import internal.sanitizers as sanitizers | ||
|
||
|
||
class JobStatus(enum.Enum): | ||
"""An enum describing the current status of a job""" | ||
QUEUED = 0 | ||
"""Job is queued and will be run on the next available TARS""" | ||
RUNNING = 1 | ||
"""Job is currently running on TARS""" | ||
CANCELED = 2 | ||
"""Job was canceled by someone `#cancelculture`""" | ||
SUCCESS = 3 | ||
"""Job was successfully run""" | ||
FAILED_CRASHED = 4 | ||
"""Job crashed on TARS""" | ||
FAILED_COMPILE_ERROR = 5 | ||
"""Job failed to compile""" | ||
FAILED_TIMEOUT = 6 | ||
"""Job timed out, cancelled `#cancelculturestrikesagain`""" | ||
FAILED_OTHER = 7 | ||
"""Job failed for some other reason""" | ||
SETUP = 8 | ||
"""Job is currently in the process of being set up.""" | ||
|
||
|
||
class JobRequestSchema(Schema): | ||
"""The database schema for a generic job request""" | ||
commit = String( | ||
required=True, validate=Regexp( | ||
sanitizers.git_hash_regexp())) | ||
username = String( | ||
required=True, validate=Regexp( | ||
sanitizers.github_username_regexp())) | ||
branch = String( | ||
required=True, validate=Regexp( | ||
sanitizers.branch_name_regexp())) | ||
description = String(required=False, load_default="", dump_default="") | ||
data_uri = String( | ||
required=False, | ||
load_default="/api/temp/data", | ||
dump_default="/api/temp/data") | ||
|
||
# do keep this updated with the db please | ||
|
||
|
||
class JobOutSchema(Schema): | ||
"""Schema for job outputs""" | ||
run_id = Integer() | ||
user_id = String(validate=Length(max=40)) | ||
branch = String(validate=Length(max=128)) | ||
git_hash = String(validate=Length(max=40)) | ||
submitted_time = DateTime() | ||
run_start = DateTime() | ||
run_end = DateTime() | ||
run_status = String(validate=OneOf([e.name for e in JobStatus])) | ||
description = String(validate=Length(max=512)) | ||
data_uri = String(validate=Length(max=128)) |
Oops, something went wrong.