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

Configure /config/config.R #17

Merged
merged 8 commits into from
Mar 25, 2024
4 changes: 2 additions & 2 deletions R/fct_workflow_status.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#' @import tibble
#'
#' @noRd

source("config/config.R")

workflow_status <- function(report){
server <- rpecanapi::connect("http://141.142.217.168/", "carya", "illinois")
server <- rpecanapi::connect(host_url, "carya", "illinois")
id <- report$workflow_id
result <- data.frame()
for (i in id) {
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@ The PEcan Status Board can be installed locally from [GitHub](https://github.com
# install.packages("devtools")
devtools::install_github("PecanProject/pecan-status-board")
```
``` r

``` r
library("statusboard")
```

### Running The Dashboard

Now, within the `config/config.R` file, you can set the `host_url` to the PEcAn dockerised server you want to monitor. By default, it is set to the PEcAn API server hosted at [http://pecan.localhost/](http://pecan.localhost/).

``` r
# Run this code to start the dashboard locally
statusboard::run_app()

```

## Visualization

Data Visualization refers to the graphical representation of information and data in the form of a graph, or chart, or bar, or any other format. The purpose of Data Visualization is to convey information and results quickly and easily.
Expand Down
2 changes: 2 additions & 0 deletions config/config.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This is the URL that the R package will use to connect to the Pecan service.
host_url <- "http://pecan.localhost/"
3 changes: 2 additions & 1 deletion inst/ed2-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
library(purrr)
library(httr)
library(glue)
source("config/config.R")

# Modify for your target machine and authentication
server <- connect("http://141.142.217.168/", "ashiklom", "admin")
server <- connect(host_url, "ashiklom", "admin")

# List all available models
models <- GET(
Expand Down Expand Up @@ -43,8 +44,8 @@
# Only test models that are available on the target machine
inner_join(models, c("model_name", "revision")) %>%
mutate(
start_date = if_else(is.na(start_date), default_start_date, as.character(start_date)),

Check warning on line 47 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=47,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 90 characters.
end_date = if_else(is.na(end_date), default_end_date, as.character(end_date)),

Check warning on line 48 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=48,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 82 characters.
# TODO: Add more inputs here
inputs = pmap(., configure_inputs),
pfts = strsplit(as.character(pfts), "|", fixed = TRUE),
Expand All @@ -59,7 +60,7 @@
)

test_runs <- test_list %>%
select_if(colnames(.) %in% names(formals(submit.workflow))) %>%

Check warning on line 63 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=63,col=3,[indentation_linter] Indentation should be 2 spaces but is 3 spaces.
mutate(submit = pmap(., submit.workflow, server = server))

#Interactively check the status of runs
Expand All @@ -81,25 +82,25 @@
print(n = Inf)
}

stages$success_status <-ifelse(grepl("DONE", stages$stage), TRUE, FALSE)

Check warning on line 85 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=85,col=23,[infix_spaces_linter] Put spaces around all infix operators.
models_name <- search.models(server)
sites_name <- search.sites(server)
stages$model_name <- models_name$models$model_name[match(stages$model_id, models_name$models$model_id)]

Check warning on line 88 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=88,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 103 characters.
stages$site_name <- sites_name$sites$sitename[match(stages$site_id, sites_name$sites$id)]

Check warning on line 89 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=89,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 89 characters.
stages$met <- test_list$met[match(stages$inputs, test_list$inputs)]

# Get Failed Workflows Logs

wf_log <- as.data.frame(stages)
path <- "inst/error-logs/ED2/"
unlink(paste0(path,'*'))

Check warning on line 96 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=96,col=20,[commas_linter] Commas should always have a space after.

Check warning on line 96 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=96,col=20,[quotes_linter] Only use double-quotes.

#failed_workflows <- wf_log[!(wf_log$success_status=="TRUE"),]

Check warning on line 98 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=98,col=2,[commented_code_linter] Commented code should be removed.

wf_id <- wf_log$workflow_id

for (i in wf_id) {
download.workflow.file(server, workflow_id=i,

Check warning on line 103 in inst/ed2-test.R

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 (release)

file=inst/ed2-test.R,line=103,col=45,[infix_spaces_linter] Put spaces around all infix operators.
filename="workflow.Rout", save_as=paste0(path,i,".Rout"))
}

Expand Down
3 changes: 2 additions & 1 deletion inst/maespa-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ library(tibble)
library(purrr)
library(httr)
library(glue)
source("config/config.R")

# Modify for your target machine and authentication
server <- connect("http://141.142.217.168/", "ashiklom", "admin")
server <- connect(host_url, "ashiklom", "admin")

# List all available models
models <- GET(
Expand Down
3 changes: 2 additions & 1 deletion inst/run-test-list.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ library(tibble)
library(purrr)
library(httr)
library(glue)
source("config/config.R")

# Modify for your target machine and authentication
server <- connect("http://141.142.217.168/", "ashiklom", "admin")
server <- connect(host_url, "ashiklom", "admin")

# List all available models
models <- GET(
Expand Down
3 changes: 2 additions & 1 deletion inst/sipnet-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ library(tibble)
library(purrr)
library(httr)
library(glue)
source("config/config.R")

# Modify for your target machine and authentication
server <- connect("http://141.142.217.168/", "ashiklom", "admin")
server <- connect(host_url, "ashiklom", "admin")

# List all available models
models <- GET(
Expand Down
Loading