Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitl dashboard - Managing Turk List Backend #1296

Open
wants to merge 30 commits into
base: hitl_dashboard_turk_ls
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2958bfd
update backend api for reteriving turk list
mialsy Jul 19, 2022
59cb32a
Automatic style fix for droidlet
Jul 19, 2022
3405c7d
update to use tab
mialsy Jul 19, 2022
425ab0a
Merge branch 'hitl_dashboard_turkls_be' of https://github.com/faceboo…
mialsy Jul 19, 2022
7d47640
update the logic to handle duplicate
mialsy Jul 20, 2022
a304ca2
update doc
mialsy Jul 20, 2022
f8507be
Automatic style fix for droidlet
Jul 20, 2022
8ce0480
update backend api for reteriving turk list
mialsy Jul 19, 2022
10af8f5
update to use tab
mialsy Jul 19, 2022
54fe7da
Automatic style fix for droidlet
Jul 19, 2022
c4029c3
update the logic to handle duplicate
mialsy Jul 20, 2022
5e5452a
update doc
mialsy Jul 20, 2022
745b67d
Automatic style fix for droidlet
Jul 20, 2022
2a7a235
removed redundent imports
mialsy Jul 20, 2022
b4d20dc
add filter
mialsy Jul 20, 2022
65937c3
fixed issue with search
mialsy Jul 20, 2022
332979d
add backend impl for update, updated frontend ui
mialsy Jul 20, 2022
3384b8e
Automatic style fix for droidlet
Jul 20, 2022
6e33b55
add socket event/frontend component to sync local turk list with s3
mialsy Jul 21, 2022
198b753
rebase
mialsy Jul 21, 2022
6f9eb41
fixed bug due to callback
mialsy Jul 21, 2022
da6c213
Automatic style fix for droidlet
Jul 21, 2022
959b548
update documentation
mialsy Jul 21, 2022
d013d5f
Merge branch 'hitl_dashboard_turkls_be' of https://github.com/faceboo…
mialsy Jul 21, 2022
0053a28
update readme
mialsy Jul 21, 2022
06735ec
Update README.MD
mialsy Jul 21, 2022
e56241c
Delete allow.txt
mialsy Jul 21, 2022
276d22e
fixed early return bug
mialsy Jul 21, 2022
20571f9
changed to show only 2 status to avoid confusion:
mialsy Jul 21, 2022
bcd0959
Update README.MD
mialsy Jul 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Automatic style fix for droidlet
  • Loading branch information
bot committed Jul 19, 2022
commit 59cb32aaa1b910fa00dedeab77a4cafd44f63481
12 changes: 9 additions & 3 deletions droidlet/tools/crowdsourcing/sync_whitelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@
from droidlet.tools.crowdsourcing.droidlet_static_html_task.pilot_config import (
PILOT_ALLOWLIST_QUAL_NAME as interaction_whitelist,
)
from droidlet.tools.crowdsourcing.droidlet_static_html_task.pilot_config import PILOT_BLOCK_QUAL_NAME as interaction_blacklist
from droidlet.tools.crowdsourcing.droidlet_static_html_task.pilot_config import SOFTBLOCK_QUAL_NAME as interaction_softblock
from droidlet.tools.crowdsourcing.droidlet_static_html_task.pilot_config import (
PILOT_BLOCK_QUAL_NAME as interaction_blacklist,
)
from droidlet.tools.crowdsourcing.droidlet_static_html_task.pilot_config import (
SOFTBLOCK_QUAL_NAME as interaction_softblock,
)
from droidlet.tools.crowdsourcing.vision_annotation_task.pilot_config import (
PILOT_ALLOWLIST_QUAL_NAME as vision_annotation_whitelist,
)
from droidlet.tools.crowdsourcing.vision_annotation_task.pilot_config import (
PILOT_BLOCK_QUAL_NAME as vision_annotation_blacklist,
)
from droidlet.tools.crowdsourcing.vision_annotation_task.pilot_config import SOFTBLOCK_QUAL_NAME as vision_softblock
from droidlet.tools.crowdsourcing.vision_annotation_task.pilot_config import (
SOFTBLOCK_QUAL_NAME as vision_softblock,
)

qual_dict = {
"interaction": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def get_model_by_id(batch_id: int):
else:
return load_model(local_fname), None


def get_turk_list_by_pipeline(pipeline):
output_dict_raw = import_s3_lists(S3_BUCKET_NAME_INTERNAL)
qual_types = PIPELINE_QUAL_MAPPPING[pipeline]
Expand Down
15 changes: 9 additions & 6 deletions droidlet/tools/hitl/dashboard_app/backend/dashboard_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DASHBOARD_EVENT(Enum):
"""
server supported event types, i.e. API types
"""

GET_RUNS = "get_job_list"
GET_TRACEBACK = "get_traceback_by_id"
GET_RUN_INFO = "get_run_info_by_id"
Expand All @@ -54,10 +55,11 @@ class DASHBOARD_EVENT(Enum):
GET_MODEL_KEYS = "get_model_keys_by_id"
GET_MODEL_VALUE = "get_model_value_by_id_n_key"

# apis for turk
# apis for turk
GET_TURK_LIST = "get_turk_list_by_pipeline"
UPDATE_TURK = "update_turk_by_tid"


# constants for model related apis
KEY_COMPLETE = "complete_model"

Expand Down Expand Up @@ -232,24 +234,25 @@ def get_model_value(batch_id, key):
# get a specific value
emit(DASHBOARD_EVENT.GET_MODEL_VALUE.value, [key, get_value_by_key(model, key)])


@socketio.on(DASHBOARD_EVENT.GET_TURK_LIST.value)
def get_turk_list(pipeline: str):
"""
get turk list for the corresponding pipeline
- input:
- pipeline type
- input:
- pipeline type
- output:
- a dict containing the turk allowlist, blocklist & softblock list
"""
print(
f"Request received: {DASHBOARD_EVENT.GET_TURK_LIST.value}, pipeline = {pipeline}"
)
print(f"Request received: {DASHBOARD_EVENT.GET_TURK_LIST.value}, pipeline = {pipeline}")
out_dict = get_turk_list_by_pipeline(pipeline)
emit(DASHBOARD_EVENT.GET_TURK_LIST.value, out_dict)


@socketio.on(DASHBOARD_EVENT.UPDATE_TURK.value)
def update_turk(pipeline, turk_id):
pass


if __name__ == "__main__":
socketio.run(app)