-
Notifications
You must be signed in to change notification settings - Fork 6
Docs cleanup #829
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
Merged
Merged
Docs cleanup #829
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
13da451
More general updates to documentation.
lmarini 18b7b1b
Pipfile for docs. There is also a requirements.txt.
lmarini b0d6b8a
Further docs cleanups.
lmarini 4178110
Fixed architecture diagram. Minor phrasing fixes.
lmarini e0e0cdd
Merge branch 'main' into docs-cleanup
lmarini 8b3468d
Removed badgie placeholder.
lmarini b662799
Updated text.
lmarini e08fa66
Black format.
lmarini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,42 @@ | ||
| [[source]] | ||
| url = "https://pypi.org/simple" | ||
| verify_ssl = true | ||
| name = "pypi" | ||
|
|
||
| [packages] | ||
| alabaster = "==0.7.12" | ||
| babel = "==2.9.1" | ||
| certifi = "==2021.10.8" | ||
| charset-normalizer = "==2.0.12" | ||
| commonmark = "==0.9.1" | ||
| docutils = "==0.17.1" | ||
| idna = "==3.3" | ||
| imagesize = "==1.3.0" | ||
| importlib-metadata = "==4.11.3" | ||
| jinja2 = "==3.0.3" | ||
| markupsafe = "==2.1.0" | ||
| packaging = "==21.3" | ||
| pyenchant = "==3.2.2" | ||
| pygments = "==2.11.2" | ||
| pyparsing = "==3.0.7" | ||
| pytz = "==2021.3" | ||
| recommonmark = "*" | ||
| requests = "==2.27.1" | ||
| snowballstemmer = "==2.2.0" | ||
| sphinx = "==4.4.0" | ||
| sphinxcontrib-applehelp = "==1.0.2" | ||
| sphinxcontrib-devhelp = "==1.0.2" | ||
| sphinxcontrib-htmlhelp = "==2.0.0" | ||
| sphinxcontrib-jsmath = "==1.0.1" | ||
| sphinxcontrib-qthelp = "==1.0.3" | ||
| sphinxcontrib-serializinghtml = "==1.1.5" | ||
| sphinxcontrib-spelling = "==7.3.2" | ||
| urllib3 = "==1.26.8" | ||
| zipp = "==3.7.0" | ||
| sphinx-autobuild = "*" | ||
| sphinx-material = "*" | ||
|
|
||
| [dev-packages] | ||
|
|
||
| [requires] | ||
| python_version = "3.9" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,138 +1,66 @@ | ||
| # Clowder V2 (In Active Development) | ||
|  | ||
|
|
||
| *For the previous version of Clowder, please see [Clowder V1](https://github.com/clowder-framework/clowder).* | ||
| # Clowder v2 (In active development) | ||
| [](https://github.com/clowder-framework/clowder2/actions?query=branch%3Amain) | ||
| [](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA) | ||
|
|
||
| Clowder V2 is a reimagining of the [Clowder](https://clowderframework.org/) research data management system | ||
| using a different and newer technology stack. While the Clowder V1 has served us well, many of the underlying | ||
| technologies and libraries have not received enough support in recent years and new developers have a difficult | ||
| time learning how to contribute to it. Clowder V2 is also an opportunity to leverage our experience working with | ||
| research data in Clowder and deliver | ||
| a better solution to common problems researchers encounter when working with data. | ||
| [//]: # ([](https://clowder2.readthedocs.io/en/latest/?badge=latest)) | ||
|
|
||
| In this version of Clowder, the application is clearly divided into backend and frontend modules. While this is somewhat | ||
| similar to Clowder V1, it used the [Play Framework](https://www.playframework.com/) and hence the fronted was created | ||
| at the server side, next to a standalone web Application Programming Interface (API). In Clowder V2, the | ||
| frontend module is a standalone [React](https://react.dev/) application and the backend, a | ||
| standalone [FastAPI](https://fastapi.tiangolo.com/lo/) web API. We continue to leverage | ||
| [MongoDB](https://www.mongodb.com/), [RabbitMQ](https://www.rabbitmq.com/), | ||
| and [Elasticsearch](https://www.elastic.co/). We also use [MinIO](https://min.io/) out of the box as the default object | ||
| store and [Traefik](https://traefik.io/traefik/) as the application proxy. | ||
| *For the previous version of Clowder, please see [Clowder v1](https://github.com/clowder-framework/clowder).* | ||
|
|
||
| ## Running in Docker | ||
| Clowder v2 is a reimagining of the [Clowder research data management system](https://clowderframework.org/) | ||
| using a different and newer technology stack. Clowder is a cloud native data management framework to support any | ||
| research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data, | ||
| complex metadata, and automatic data pipelines. | ||
|
|
||
| To run the full stack using [Docker](https://www.docker.com/) (recommended), please use the following instructions: | ||
| While the Clowder v1 has worked well over the years, many of the underlying | ||
| technologies and libraries have not received enough support in recent years and new developers have had a challenging | ||
| time learning how to contribute to it. | ||
| Clowder v2 is also an opportunity to leverage our experience working with | ||
| research data in Clowder and deliver a better solution to common problems researchers encounter when working with data. | ||
|
|
||
| 1. Run all Docker services with `docker compose up --scale backend=4 --build`. This will start the services with four | ||
| instances of the backend module running in parallel. Note the `--build` flag used to build the images first. If using | ||
| default images, that flag can be removed. The images can also be built with `docker compose build`. | ||
| Clowder v2 provides: | ||
|
|
||
| 2. The application will be running and available at `http://localhost`. | ||
| - a better user experience and user interface | ||
| - an easier code base to pick up and modify written in Python/FastAPI and Typescript/React | ||
| - new features based on our experience working with researchers | ||
|
|
||
| 3. To access the Traefik dashboard, go to `http://localhost:8080`. To view the raw | ||
| settings, go to `http://localhost:8080/api/rawdata`. | ||
| ## Documentation | ||
|
|
||
| ## Developing | ||
| The v2 documentation is still work in progress. It's available at https://clowder2.readthedocs.io. | ||
lmarini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| When developing, the required services can be run using Docker. You can then run the backend | ||
| and frontend modules from the command line or in your favorite IDE (to make debugging easier). We recommend | ||
| using [PyCharm](https://www.jetbrains.com/pycharm/) and have | ||
| made our run configurations available in the `.run` folder. PyCharm should automatically import it, but you will have | ||
| to change the path to the Python virtual environment to point to your path on your host (see Initial Dependencies | ||
| section below). | ||
| The v1 documentation is not fully compatible with v2, but it does provide some still relevant information. | ||
| It is available at https://clowder-framework.readthedocs.io. | ||
| There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html). | ||
|
|
||
| ### Initial Development Dependencies | ||
| ## Installation | ||
|
|
||
| - Run `python3 -m venv venv` to create a Python Virtual Environment and add it to PyCharm by navigating to | ||
| `PyCharm -> Settings... -> Project: clowder2 -> Python Interpreter -> Add Interpreter`. | ||
| - Run `source venv/bin/activate && pip install --upgrade pip` to activate the created Python Virtual Environment and | ||
| upgrade | ||
| pip. | ||
| - Run `pip install pipenv` to install [Pipenv](https://pipenv.pypa.io/en/latest/). | ||
| The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2) | ||
| and running `docker compose up` in the main directory. | ||
|
|
||
| ### Required Services | ||
| 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. | ||
|
|
||
| - Running `./docker-dev.sh up` brings up the required services in the background. | ||
| - Running `docker-compose logs -f` displays the live logs for all containers. To view the logs of individual containers, | ||
| provide the container name. For example, for viewing the backend module logs, run `docker-compose logs -f backend`. | ||
| - Running `./docker-dev.sh down` brings down the required services. | ||
| ## Contributing | ||
|
|
||
| **Note:** `./docker-dev.sh` sets the project name flag to `-p clowder2-dev`. This is so that the dev containers | ||
| don't get mixed with the production containers if the user is running both on the same machine using `docker-compose.yml`. | ||
| If this is not used, the keycloak container will use the volume created with the other docker compose and it will be | ||
| unable to run as the information stored in the postgres database is different. | ||
| We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new | ||
| feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and | ||
| providing feedback. Here are a few ways to get started: | ||
|
|
||
| ### Backend Module | ||
| - Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA) | ||
| channel, introduce yourself, and ask questions about the specific aspects of the system you are interested in. | ||
| - Submit an issue (bug or feature request) on the [issue tracker](https://github.com/clowder-framework/clowder2/issues). | ||
| - Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For | ||
| larger changes, it's best to open an issue first or ask on Slack to discuss the changes. | ||
| - Develop new [information extractors](https://github.com/clowder-framework/pyclowder) and/or visualizations. | ||
|
|
||
| After starting up the required services, setup and run the backend module. | ||
| Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when | ||
| interacting with the community. | ||
|
|
||
| The backend module is developed using [Python](https://www.python.org/), [FastAPI](https://fastapi.tiangolo.com/), | ||
| and [Motor](https://motor.readthedocs.io/en/stable/). | ||
| We recommend using [Python 3.9](https://www.python.org/downloads/) | ||
| and Pipenv for dependency management. | ||
| ## Support & Contacts | ||
|
|
||
| #### Install Backend Dependencies | ||
| The easiest way to get in touch with us is [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA). | ||
| This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]). | ||
|
|
||
| 1. Switch to backend module directory `cd backend`. | ||
| 2. Install dependencies using `pipenv install --dev`. | ||
| ## License | ||
|
|
||
| #### Run Backend Module | ||
|
|
||
| You can run the backend module using either of the below options: | ||
|
|
||
| - Using the PyCharm's run configuration by navigating to `PyCharm -> Run -> Run...` and clicking `uvicorn`. Running | ||
| directly from PyCharm helps the developer by providing easy access to its debugging features. | ||
| - From the command line by running `pipenv run uvicorn app.main:app --reload` . | ||
|
|
||
| Additional steps/details: | ||
|
|
||
| 1. API docs are available at `http://localhost:8000/docs`. The API base URL is `http://localhost:8000/api/v2`. | ||
| 2. Create a user using `POST /api/v2/users` and getting a JWT token by using `POST /api/v2/login`. Place the token in | ||
| header of requests that require authentications using the `Authorization: Bearer <your token>` HTTP header. | ||
| * You can also run the frontend module below and use the Login link available there. | ||
| 3. Manually run tests before pushing with `pipenv run pytest -v` or right-clicking on `test` folder and clicking `Run` | ||
| in PyCharm. | ||
| 4. Linting is done using [Black]((https://black.readthedocs.io/en/stable/)). You can set up PyCharm to automatically | ||
| run it when you save a file using | ||
| these [instructions](https://black.readthedocs.io/en/stable/integrations/editors.html). | ||
| The git repository includes an action to run Black on push and pull_request. | ||
| 5. Before pushing new code, please make sure all files are properly formatted by running the following command in | ||
| the `/backend` directory: | ||
| ```pipenv run black app``` | ||
|
|
||
| ### Frontend Module | ||
|
|
||
| To run the frontend, both required services and the backend module must be running successfully. | ||
|
|
||
| The frontend module is developed using [TypeScript](https://www.typescriptlang.org/), [React](https://reactjs.org/), | ||
| [Material UI](https://mui.com/), [Redux](https://redux.js.org/), [webpack](https://webpack.js.org/), | ||
| [Node.js](https://nodejs.org). We recommend using Node v16.15 LTS. | ||
|
|
||
| #### Install Frontend Dependencies | ||
|
|
||
| 1. Switch to frontend directory `cd ../frontend`. | ||
| 2. Install dependencies: `npm install` | ||
|
|
||
| #### Run Frontend Module | ||
|
|
||
| You can run the frontend module using either of the below options: | ||
|
|
||
| - Using the PyCharm's run configuration by navigating to `PyCharm -> Run -> Run...` and clicking `start:dev`. Running | ||
| directly from PyCharm helps the developer by providing easy access to its debugging features. | ||
| - From the command line by running `npm run start:dev` | ||
| - By default, the backend module runs at `http://localhost:8000`. If running at different URL/port, use: | ||
| `CLOWDER_REMOTE_HOSTNAME=http://<hostname or IP address>:<port number> npm start` | ||
| - After modifying the backend module API, update autogenerated client function calls: | ||
| - Backend module must be running | ||
| - Run codegen: `npm run codegen:v2:dev` | ||
|
|
||
| ### Configuring Keycloak | ||
|
|
||
| - If you are developer running the dev stack on your local machine, please import | ||
| the [Keycloak](https://www.keycloak.org/) realm setting file `/scripts/keycloak/clowder-realm-dev.json` | ||
| - If you are running production docker compose on local machine, please import the Keycloak realm setting file | ||
| `/scripts/keycloak/clowder-realm-prod.json` | ||
| - If you are deploying on the kubernetes cluster (https://clowder2.software-dev.ncsa.cloud/), please import the | ||
| Keycloak realm setting file `/scripts/keycloak/mini-kube-clowder-realm-prod.json` | ||
|
|
||
| **For more details on how to set up Keycloak, please refer to | ||
| this [Documentation](docs/source/configure-keycloak-realm.md)** | ||
| Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE). | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
| # Architecture | ||
|
|
||
| Clowder v2 follows the architecture of v1, we the additional split of the server side into | ||
| multiple standalone containers. | ||
| Each box below is a docker service as defined in `docker-compose.yml`. | ||
| Boxes are grouped logically into backend, keycloak, extractors, database boxes. | ||
| Lines show interactions between containers over the docker network. | ||
|
|
||
|  |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.