Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script for local server start (#67) #68

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()