From d93c65a3a679fc2e336533554e7e2b954e7d97fc Mon Sep 17 00:00:00 2001 From: Etesam Ansari Date: Fri, 29 Jul 2022 17:26:04 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20Added=20auto-generation=20to=20?= =?UTF-8?q?providers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Architects.md => architects.md} | 0 .../{Blueprints.md => blueprints.md} | 0 docs/web/docs/reference/providers.md | 34 +++++++++++++++++++ .../reference/{Requester.md => requesters.md} | 0 .../gh_actions/auto_generate_architect.py | 2 +- .../gh_actions/auto_generate_blueprint.py | 2 +- .../gh_actions/auto_generate_provider.py | 32 +++++++++++++++++ .../gh_actions/auto_generate_requester.py | 2 +- 8 files changed, 69 insertions(+), 3 deletions(-) rename docs/web/docs/reference/{Architects.md => architects.md} (100%) rename docs/web/docs/reference/{Blueprints.md => blueprints.md} (100%) create mode 100644 docs/web/docs/reference/providers.md rename docs/web/docs/reference/{Requester.md => requesters.md} (100%) create mode 100644 mephisto/scripts/local_db/gh_actions/auto_generate_provider.py diff --git a/docs/web/docs/reference/Architects.md b/docs/web/docs/reference/architects.md similarity index 100% rename from docs/web/docs/reference/Architects.md rename to docs/web/docs/reference/architects.md diff --git a/docs/web/docs/reference/Blueprints.md b/docs/web/docs/reference/blueprints.md similarity index 100% rename from docs/web/docs/reference/Blueprints.md rename to docs/web/docs/reference/blueprints.md diff --git a/docs/web/docs/reference/providers.md b/docs/web/docs/reference/providers.md new file mode 100644 index 000000000..7d4bb7d1a --- /dev/null +++ b/docs/web/docs/reference/providers.md @@ -0,0 +1,34 @@ + + + + +# Provider + + +The crowd provider determines the source of the crowd workers. +## mock + + + + +|dest|type|default|help|choices|required| +| :--- | :--- | :--- | :--- | :--- | :--- | +|requester_name|str|???|None|None|False| + +## mturk + + + + +|dest|type|default|help|choices|required| +| :--- | :--- | :--- | :--- | :--- | :--- | +|requester_name|str|???|None|None|False| + +## mturk sandbox + + + + +|dest|type|default|help|choices|required| +| :--- | :--- | :--- | :--- | :--- | :--- | +|requester_name|str|???|None|None|False| diff --git a/docs/web/docs/reference/Requester.md b/docs/web/docs/reference/requesters.md similarity index 100% rename from docs/web/docs/reference/Requester.md rename to docs/web/docs/reference/requesters.md diff --git a/mephisto/scripts/local_db/gh_actions/auto_generate_architect.py b/mephisto/scripts/local_db/gh_actions/auto_generate_architect.py index 15b3b79a7..f1e9c2e74 100644 --- a/mephisto/scripts/local_db/gh_actions/auto_generate_architect.py +++ b/mephisto/scripts/local_db/gh_actions/auto_generate_architect.py @@ -8,7 +8,7 @@ def main(): architect_file = MdUtils( - file_name="../../../../docs/web/docs/reference/Architects.md", + file_name="../../../../docs/web/docs/reference/architects.md", ) architect_file.new_header(level=1, title="Architects") valid_architect_types = get_valid_architect_types() diff --git a/mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py b/mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py index 36fe4a517..b5dce4608 100644 --- a/mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py +++ b/mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py @@ -45,7 +45,7 @@ def create_blueprint_info(blueprint_file, arg_dict): def main(): blueprint_file = MdUtils( - file_name="../../../../docs/web/docs/reference/Blueprints.md", + file_name="../../../../docs/web/docs/reference/blueprints.md", ) blueprint_file.new_header(level=1, title="Blueprints") blueprint_file.new_paragraph("The blueprint determines the task content.") diff --git a/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py b/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py new file mode 100644 index 000000000..4da77effc --- /dev/null +++ b/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py @@ -0,0 +1,32 @@ +from mdutils.mdutils import MdUtils +from mephisto.client.cli_commands import get_wut_arguments +from mephisto.operations.registry import ( + get_valid_provider_types, +) +from mephisto.scripts.local_db.gh_actions.auto_generate_blueprint import ( + create_blueprint_info, +) + + +def main(): + provider_file = MdUtils( + file_name="../../../../docs/web/docs/reference/providers.md", + ) + provider_file.new_header(level=1, title="Provider") + provider_file.new_paragraph( + "The crowd provider determines the source of the crowd workers." + ) + valid_provider_types = get_valid_provider_types() + for provider_type in valid_provider_types: + provider_file.new_header(level=2, title=provider_type.replace("_", " ")) + args = get_wut_arguments( + ("provider={provider_name}".format(provider_name=provider_type),) + ) + arg_dict = args[0] + create_blueprint_info(provider_file, arg_dict) + + provider_file.create_md_file() + + +if __name__ == "__main__": + main() diff --git a/mephisto/scripts/local_db/gh_actions/auto_generate_requester.py b/mephisto/scripts/local_db/gh_actions/auto_generate_requester.py index 43bc20264..210a38262 100644 --- a/mephisto/scripts/local_db/gh_actions/auto_generate_requester.py +++ b/mephisto/scripts/local_db/gh_actions/auto_generate_requester.py @@ -10,7 +10,7 @@ def main(): requester_file = MdUtils( - file_name="../../../../docs/web/docs/reference/Requester.md", + file_name="../../../../docs/web/docs/reference/requesters.md", ) requester_file.new_header(level=1, title="Requesters") requester_file.new_paragraph("The requester is an account for a crowd provider.") From e9b0fb93658520fe9cb9d1db0c6943d86537d8a3 Mon Sep 17 00:00:00 2001 From: Etesam Ansari Date: Fri, 29 Jul 2022 17:47:29 -0400 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9D=20Updated=20deploy=20action=20?= =?UTF-8?q?to=20generate=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 5f7f89a84..317776dee 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -25,6 +25,7 @@ jobs: python mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py python mephisto/scripts/local_db/gh_actions/auto_generate_architect.py python mephisto/scripts/local_db/gh_actions/auto_generate_requester.py + python mephisto/scripts/local_db/gh_actions/auto_generate_provider.py - name: Install dependencies run: yarn install --frozen-lockfile - name: Build website From ee4e1c9c5e8fb8d1f03c44350f74d6a88d346d34 Mon Sep 17 00:00:00 2001 From: Etesam Ansari Date: Mon, 1 Aug 2022 11:09:14 -0400 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20Updated=20provider=20paragra?= =?UTF-8?q?ph=20on=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/local_db/gh_actions/auto_generate_provider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py b/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py index 4da77effc..e20fb01db 100644 --- a/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py +++ b/mephisto/scripts/local_db/gh_actions/auto_generate_provider.py @@ -12,9 +12,9 @@ def main(): provider_file = MdUtils( file_name="../../../../docs/web/docs/reference/providers.md", ) - provider_file.new_header(level=1, title="Provider") + provider_file.new_header(level=1, title="Providers") provider_file.new_paragraph( - "The crowd provider determines the source of the crowd workers." + "Crowd providers standardize access to external crowd workers, by wrapping external API communication through a standardized interface." ) valid_provider_types = get_valid_provider_types() for provider_type in valid_provider_types: