8000 Sphinx docs by koropets · Pull Request #1321 · equinor/gordo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Sphinx docs #1321

Merged
merged 13 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ jobs:

- name: Test ${{ matrix.component }}
run: bash scripts/tests.sh -n -p ${{ matrix.component }}

build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/setup-python@v1
with:
python-version: '3.10'
architecture: 'x64'

- name: Install deps
run: |
pip install --upgrade pip
pip install .[docs]

- name: Build Docs
run: make docs
3 changes: 1 addition & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ sphinx:
formats: all

python:
version: 3.7
system_packages: true
install:
- method: pip
path: .
extra_requirements:
- docs
system_packages: true
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Gordo fulfills the role of inhaling config files and supplying components to the
* [gordo-core](https://github.com/equinor/gordo-core/) - Gordo core library.
* [gordo-client](https://github.com/equinor/gordo-client/) - Gordo server's client. It is able to make predictions from deployed models.

[Documentation is available on Read the Docs](https://gordo1.readthedocs.io/)

---
## Install

Expand Down Expand Up @@ -108,3 +110,10 @@ pytest -m 'dockertest'
> **_NOTE:_** this example is for Pycharm IDE to use `breakpoints` in the code of the tests.
> On the configuration setup for test running add to `Additional arguments:` in `pytest`
> section following string: `--ignore benchmarks --cov-report= --no-cov `

### Build the documentation

```console
> cd docs/
> make watch
```
8 changes: 7 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ help:

.PHONY: help Makefile

_static/architecture_diagram.png:
python3 ./_static/architecture_diagram.py

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
%: Makefile _static/architecture_diagram.png
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

watch: _static/architecture_diagram.png
sphinx-autobuild --watch "$(SOURCEDIR)/../gordo" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/_static/architecture_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/_static/architecture_diagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os

from diagrams import Diagram, Cluster
from diagrams.onprem.compute import Server
from diagrams.oci.compute import Functions
from diagrams.k8s.controlplane import API
from diagrams.k8s.others import CRD
from diagrams.k8s.compute import Job, Pod
from diagrams.k8s.storage import PV
from diagrams.custom import Custom

directory=os.path.dirname(__file__)

with Diagram("Gordo flow", filename=os.path.join(directory, "architecture_diagram"), outformat="png", show=False) as diag:
with Cluster("K8s"):
gordo = CRD("Gordo")
api = API("")
with Cluster("gordo-controller"):
Server("API")
controller = Functions("Controller")
with Cluster("gordo-server"):
server_api = Server("API")
dpl_job = Job("dpl")
workflow = Custom("Workflow", os.path.join(directory, "./argo_logo.png"))
model = CRD("Model")
gordo_volume = PV("storage")
model_builder1 = Pod("model_builder1")
model_builder2 = Pod("model_builder2")
gordo >> api
workflow >> model
api >> controller
controller >> dpl_job
dpl_job >> workflow
workflow >> model_builder1
workflow >> model_builder2
model_builder1 >> gordo_volume
model_builder2 >> gordo_volume
workflow >> server_api
gordo_volume >> server_api
Binary file added docs/_static/argo_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
12 changes: 12 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
API
---

.. toctree::
:maxdepth: 2

./builder.rst
./serializer.rst
./util.rst
./workflow.rst
./server/index.rst
./machine/index.rst
10 changes: 10 additions & 0 deletions docs/api/machine/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Machine
-------

.. toctree::
:maxdepth: 2

./machine.rst
./metadata.rst
./validators.rst
./model/index.rst
10 changes: 10 additions & 0 deletions docs/api/machine/machine.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Machine
-------

A ``Machine`` is the central unity of a model, dataset, metadata and everything
needed to create and build a ML model.

.. automodule:: gordo.machine.machine
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/api/machine/model/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Model
-----

.. toctree::
:maxdepth: 2

./anomaly.rst
./model-factories.rst
./transformer-funcs.rst
./transformers.rst
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The anomaly view into the model. Expects that the model being served
when accessing this route implements the ``anomaly()`` method
in order to calculate the anomaly key(s) for the response.

.. automodule:: gordo.server.views.anomaly
.. automodule:: gordo.server.blueprints.anomaly
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Provides the most basic view into the model. This view will
simply apply the model to the provided data and return the
``model-output`` along with the ``model-output``

.. automodule:: gordo.server.views.base
.. automodule:: gordo.server.blueprints.base
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/api/server/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Server
------

.. toctree::
:maxdepth: 2

./server.rst
./base.rst
./anomaly.rst
./utils.rst
7 changes: 7 additions & 0 deletions docs/api/server/server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Server
---------

.. automodule:: gordo.server.server
:members:
:undoc-members:
:show-inheritance:
14 changes: 14 additions & 0 deletions docs/api/server/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Utils
-----

.. automodule:: gordo.server.utils
:members:
:undoc-members:
:show-inheritance:

The general model input/output operations applied by blueprints.

.. automodule:: gordo.server.model_io
:members:
:undoc-members:
:show-inheritance:
File renamed without changes.
File renamed without changes.
64 changes: 0 additions & 64 deletions docs/components/machine/machine.rst

This file was deleted.

56 changes: 0 additions & 56 deletions docs/components/machine/model/model.rst

This file was deleted.

47 changes: 0 additions & 47 deletions docs/components/server/server.rst

This file was deleted.

Loading
0