-
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.
We are dropping support for LaTiS v2 and focusing on LaTiS v3. These changes are to migrate the HAPI service interface to fit in the LaTiS v3 service interface architecture, add an implementation of the HAPI algebra for LaTiS v3, and make any tweaks to the HAPI service required for LaTiS v3 support. In order to support producing a standalone executable, the SBT build has been modified to include dependencies on everything required to make a standalone server. This is a temporary hack to work around the fact that we don't have artifacts published that LaTiS can pull in.
- Loading branch information
Showing
52 changed files
with
669 additions
and
1,170 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,65 @@ | ||
# <img align="right" src="http://lasp.colorado.edu/home/wp-content/uploads/2012/01/lasp-logo.color_.1line-subtext.transp-bg.med_.png" height="75" width="256"/> LASP HAPI Server | ||
|
||
A [HAPI][hapi] server built on [LaTiS][latis]. | ||
A [HAPI][hapi] server built on [LaTiS][latis]. This project is based | ||
on LaTiS v3, which is currently under development. | ||
|
||
HAPI (Heliophysics API) is an interoperable, REST-style interface to | ||
timeseries data. We implement [version 2.0][hapi2] of the | ||
timeseries data. We implement [version 2.1][hapi2] of the | ||
specification. | ||
|
||
LaTiS is a library for describing and manipulating scientific data. By | ||
building a HAPI server on LaTiS, we can | ||
|
||
- use existing LaTiS adapters for a variety of data formats (ASCII, | ||
NetCDF, FITS, CDF, relational databases, etc.) | ||
- use existing LaTiS operations (filtering, subsetting, time and | ||
format conversions, etc.) | ||
- aggregate granules (e.g., a collection of files) into virtual | ||
datasets | ||
|
||
to make datasets in a wide variety of formats available through a HAPI | ||
interface. | ||
building a HAPI server on LaTiS, we can reuse existing LaTiS | ||
capabilities to make datasets in a wide variety of formats available | ||
through a HAPI interface. | ||
|
||
[hapi]: https://hapi-server.github.io/ | ||
[hapi2]: https://github.com/hapi-server/data-specification/blob/master/hapi-2.0.0/HAPI-data-access-spec-2.0.0.md | ||
[latis]: http://lasp.colorado.edu/home/mission-ops-data/tools-and-technologies/latis/ | ||
[hapi2]: https://github.com/hapi-server/data-specification/blob/master/hapi-2.1.0/HAPI-data-access-spec-2.1.0.md | ||
[latis]: https://github.com/latis-data/latis3 | ||
|
||
## Configuring Datasets | ||
## Getting Started | ||
|
||
See [Configuring Datasets](docs/configuring-datasets.md) for an | ||
example. | ||
First, download the [latest release][releases] of the `latis-hapi` | ||
script. | ||
|
||
## Running with Docker | ||
By default, running this script will start a HAPI server running on | ||
port 8080. It will look for FDML files in a directory called | ||
`datasets` in its working directory. | ||
|
||
The `docker` SBT task will build a Docker image. The Docker daemon | ||
must be running. | ||
Visit `http://localhost:8080/hapi/catalog` to verify that your | ||
datasets are visible to the server. | ||
|
||
Then run the container: | ||
[releases]: https://github.com/lasp/hapi-server/releases | ||
|
||
``` | ||
$ docker run -p 8080:8080 --mount type=bind,src=<CATALOG DIR>,dst=/srv/hapi <IMAGE ID> | ||
``` | ||
## Configuring Datasets | ||
|
||
The landing page will be available at `http://localhost:8080/hapi` | ||
with the default configuration. | ||
See [Configuring Datasets](docs/configuring-datasets.md) for an | ||
example of creating and validating FDML files. | ||
|
||
## Running with an executable JAR | ||
## Configuration | ||
|
||
The `assembly` SBT task will build an executable JAR. | ||
This server will run on port 8080 and serve datasets out of | ||
`./datasets` by default. Configuration is only necessary to change the | ||
port, location of FDML files, or enable additional endpoints. | ||
|
||
Then run the JAR: | ||
To configure the server, create a `latis.conf` file and start the | ||
server with the `-J-Dconfig.file=<path to latis.conf>` flag. | ||
|
||
``` | ||
$ java -jar <JAR> | ||
``` | ||
|
||
Or with a specific configuration file: | ||
Here is an example `latis.conf`: | ||
|
||
``` | ||
$ java -Dconfig.file=<CONF> -jar <JAR> | ||
``` | ||
# latis.conf | ||
The landing page will be available at `http://localhost:8080/hapi` | ||
with the default configuration. | ||
|
||
## Configuration | ||
latis { | ||
# Set the port: | ||
port = 8090 | ||
There are two methods for configuring the HAPI server: | ||
# Set the directory containing FDML files: | ||
fdml.dir = <path to FDML files> | ||
1. [HOCON][hocon] configuration file | ||
2. Environment variables | ||
|
||
### Configuration Options | ||
|
||
| Configuration key | Environment variable | Description | Default | | ||
| ----------------- | -------------------- | ---------------------------- | ---------------- | | ||
| `port` | `HAPI_PORT` | Port to listen on | 8080 | | ||
| `mapping` | `HAPI_MAPPING` | URL segment before `hapi` (e.g., `"/"` → `/hapi`, `"/foo/"` → `/foo/hapi`) | "/" | | ||
| `catalog-dir` | `HAPI_CATALOG` | Catalog directory | `./catalog` (JAR); `/srv/hapi` (Docker) | | ||
|
||
[hocon]: https://github.com/lightbend/config/blob/master/HOCON.md | ||
# Enable the DAP2 endpoint: | ||
services = [ | ||
{type: "class", mapping: "/hapi", class: "latis.service.hapi.HapiService"}, | ||
{type: "class", mapping: "/dap", class: "latis.service.dap2.Dap2Service"} | ||
] | ||
} | ||
``` |
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.