Skip to content

Commit

Permalink
Script for local server start
Browse files Browse the repository at this point in the history
* 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: Michael Brüggemann <[email protected]>
Co-authored-by: mreiner1 <[email protected]>
Co-authored-by: Maximilian Reiner <[email protected]>
  • Loading branch information
4 people authored Dec 13, 2023
1 parent 98967b7 commit da9c6d4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ vignettes/*.pdf

#mac
.DS_Store

#results from backend jobs
/results
3 changes: 0 additions & 3 deletions Dockerfiles/start.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Install package from GitHub
#remotes::install_github("PondiB/openeocubes", ref = "main", dependencies=TRUE, force = TRUE)

# Start service
library(openeocubes)

Expand Down
1 change: 1 addition & 0 deletions R/processes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions startLocal.R
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit da9c6d4

Please sign in to comment.