|
1 | | -# Clowder V2 (In Active Development) |
| 1 | + |
2 | 2 |
|
3 | | -*For the previous version of Clowder, please see [Clowder V1](https://github.com/clowder-framework/clowder).* |
| 3 | +# Clowder v2 (In active development) |
| 4 | +[](https://github.com/clowder-framework/clowder2/actions?query=branch%3Amain) |
| 5 | +[](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA) |
4 | 6 |
|
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 | +[//]: # ([](https://clowder2.readthedocs.io/en/latest/?badge=latest)) |
11 | 8 |
|
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).* |
20 | 10 |
|
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. |
22 | 15 |
|
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. |
24 | 21 |
|
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: |
28 | 23 |
|
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 |
30 | 27 |
|
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 |
33 | 29 |
|
34 | | -## Developing |
| 30 | +The v2 documentation is still work in progress. It's available at https://clowder2.readthedocs.io. |
35 | 31 |
|
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). |
42 | 35 |
|
43 | | -### Initial Development Dependencies |
| 36 | +## Installation |
44 | 37 |
|
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. |
51 | 40 |
|
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. |
53 | 42 |
|
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 |
58 | 44 |
|
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: |
63 | 48 |
|
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. |
65 | 55 |
|
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. |
67 | 58 |
|
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 |
72 | 60 |
|
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]). |
74 | 63 |
|
75 | | -1. Switch to backend module directory `cd backend`. |
76 | | -2. Install dependencies using `pipenv install --dev`. |
| 64 | +## License |
77 | 65 |
|
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). |
0 commit comments