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

Auto Generate Provider Documentation #873

Merged
merged 5 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions docs/web/docs/reference/providers.md
Original file line number Diff line number Diff line change
@@ -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|
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
32 changes: 32 additions & 0 deletions mephisto/scripts/local_db/gh_actions/auto_generate_provider.py
Original file line number Diff line number Diff line change
@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other sibling pages are plural ("Architects", "Blueprints"). Can we call this "Providers" to stay consistent?

provider_file.new_paragraph(
"The crowd provider determines the source of the crowd workers."
Copy link
Contributor

@pringshia pringshia Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the simplicity of what you have here. I think I would merge it with some of the details from https://mephisto.ai/docs/explanations/architecture_overview/#crowdproviders to say something like:

Crowd providers standardize access to external crowd workers, by wrapping external API communication through a standardized interface.

cc @JackUrb

)
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()
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down