Skip to content

Commit 6ebfdc3

Browse files
authored
Docs cleanup (#829)
* More general updates to documentation. * Pipfile for docs. There is also a requirements.txt. * Further docs cleanups. * Fixed architecture diagram. Minor phrasing fixes. * Removed badgie placeholder. * Updated text. * Black format.
1 parent 3e71882 commit 6ebfdc3

28 files changed

+874
-178
lines changed

Pipfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
alabaster = "==0.7.12"
8+
babel = "==2.9.1"
9+
certifi = "==2021.10.8"
10+
charset-normalizer = "==2.0.12"
11+
commonmark = "==0.9.1"
12+
docutils = "==0.17.1"
13+
idna = "==3.3"
14+
imagesize = "==1.3.0"
15+
importlib-metadata = "==4.11.3"
16+
jinja2 = "==3.0.3"
17+
markupsafe = "==2.1.0"
18+
packaging = "==21.3"
19+
pyenchant = "==3.2.2"
20+
pygments = "==2.11.2"
21+
pyparsing = "==3.0.7"
22+
pytz = "==2021.3"
23+
recommonmark = "*"
24+
requests = "==2.27.1"
25+
snowballstemmer = "==2.2.0"
26+
sphinx = "==4.4.0"
27+
sphinxcontrib-applehelp = "==1.0.2"
28+
sphinxcontrib-devhelp = "==1.0.2"
29+
sphinxcontrib-htmlhelp = "==2.0.0"
30+
sphinxcontrib-jsmath = "==1.0.1"
31+
sphinxcontrib-qthelp = "==1.0.3"
32+
sphinxcontrib-serializinghtml = "==1.1.5"
33+
sphinxcontrib-spelling = "==7.3.2"
34+
urllib3 = "==1.26.8"
35+
zipp = "==3.7.0"
36+
sphinx-autobuild = "*"
37+
sphinx-material = "*"
38+
39+
[dev-packages]
40+
41+
[requires]
42+
python_version = "3.9"

Pipfile.lock

Lines changed: 521 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 45 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,66 @@
1-
# Clowder V2 (In Active Development)
1+
![](docs/source/img/logo_full.png)
22

3-
*For the previous version of Clowder, please see [Clowder V1](https://github.com/clowder-framework/clowder).*
3+
# Clowder v2 (In active development)
4+
[![Build Status](https://github.com/clowder-framework/clowder2/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/clowder-framework/clowder2/actions?query=branch%3Amain)
5+
[![Slack](https://img.shields.io/badge/Slack-4A154B?&logo=slack&logoColor=white)](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
46

5-
Clowder V2 is a reimagining of the [Clowder](https://clowderframework.org/) research data management system
6-
using a different and newer technology stack. While the Clowder V1 has served us well, many of the underlying
7-
technologies and libraries have not received enough support in recent years and new developers have a difficult
8-
time learning how to contribute to it. Clowder V2 is also an opportunity to leverage our experience working with
9-
research data in Clowder and deliver
10-
a better solution to common problems researchers encounter when working with data.
7+
[//]: # ([![Documentation Status](https://readthedocs.org/projects/clowder2/badge/?version=latest)](https://clowder2.readthedocs.io/en/latest/?badge=latest))
118

12-
In this version of Clowder, the application is clearly divided into backend and frontend modules. While this is somewhat
13-
similar to Clowder V1, it used the [Play Framework](https://www.playframework.com/) and hence the fronted was created
14-
at the server side, next to a standalone web Application Programming Interface (API). In Clowder V2, the
15-
frontend module is a standalone [React](https://react.dev/) application and the backend, a
16-
standalone [FastAPI](https://fastapi.tiangolo.com/lo/) web API. We continue to leverage
17-
[MongoDB](https://www.mongodb.com/), [RabbitMQ](https://www.rabbitmq.com/),
18-
and [Elasticsearch](https://www.elastic.co/). We also use [MinIO](https://min.io/) out of the box as the default object
19-
store and [Traefik](https://traefik.io/traefik/) as the application proxy.
9+
*For the previous version of Clowder, please see [Clowder v1](https://github.com/clowder-framework/clowder).*
2010

21-
## Running in Docker
11+
Clowder v2 is a reimagining of the [Clowder research data management system](https://clowderframework.org/)
12+
using a different and newer technology stack. Clowder is a cloud native data management framework to support any
13+
research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data,
14+
complex metadata, and automatic data pipelines.
2215

23-
To run the full stack using [Docker](https://www.docker.com/) (recommended), please use the following instructions:
16+
While the Clowder v1 has worked well over the years, many of the underlying
17+
technologies and libraries have not received enough support in recent years and new developers have had a challenging
18+
time learning how to contribute to it.
19+
Clowder v2 is also an opportunity to leverage our experience working with
20+
research data in Clowder and deliver a better solution to common problems researchers encounter when working with data.
2421

25-
1. Run all Docker services with `docker compose up --scale backend=4 --build`. This will start the services with four
26-
instances of the backend module running in parallel. Note the `--build` flag used to build the images first. If using
27-
default images, that flag can be removed. The images can also be built with `docker compose build`.
22+
Clowder v2 provides:
2823

29-
2. The application will be running and available at `http://localhost`.
24+
- a better user experience and user interface
25+
- an easier code base to pick up and modify written in Python/FastAPI and Typescript/React
26+
- new features based on our experience working with researchers
3027

31-
3. To access the Traefik dashboard, go to `http://localhost:8080`. To view the raw
32-
settings, go to `http://localhost:8080/api/rawdata`.
28+
## Documentation
3329

34-
## Developing
30+
The v2 documentation is still work in progress. It's available at https://clowder2.readthedocs.io.
3531

36-
When developing, the required services can be run using Docker. You can then run the backend
37-
and frontend modules from the command line or in your favorite IDE (to make debugging easier). We recommend
38-
using [PyCharm](https://www.jetbrains.com/pycharm/) and have
39-
made our run configurations available in the `.run` folder. PyCharm should automatically import it, but you will have
40-
to change the path to the Python virtual environment to point to your path on your host (see Initial Dependencies
41-
section below).
32+
The v1 documentation is not fully compatible with v2, but it does provide some still relevant information.
33+
It is available at https://clowder-framework.readthedocs.io.
34+
There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html).
4235

43-
### Initial Development Dependencies
36+
## Installation
4437

45-
- Run `python3 -m venv venv` to create a Python Virtual Environment and add it to PyCharm by navigating to
46-
`PyCharm -> Settings... -> Project: clowder2 -> Python Interpreter -> Add Interpreter`.
47-
- Run `source venv/bin/activate && pip install --upgrade pip` to activate the created Python Virtual Environment and
48-
upgrade
49-
pip.
50-
- Run `pip install pipenv` to install [Pipenv](https://pipenv.pypa.io/en/latest/).
38+
The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2)
39+
and running `docker compose up` in the main directory.
5140

52-
### Required Services
41+
Helm charts are available for running Clowder v2 on Kubernetes. See the [helm](https://github.com/clowder-framework/clowder2/tree/main/deployments/kubernetes/charts) directory for more information.
5342

54-
- Running `./docker-dev.sh up` brings up the required services in the background.
55-
- Running `docker-compose logs -f` displays the live logs for all containers. To view the logs of individual containers,
56-
provide the container name. For example, for viewing the backend module logs, run `docker-compose logs -f backend`.
57-
- Running `./docker-dev.sh down` brings down the required services.
43+
## Contributing
5844

59-
**Note:** `./docker-dev.sh` sets the project name flag to `-p clowder2-dev`. This is so that the dev containers
60-
don't get mixed with the production containers if the user is running both on the same machine using `docker-compose.yml`.
61-
If this is not used, the keycloak container will use the volume created with the other docker compose and it will be
62-
unable to run as the information stored in the postgres database is different.
45+
We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new
46+
feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and
47+
providing feedback. Here are a few ways to get started:
6348

64-
### Backend Module
49+
- Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
50+
channel, introduce yourself, and ask questions about the specific aspects of the system you are interested in.
51+
- Submit an issue (bug or feature request) on the [issue tracker](https://github.com/clowder-framework/clowder2/issues).
52+
- Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For
53+
larger changes, it's best to open an issue first or ask on Slack to discuss the changes.
54+
- Develop new [information extractors](https://github.com/clowder-framework/pyclowder) and/or visualizations.
6555

66-
After starting up the required services, setup and run the backend module.
56+
Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when
57+
interacting with the community.
6758

68-
The backend module is developed using [Python](https://www.python.org/), [FastAPI](https://fastapi.tiangolo.com/),
69-
and [Motor](https://motor.readthedocs.io/en/stable/).
70-
We recommend using [Python 3.9](https://www.python.org/downloads/)
71-
and Pipenv for dependency management.
59+
## Support & Contacts
7260

73-
#### Install Backend Dependencies
61+
The easiest way to get in touch with us is [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA).
62+
This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]).
7463

75-
1. Switch to backend module directory `cd backend`.
76-
2. Install dependencies using `pipenv install --dev`.
64+
## License
7765

78-
#### Run Backend Module
79-
80-
You can run the backend module using either of the below options:
81-
82-
- Using the PyCharm's run configuration by navigating to `PyCharm -> Run -> Run...` and clicking `uvicorn`. Running
83-
directly from PyCharm helps the developer by providing easy access to its debugging features.
84-
- From the command line by running `pipenv run uvicorn app.main:app --reload` .
85-
86-
Additional steps/details:
87-
88-
1. API docs are available at `http://localhost:8000/docs`. The API base URL is `http://localhost:8000/api/v2`.
89-
2. Create a user using `POST /api/v2/users` and getting a JWT token by using `POST /api/v2/login`. Place the token in
90-
header of requests that require authentications using the `Authorization: Bearer <your token>` HTTP header.
91-
* You can also run the frontend module below and use the Login link available there.
92-
3. Manually run tests before pushing with `pipenv run pytest -v` or right-clicking on `test` folder and clicking `Run`
93-
in PyCharm.
94-
4. Linting is done using [Black]((https://black.readthedocs.io/en/stable/)). You can set up PyCharm to automatically
95-
run it when you save a file using
96-
these [instructions](https://black.readthedocs.io/en/stable/integrations/editors.html).
97-
The git repository includes an action to run Black on push and pull_request.
98-
5. Before pushing new code, please make sure all files are properly formatted by running the following command in
99-
the `/backend` directory:
100-
```pipenv run black app```
101-
102-
### Frontend Module
103-
104-
To run the frontend, both required services and the backend module must be running successfully.
105-
106-
The frontend module is developed using [TypeScript](https://www.typescriptlang.org/), [React](https://reactjs.org/),
107-
[Material UI](https://mui.com/), [Redux](https://redux.js.org/), [webpack](https://webpack.js.org/),
108-
[Node.js](https://nodejs.org). We recommend using Node v16.15 LTS.
109-
110-
#### Install Frontend Dependencies
111-
112-
1. Switch to frontend directory `cd ../frontend`.
113-
2. Install dependencies: `npm install`
114-
115-
#### Run Frontend Module
116-
117-
You can run the frontend module using either of the below options:
118-
119-
- Using the PyCharm's run configuration by navigating to `PyCharm -> Run -> Run...` and clicking `start:dev`. Running
120-
directly from PyCharm helps the developer by providing easy access to its debugging features.
121-
- From the command line by running `npm run start:dev`
122-
- By default, the backend module runs at `http://localhost:8000`. If running at different URL/port, use:
123-
`CLOWDER_REMOTE_HOSTNAME=http://<hostname or IP address>:<port number> npm start`
124-
- After modifying the backend module API, update autogenerated client function calls:
125-
- Backend module must be running
126-
- Run codegen: `npm run codegen:v2:dev`
127-
128-
### Configuring Keycloak
129-
130-
- If you are developer running the dev stack on your local machine, please import
131-
the [Keycloak](https://www.keycloak.org/) realm setting file `/scripts/keycloak/clowder-realm-dev.json`
132-
- If you are running production docker compose on local machine, please import the Keycloak realm setting file
133-
`/scripts/keycloak/clowder-realm-prod.json`
134-
- If you are deploying on the kubernetes cluster (https://clowder2.software-dev.ncsa.cloud/), please import the
135-
Keycloak realm setting file `/scripts/keycloak/mini-kube-clowder-realm-prod.json`
136-
137-
**For more details on how to set up Keycloak, please refer to
138-
this [Documentation](docs/source/configure-keycloak-realm.md)**
66+
Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE).

deployments/kubernetes/charts/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Clowder 2
1+
# Clowder v2 Helm Charts
22

3-
This depends on some subcharts, make sure to have them installed if you plan on modifying the helm chart:
3+
Helm charts depend on some subcharts, make sure to have them installed if you plan on modifying the helm chart:
44

55
```bash
66
helm repo add bitnami https://charts.bitnami.com/bitnami
@@ -28,9 +28,9 @@ Now you can install (or upgrade) clowder using:
2828
helm upgrade --install --namespace clowder2 --create-namespace --values local.yaml clowder2 .
2929
```
3030

31-
# Docker Desktop
31+
## Ingress Controller
3232

33-
You will need an ingress controller, I like Traefik as my ingress controller. You install this with:
33+
You will need an ingress controller. Traefik works well as ingress controller. You can install it with:
3434

3535
```bash
3636
helm install --namespace traefik --create-namespace traefik traefik/traefik

docs/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,32 @@ Uses [Sphinx](https://www.sphinx-doc.org). Requires [enchant](https://pyenchant.
55

66
Currently deployed at https://clowder2.readthedocs.io.
77

8+
If you have installed `sphinx-autobuild docs/source docs/build/html` you can use it to automatically rebuild the docs
9+
when you make changes.
10+
11+
```shell
12+
sphinx-autobuild source build/html
13+
14+
open http://localhost:8000/
15+
```
16+
17+
If you don't have `sphinx-autobuild` installed, you can use the Makefile.
18+
819
```shell
920
# build
1021
make html
1122

1223
# view
13-
python3 -m http.server --directory build/html
24+
python3 -m http.server 7000 --directory build/html
25+
open http://localhost:7000/
1426

1527
# check links
1628
make linkcheck
29+
```
1730

18-
# spell checking
31+
You can check spelling with `make spelling`. This requires `enchant` to be installed.
1932

33+
```shell
2034
# install enchant once, on mac
2135
brew install enchant
2236

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ recommonmark==0.7.1
1818
requests==2.27.1
1919
snowballstemmer==2.2.0
2020
Sphinx==4.4.0
21+
sphinx-autobuild==2021.3.14
2122
sphinxcontrib-applehelp==1.0.2
2223
sphinxcontrib-devhelp==1.0.2
2324
sphinxcontrib-htmlhelp==2.0.0

docs/source/architecture.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Architecture
2+
3+
Clowder v2 follows the architecture of v1, we the additional split of the server side into
4+
multiple standalone containers.
5+
Each box below is a docker service as defined in `docker-compose.yml`.
6+
Boxes are grouped logically into backend, keycloak, extractors, database boxes.
7+
Lines show interactions between containers over the docker network.
8+
9+
![Clowder v2 architecture](img/architecture.jpg)

docs/source/conf.py

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = "Clowder v2"
21-
copyright = "2022, Luigi Marini"
22-
author = "Luigi Marini"
20+
project = "Clowder2"
21+
copyright = "2022, Clowder Devs"
22+
author = "Clowder Devs"
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = "0.1"
25+
release = "2.0.0-beta.1"
2626

2727

2828
# -- General configuration ---------------------------------------------------
@@ -40,13 +40,51 @@
4040
# This pattern also affects html_static_path and html_extra_path.
4141
exclude_patterns = []
4242

43-
4443
# -- Options for HTML output -------------------------------------------------
4544

4645
# The theme to use for HTML and HTML Help pages. See the documentation for
4746
# a list of builtin themes.
4847
#
49-
html_theme = "alabaster"
48+
html_theme = "sphinx_material"
49+
50+
# Set link name generated in the top bar.
51+
html_title = "Clowder v2"
52+
53+
# Material theme options (see theme.conf for more information)
54+
html_sidebars = {
55+
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
56+
}
57+
html_theme_options = {
58+
# Set the name of the project to appear in the navigation.
59+
"nav_title": "Clowder v2",
60+
# Set you GA account ID to enable tracking
61+
"google_analytics_account": "UA-XXXXX",
62+
# Specify a base_url used to generate sitemap.xml. If not
63+
# specified, then no sitemap will be built.
64+
"base_url": "https://clowder2.readthedocs.io/",
65+
# Set the color and the accent color
66+
"color_primary": "blue",
67+
"color_accent": "light-blue",
68+
# Set the repo location to get a badge with stats
69+
"repo_url": "https://github.com/clowder-framework/clowder2",
70+
"repo_name": "Clowder2",
71+
# Visible levels of the global TOC; -1 means unlimited
72+
"globaltoc_depth": 2,
73+
# If False, expand all TOC entries
74+
"globaltoc_collapse": True,
75+
# If True, show hidden TOC entries
76+
"globaltoc_includehidden": False,
77+
}
78+
79+
import os
80+
81+
FORCE_CLASSIC = os.environ.get("SPHINX_MATERIAL_FORCE_CLASSIC", False)
82+
FORCE_CLASSIC = FORCE_CLASSIC in ("1", "true")
83+
if FORCE_CLASSIC:
84+
print("!!!!!!!!! Forcing classic !!!!!!!!!!!")
85+
html_theme = "classic"
86+
html_theme_options = {}
87+
html_sidebars = {"**": ["globaltoc.html", "localtoc.html", "searchbox.html"]}
5088

5189
# Add any paths that contain custom static files (such as style sheets) here,
5290
# relative to this directory. They are copied after the builtin static files,

0 commit comments

Comments
 (0)