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 Architect Documentation #871

Merged
merged 6 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
node-version: 16.x
cache: yarn
- name: Auto Generate Blueprint Docs
run: python mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py
run: |
python mephisto/scripts/local_db/gh_actions/auto_generate_blueprint.py
python mephisto/scripts/local_db/gh_actions/auto_generate_architect.py
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
Expand Down
56 changes: 56 additions & 0 deletions docs/web/docs/reference/Architects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@




# Architects

## mock




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|server_type|str|node|None|None|False|
|server_source_path|str|???|Optional path to a prepared server directory containing everything needed to run a server of the given type. Overrides server type. |None|False|
|should_run_server|bool|False|Addressible location of the server|None|False|
|port|str|3000|Port to launch the server on|None|False|

## local




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|server_type|str|node|None|None|False|
|server_source_path|str|???|Optional path to a prepared server directory containing everything needed to run a server of the given type. Overrides server type. |None|False|
|hostname|str|localhost|Addressible location of the server|None|False|
|port|str|3000|Port to launch the server on|None|False|

## heroku




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|server_type|str|node|None|None|False|
|server_source_path|str|???|Optional path to a prepared server directory containing everything needed to run a server of the given type. Overrides server type. |None|False|
|use_hobby|bool|False|Launch on the Heroku Hobby tier|None|False|
|heroku_team|unknown|???|Heroku team to use for this launch|None|False|
|heroku_app_name|unknown|???|Heroku app name to use for this launch|None|False|
|heroku_config_args|unknown|{}|str:str dict containing all heroku config variables to set for the app|None|False|

## ec2




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|server_type|str|node|None|None|False|
|server_source_path|str|???|Optional path to a prepared server directory containing everything needed to run a server of the given type. Overrides server type. |None|False|
|instance_type|str|t2.micro|Instance type to run router|None|False|
|subdomain|str|The task name defined in your task's hydra config|Subdomain name for routing|None|False|
|profile_name|str|???|Profile name for deploying an ec2 instance|None|False|
2 changes: 2 additions & 0 deletions docs/web/docs/reference/blueprints.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Blueprints


The blueprint determines the task content.
## parlai chat


Expand Down
6 changes: 5 additions & 1 deletion mephisto/client/cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def get_wut_arguments(args):
return

# These are values that do not convert to a string well or are incorrect, so they need to be hardcoded
argument_overrides = {"tips_location": ("default", "path_to_task/assets/tips.csv")}
argument_overrides = {
"tips_location": ("default", "path_to_task/assets/tips.csv"),
"heroku_config_args": ("default", "{}"),
"subdomain": ("default", "The task name defined in your task's hydra config"),
}

arg_dict = get_extra_argument_dicts(target_class)[0]
click.echo(arg_dict["desc"])
Expand Down
27 changes: 27 additions & 0 deletions mephisto/scripts/local_db/gh_actions/auto_generate_architect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from mdutils.mdutils import MdUtils
from mephisto.client.cli_commands import get_wut_arguments
from mephisto.operations.registry import get_valid_architect_types
from mephisto.scripts.local_db.gh_actions.auto_generate_blueprint import (
create_blueprint_info,
)


def main():
architect_file = MdUtils(
file_name="../../../../docs/web/docs/reference/architects.md",
)
architect_file.new_header(level=1, title="Architects")
valid_architect_types = get_valid_architect_types()
for architect_type in valid_architect_types:
architect_file.new_header(level=2, title=architect_type.replace("_", " "))
args = get_wut_arguments(
("architect={architect_name}".format(architect_name=architect_type),)
)
arg_dict = args[0]
create_blueprint_info(architect_file, arg_dict)

architect_file.create_md_file()


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from mephisto.client.cli_commands import get_wut_arguments
from mdutils.mdutils import MdUtils
from copy import deepcopy

from mephisto.operations.registry import get_valid_blueprint_types


Expand Down Expand Up @@ -49,6 +48,7 @@ def main():
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.")
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.

https://mephisto.ai/docs/explanations/architecture_overview/#blueprints

The blueprint contains all of the related code required to set up a task run

Maybe opportunity to align and keep definitions consistent here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll do that. I was just copying the output when you run mephisto wut

valid_blueprint_types = get_valid_blueprint_types()
for blueprint_type in valid_blueprint_types:
blueprint_file.new_header(level=2, title=blueprint_type.replace("_", " "))
Expand Down