-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full extended docs for every core directory in Mephisto (#316)
* moving around the stuff from data_model and webapp/client * Migrating crowd providers * Moving script utils * Migrating architects * Forgot to update channel callsites * Moving blueprints * Migrating core * Mass delete redirection files * Accidentally deleted too much in the cli * weird merge output * import fix * Update core directory readme * Documentation for tools * script docs * Operations read me * Moving testing folders * data model docs * Abstrastion readmes * Curse of not pressing ctrl-s * address comments
- Loading branch information
Showing
30 changed files
with
201 additions
and
81 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
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,16 +1,9 @@ | ||
# Mephisto | ||
This is the main package directory, containing all of the core workings of Mephisto. The breakdown is as following: | ||
This is the main package directory, containing all of the core workings of Mephisto. They roughly follow the divisions noted in the [architecture overview doc](https://github.com/facebookresearch/Mephisto/blob/master/docs/architecture_overview.md#agent). The breakdown is as following: | ||
|
||
- `client`: Contains interfaces for using Mephisto at a very high level. Primarily comprised of the python code for the cli and | ||
- `core`: Contains components that operate on top of the data_model layer | ||
- `data_model`: Contains the data model components as described in the architecture document, as well as the base classes for all the core abstractions. | ||
- `providers`: contains implementations of the `CrowdProvider` abstraction | ||
- `scripts`: contains commonly executed convenience scripts for Mephisto users | ||
- `server`: contains implementations of the `Architect` and `Blueprint` abstractions. | ||
- `tasks`: an empty default directory to work on your own tasks | ||
- `utils`: unorganized utility classes that are useful in scripts and other places | ||
- `webapp`: contains the frontend that is deployed by the main client | ||
|
||
## Discussions | ||
|
||
Changes to this structure for clarity are being discussed in [#285](https://github.com/facebookresearch/Mephisto/issues/285). | ||
- `abstractions`: Contains the interface classes for the core abstractions in Mephisto, as well as implementations of those interfaces. These are the Architects, Blueprints, Crowd Providers, and Databases. | ||
- `client`: Contains user interfaces for using Mephisto at a very high level. Primarily comprised of the python code for the cli and the web views. | ||
- `data_model`: Contains the data model components as described in the architecture document. These are the relevant data structures that build upon the underlying MephistoDB, and are utilized throughout the Mephisto codebase. | ||
- `operations`: Contains low-level operational code that performs more complex functionality on top of the Mephisto data model. | ||
- `scripts`: Contains commonly executed convenience scripts for Mephisto users. | ||
- `tools`: Contains helper methods and modules that allow for lower-level access to the Mephisto data model than the clients provide. Useful for creating custom workflows and scripts that are built on Mephisto. |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Mephisto Core Abstractions | ||
This directory contains the interfaces for the four core Mephisto abstractions (as well as subcomponents of those abstractions). Those abstractions are discussed at a high level in the [architecture overvierw doc](https://github.com/facebookresearch/Mephisto/blob/master/docs/architecture_overview.md). | ||
|
||
Specific implementations can be made to extend the Mephisto data model to work with new crowd providers, new task types, and new backend server architectures. These four primary abstractions are summarized below, but other sections go more in-depth. | ||
|
||
### `Architect` | ||
An [`Architect`](https://github.com/facebookresearch/Mephisto/blob/master/mephisto/abstractions/architects/README.md#architect) is an abstraction that allows Mephisto to manage setup and maintenance of task servers for you. When launching a task, Mephisto uses an `Architect` to build required server files, launch that server, deploy the task files, and then later shut it down when the task is complete. More details are found in the `abstractions/architects` folder, along with the existing `Architects`. | ||
|
||
Architects also require a `Channel` to allow the `Supervisor` to communicate with the server, and are expected to define their own or select a compatible one from the ones already present. | ||
|
||
### `Blueprint` | ||
A [`Blueprint`](https://github.com/facebookresearch/Mephisto/blob/master/mephisto/abstractions/blueprints/README.md#overview) is the essential formula for running a task on Mephisto. It accepts some number of parameters and input data, and that should be sufficient content to be able to display a frontend to the crowdworker, process their responses, and then save them somewhere. It comprises of extensions of the `AgentState` (data storage), `TaskRunner` (actual steps to complete the task), and `TaskBuilder` (resources to display a frontend) classes. More details are provided in the `abstractions/blueprints` folder, where all the existing `Blueprint`s live. | ||
|
||
### `CrowdProvider` | ||
A [`CrowdProvider`](https://github.com/facebookresearch/Mephisto/blob/master/mephisto/abstractions/providers/README.md#implementation-details) is a wrapper around any of the required functionality that Mephisto will need to utilize to accept work from workers on a specific service. Ultimately it comprises of an extension of each of `Worker`, `Agent`, `Unit`, and `Requester`. More details can be found in the `abstractions/providers` folder, where all of the existing `CrowdProvider`s live. | ||
|
||
### `MephistoDB` | ||
The [`MephistoDB`](https://github.com/facebookresearch/Mephisto/blob/master/mephisto/abstractions/databases/README.md) is an abstraction around the storage for the Mephisto data model, such that it could be possible to create alternate methods for storing and loading the kind of data that mephisto requires without breaking functionality. |
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# MephistoDB implementations | ||
This folder contains implementations of the `MephistoDB` abstraction. | ||
|
||
## `LocalMephistoDB` | ||
An implementation of the Mephisto Data Model outlined in `MephistoDB`. This database stores all of the information locally via SQLite. Some helper functions are included to make the implementation cleaner by abstracting away SQLite error parsing and string formatting, however it's pretty straightforward from the requirements of MephistoDB. |
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
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
7 changes: 4 additions & 3 deletions
7
mephisto/data_model/test/README.md → mephisto/abstractions/test/README.md
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,6 +1,7 @@ | ||
# data_model/test | ||
## Testers | ||
# Abstraction testers | ||
This folder contains a number of Mephisto Data Model "test benches", which serve to be the standard tests that Mephisto Abstractions need to be able to pass in order for the system to be able to use them. As such, they define a number of tests, and then new classes can be tested against the bench by making a subclass that implements the required setup functions. See the `test/server/architects/test_heroku_architect` implementation for an example. | ||
|
||
Implementations can add their own additional test methods after extending the baseline test benches in order to ensure that they have a common place to test their complete functionality. | ||
|
||
## Utils | ||
Any utility functions that can be used for creating useful mocks, DB setups, or other such prerequisites for a test. | ||
The `utils.py` module is set up with utility functions that can be used for creating useful mocks, DB setups, or other such prerequisites for a test. |
File renamed without changes.
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
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
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.