-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from FREVA-CLINT/new-layout
Restructure and client library,
- Loading branch information
Showing
60 changed files
with
3,494 additions
and
512 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,16 +1,15 @@ | ||
# A REST API for the freva databrowser | ||
# Freva server - client structure | ||
|
||
[](LICENSE) | ||
[](https://www.python.org/downloads/release/python-312/) | ||
[](https://freva-clint.github.io/databrowserAPI) | ||
[](https://github.com/FREVA-CLINT/databrowserAPI/actions) | ||
[](https://codecov.io/github/FREVA-CLINT/databrowserAPI) | ||
|
||
The Freva Databrowser REST API is a powerful tool that enables you to search | ||
for climate and environmental datasets seamlessly in various programming | ||
languages. By generating RESTful requests, you can effortlessly access | ||
collections of various datasets, making it an ideal resource for climate | ||
scientists, researchers, and data enthusiasts. | ||
This repository contains the *freva-rest services* defining rest endpoints | ||
that make up the freva server services as well as the client | ||
services that provide command line interfaces and python libraries for their | ||
rest service counterparts. | ||
|
||
## Table of Contents | ||
|
||
|
@@ -30,36 +29,59 @@ git clone [email protected]:FREVA-CLINT/databrowserAPI.git | |
cd databrowserAPI | ||
``` | ||
|
||
4. Install the API: | ||
3. Install flit: | ||
Flit is used as the build system for development purpose. Install flit | ||
into your current python environment: | ||
|
||
```console | ||
python -m pip install -e .[dev] | ||
python3 -m pip install flit | ||
``` | ||
|
||
4. Install the rest-api: | ||
|
||
```console | ||
pip install -e freva-rest | ||
``` | ||
|
||
5. Install the client library | ||
|
||
```console | ||
pip install -e freva-client | ||
``` | ||
|
||
## Development Environment | ||
Apache solr is needed run the system in a development environment, here we | ||
set up solr in a docker container using the `docker-compose` command, ensure | ||
you have Docker Compose installed on your system. | ||
Various services, such as apache solr are needed to run the rest services system | ||
in a development environment. Here we set up these services in a containers | ||
using the `docker-compose` or `podman-compose` command, ensure | ||
you have `docker-compose` or `podman-compose` installed on your system. | ||
Then, run the following command: | ||
|
||
```console | ||
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans | ||
``` | ||
|
||
if you use `podman-compose`: | ||
|
||
```console | ||
podman-compose -f dev-env/docker-compose.yaml up -d --remove-orphans | ||
``` | ||
|
||
This will start the required services and containers to create the development | ||
environment. You can now develop and test the project within this environment. | ||
|
||
After solr is up and running you can start the REST server the following: | ||
After the containers are up and running you can start the REST server the following: | ||
|
||
```console | ||
python -m databrowser.cli --config-file api_config.toml --debug --dev --port 7777 | ||
freva-rest-server -c api_config.toml --debug --dev | ||
``` | ||
|
||
The ``--debug`` and ``--dev`` flag will make sure that any changes are loaded. | ||
You can choose any port you like. Furthermore the ``--dev`` flag will pre | ||
load an empty apache solr server with some data. If you don't like that | ||
simply do not pass the ``--dev`` flag. | ||
load any existing test data. If you don't like that simply do not pass the | ||
``--dev`` flag. | ||
|
||
|
||
### Testing | ||
## Testing | ||
|
||
Unit tests, Example notebook tests, type annotations and code style tests | ||
are done with [tox](https://tox.wiki/en/latest/). To run all tests, linting | ||
|
This file contains 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 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 @@ | ||
conda env config vars set FREVA_CONFIG=$PWD/dev-env/freva.toml |
This file contains 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,4 @@ | ||
# Central freva config file | ||
[freva] | ||
project_name = "freva-dev" | ||
host = "localhost:8080" |
This file contains 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.