From 7f0fbfdaa8d2a502b24d07a349f34aba131df4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCggemann?= <102391796+MichaelBrueggemann@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:09:50 +0100 Subject: [PATCH] Script for local server start (#67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test commit * test commit 2 * removed test files * test commit 4 * test2 * test3c * remove unnassesary files * fixed missing parantheses * results folder in .gitignore * Local server (#1) * accepeted changes * fixed bug through missing conversion of crs * added helper function * fixed wrong change * remove unused file * remove unused line * added file to run server locally * updated Readme for local server --------- Co-authored-by: mreiner1 Co-authored-by: Maximilian Reiner <90249470+ReinerMx@users.noreply.github.com> Co-authored-by: Brian Pϕndi --- .gitignore | 3 +++ Dockerfiles/start.R | 3 --- R/processes.R | 1 + README.md | 6 ++++++ startLocal.R | 20 ++++++++++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 startLocal.R diff --git a/.gitignore b/.gitignore index 2e83f89..97b79e4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ vignettes/*.pdf #mac .DS_Store + +#results from backend jobs +/results \ No newline at end of file diff --git a/Dockerfiles/start.R b/Dockerfiles/start.R index bf6ac18..0ab848d 100644 --- a/Dockerfiles/start.R +++ b/Dockerfiles/start.R @@ -1,6 +1,3 @@ -# Install package from GitHub -#remotes::install_github("PondiB/openeocubes", ref = "main", dependencies=TRUE, force = TRUE) - # Start service library(openeocubes) diff --git a/R/processes.R b/R/processes.R index 59c16ef..a8028c1 100644 --- a/R/processes.R +++ b/R/processes.R @@ -161,6 +161,7 @@ load_collection <- Process$new( max_bbx <- sf::st_bbox(max_pt) xmax_stac <- max_bbx$xmax ymax_stac <- max_bbx$ymax + message("....transformed to 4326") } diff --git a/README.md b/README.md index c5bc6e7..de2a1cb 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,12 @@ docker-compose build --no-cache && docker-compose up ``` +## Development Notes: +While developing, you can skip rebuilding the docker container everytime. Instead you can run the server locally. +Just run "Rscript startLocal.R" inside this directory. + +This will compile this Repository as a R Package and start the server. + ## Getting Started: ### Example 1: NDVI Script in R-Studio using OpenEO R-Client diff --git a/startLocal.R b/startLocal.R new file mode 100644 index 0000000..bdffef0 --- /dev/null +++ b/startLocal.R @@ -0,0 +1,20 @@ +# build and install package locally (use for development) +remotes::install_local('./',dependencies=TRUE, force=TRUE) + +# Start service +library(openeocubes) + + +aws.host <-Sys.getenv("AWSHOST") + +if (aws.host == ""){ + aws.host = NULL +} + +message("AWS host port id is:") +message(aws.host) + +config = SessionConfig(api.port = 8000, host = "0.0.0.0", aws.ipv4 = aws.host) +config$workspace.path = "/var/openeo/workspace" +createSessionInstance(config) +Session$startSession() \ No newline at end of file