Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Move new provider docs to documentation folder (#3273)
Kenneth Ng4f8281d613a3
diff --git a/catalog/docs/assets/provider_dags/multi_media_dag.png b/documentation/_static/multi_media_dag.pngsimilarity index 100%rename from catalog/docs/assets/provider_dags/multi_media_dag.pngrename to documentation/_static/multi_media_dag.pngdiff --git a/catalog/docs/assets/provider_dags/simple_dag.png b/documentation/_static/simple_dag.pngsimilarity index 100%rename from catalog/docs/assets/provider_dags/simple_dag.pngrename to documentation/_static/simple_dag.pngdiff --git a/catalog/docs/adding_a_new_provider.md b/documentation/catalog/guides/adding_a_new_provider.mdsimilarity index 81%rename from catalog/docs/adding_a_new_provider.mdrename to documentation/catalog/guides/adding_a_new_provider.mdindex 97a0d04b6..a2a3f3dff 100644--- a/catalog/docs/adding_a_new_provider.md+++ b/documentation/catalog/guides/adding_a_new_provider.md@@ -8,7 +8,7 @@ automated by[Airflow DAGs](https://airflow.apache.org/docs/apache-airflow/stable/concepts/dags.html)generated for each provider. A simple provider DAG looks like this:-+At a high level the steps are:@@ -24,7 +24,7 @@ When a provider supports multiple media types (for example, `audio` _and_`images`), the `pull` step consumes data of all types, but separate `load` stepsare generated:-+## Adding a New Provider@@ -39,19 +39,20 @@ provider DAG, you need to:We call the code that pulls data from our provider APIs "Provider API scripts".You can find examples in-[`provider_api_scripts` folder](../dags/providers/provider_api_scripts). This-code will be run during the `pull` steps of the provider DAG.+[`provider_api_scripts` folder](https://github.com/WordPress/openverse/tree/main/catalog/dags/providers/provider_api_scripts).+This code will be run during the `pull` steps of the provider DAG.At a high level, a provider script should iteratively request batches of recordsfrom the provider API, extract data in the format required by Openverse, andcommit it to local storage. Much of this logic is implemented in a-[`ProviderDataIngester` base class](../dags/providers/provider_api_scripts/provider_data_ingester.py)+[`ProviderDataIngester` base class](https://github.com/WordPress/openverse/blob/main/catalog/dags/providers/provider_api_scripts/provider_data_ingester.py)(which also provides additional testing features _<TODO: link to documentationfor testing features like ingestion_limit, skip_ingestion_errors etc>_). To adda new provider, extend this class and implement its abstract methods.-We provide a [script](../dags/templates/create_provider_ingester.py) that can be-used to generate the files you'll need and get you started:+We provide a+[script](https://github.com/WordPress/openverse/blob/main/catalog/templates/create_provider_ingester.py)+that can be used to generate the files you'll need and get you started:```# PROVIDER_NAME: The name of the provider@@ -84,13 +85,15 @@ NOTE: You will also need to add a new ProviderWorkflow dataclass configuration t```This generates a provider script with a templated `ProviderDataIngester` for you-in the [`provider_api_scripts` folder](../dags/providers/provider_api_scripts),+in the+[`provider_api_scripts` folder](https://github.com/WordPress/openverse/tree/main/catalog/dags/providers/provider_api_scripts),as well as a corresponding test file. Complete the TODOs detailed in thegenerated files to implement behavior specific to your API.Some APIs may not fit perfectly into the established `ProviderDataIngester`pattern. For advanced use cases and examples of how to modify the ingestion-flow, see the [`ProviderDataIngester` FAQ](provider_data_ingester_faq.md).+flow, see the+[`ProviderDataIngester` FAQ](https://github.com/WordPress/openverse/blob/main/catalog/docs/provider_data_ingester_faq.md).### Add a `ProviderWorkflow` configuration class@@ -98,9 +101,9 @@ Now that you have an ingester class, you're ready to wire up a provider DAG inAirflow to automatically pull data and load it into our Catalog database. Thisis done by defining a `ProviderWorkflow` configuration dataclass and adding itto the `PROVIDER_WORKFLOWS` list in-[`provider_workflows.py`](../dags/providers/provider_workflows.py). Our DAG-factories will pick up the configuration and generate a complete new DAG in-Airflow!+[`provider_workflows.py`](https://github.com/WordPress/openverse/blob/main/catalog/dags/providers/provider_workflows.py).+Our DAG factories will pick up the configuration and generate a complete new DAG+in Airflow!At minimum, you'll need to provide the following in your configuration:diff --git a/documentation/catalog/guides/index.md b/documentation/catalog/guides/index.mdindex 24fd92700..c9cec0b97 100644--- a/documentation/catalog/guides/index.md+++ b/documentation/catalog/guides/index.md@@ -5,4 +5,5 @@quickstartdeploy+adding_a_new_provider```