Sign inSign up

technologiestiftung/flusshygiene-opencpu-base

By technologiestiftung

•Updated about 5 years ago

This is the base image containing all dependencies for the flusshygiene-opencpu-fhpredict-api

Image
0

8.3K

technologiestiftung/flusshygiene-opencpu-base repository overview

⁠Flusshygiene OpenCPU Base Image

This is the base image containing all dependencies for the flusshygiene-opencpu-api⁠ which uses the kwb-r/fhpredict⁠ R package for creating predictions used in the Flusshygiene project. It can be found here on hub.docker.com⁠.

⁠Notes

  • The image takes a long time to build. Make sure your system has at least 4 GB Memory available.
  • Uses github/actions⁠ to build in the cloud. Make sure you have the following secrets set:
    • DOCKER_USER
    • DOCKER_PASSWORD

⁠Setup

Rename example.env to .env and fill in all the values.

⁠Usage

!Note: $ indicates the command > the result in code blocks. Where no response is shown the $ is omitted.

For a full usage of the opencpu api visit www.opencpu.org/api.html⁠.

For local build and run do a docker-compose up in the root of the repo.

To test if everything worked fine run:

curl "http://localhost:8004/ocpu/info"

or visit localhost:8004/ocpu/test/⁠ and make some requests.

You can use same of the included packages by running commands like these:

curl "http://localhost:8004/ocpu/library/stats/R/rnorm" -d "n=10&mean=5"

Which will respond with:

$ curl "http://localhost:8004/ocpu/library/stats/R/rnorm" -d "n=10&mean=5" 
> /ocpu/tmp/x0fb93b3a614e02/R/.val
> /ocpu/tmp/x0fb93b3a614e02/R/rnorm
> /ocpu/tmp/x0fb93b3a614e02/stdout
> /ocpu/tmp/x0fb93b3a614e02/source
> /ocpu/tmp/x0fb93b3a614e02/console
> /ocpu/tmp/x0fb93b3a614e02/info
> /ocpu/tmp/x0fb93b3a614e02/files/DESCRIPTION

Now call the following commands to see the result:

$ curl "http://localhost:8004/ocpu/tmp/x0fb93b3a614e02/R/.val/print"
> [1] 3.516998 6.021151 5.031592 5.938907 5.584654 4.188811 4.224427 5.126916
> [9] 4.980865 4.708501

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

547.2 MB

Last updated

about 5 years ago

docker pull technologiestiftung/flusshygiene-opencpu-base:v2.13.0-dev