Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from CityofEdmonton/update-icons
Browse files Browse the repository at this point in the history
Use an ARM64 compatible base image
  • Loading branch information
reisner authored Sep 28, 2022
2 parents fc74e41 + 5f1045c commit 7844f92
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# syntax = docker/dockerfile:1.0-experimental # https://docs.docker.com/develop/develop-images/build_enhancements/
FROM rocker/r-ver:4.0.5
FROM rocker/r-ver:4.2.1

RUN export DEBIAN_FRONTEND=noninteractive && apt-get -y update \
&& apt-get install -y \
libgdal-dev \
libudunits2-dev \
libxt6 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*

# get from https://packagemanager.rstudio.com/client/#/repos/1/overview
# Freezing packages to April 22, 2021:
RUN echo "options(repos = c(REPO_NAME = 'https://packagemanager.rstudio.com/all/__linux__/focal/2511902'))" >> $R_HOME/etc/Rprofile.site
# Freezing packages:
RUN echo "options(repos = c(REPO_NAME = 'https://mran.microsoft.com/snapshot/2022-04-22'))" >> $R_HOME/etc/Rprofile.site

RUN R -e "install.packages(c('assertthat', \
RUN R -e "options(warn = 2); install.packages(c('assertthat', \
'data.table', \
'dplyr', \
'DT', \
Expand All @@ -29,7 +29,6 @@ RUN R -e "install.packages(c('assertthat', \
'plotly', \
'promises', \
'rmarkdown', \
'rgdal', \
'shiny', \
'shinycssloaders', \
'shinydashboard', \
Expand All @@ -38,7 +37,8 @@ RUN R -e "install.packages(c('assertthat', \
'sf', \
'stringr', \
'timetk', \
'htmltools'))"
'htmltools', \
'xml2'))"

# Add certs for accessing elastic search servers that require them
COPY elasticsearch/certificates/*.crt /usr/local/share/ca-certificates/
Expand Down
14 changes: 9 additions & 5 deletions dashboard_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ get_aliases <- function(session = NULL) {
}

if (length(aliases) == 0) {
stop("User does not have permission to access any aliases")
stop("User does not have permission to access any aliases, or no aliases specified in .configs!")
}
return(aliases)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ index_to_alias_mapping <- function(es, alias_names) {
tidyr::unnest_wider(value) %>%
filter(str_detect(index_name, "coe_td_"))

if ("aliases" %in% names(mapping_df)) {
if (!all(is.na(mapping_df$aliases))) {
mapping_df = mapping_df %>%
tidyr::unnest_longer(aliases, indices_to = "alias_name") %>%
select(-aliases) %>%
Expand All @@ -125,7 +125,7 @@ query_count <- function(conn, index) {
search_body <- function(query,
search_fields,
min_score = 0,
min_date = "2000-01-01",
min_date = "1900-01-01",
max_date = Sys.Date(),
min_sentiment = -1,
max_sentiment = 1,
Expand Down Expand Up @@ -345,10 +345,14 @@ query_text_depot <- function(query_info = NULL,
results
}

get_embedding_vector <- function(query, api_url, api_user, api_password) {
get_embedding_vector <- function(query,
api_url,
api_user,
api_password,
api_version = "v1") {
query = URLencode(query)
res = api_url %>%
paste0("/embeddings_api/v1/embed_query?query=", query) %>%
paste0("/embeddings_api/", api_version, "/embed_query?query=", query) %>%
httr::GET(authenticate(api_user, api_password)) %>%
httr::content()
unlist(res$embedding_vector)
Expand Down
1 change: 0 additions & 1 deletion global.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ library(leaflet)
library(lubridate, warn.conflicts = FALSE)
library(plotly, warn.conflicts = FALSE)
library(promises)
library(rgdal, warn.conflicts = FALSE)
library(shiny)
library(shinydashboard, warn.conflicts = FALSE)
library(shinyjs, warn.conflicts = FALSE)
Expand Down
4 changes: 2 additions & 2 deletions search_bar_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ searchBarUI <- function(id){

circle = FALSE,
status = "primary",
icon = icon("gear"),
icon = icon("cog"),
width = "600px",
tooltip = shinyWidgets::tooltipOptions(title = "Advanced Options")
),
Expand Down Expand Up @@ -75,7 +75,7 @@ searchBar <- function(input, output, session,
value = query_param,
placeholder = "Type Search Here",
btnSearch = icon("search"),
btnReset = icon("remove"),
btnReset = icon("times"),
width = "100%")
})

Expand Down
2 changes: 1 addition & 1 deletion search_results_table_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ searchResultsTableUI <- function(id, include_table_options = FALSE){
label = "table options",
circle = FALSE,
status = "primary",
icon = icon("gear"),
icon = icon("cog"),
size = "xs",
inputId = ns("table_options"))
}
Expand Down
2 changes: 1 addition & 1 deletion sentiment_neighbourhoods_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mapPlot <- function(input, output, session,
options = list(placeholder = 'Type here')),
circle = FALSE,
status = "primary",
icon = icon("gear"),
icon = icon("cog"),
width = "300px",
tooltip = shinyWidgets::tooltipOptions(title = "Map Options")
)
Expand Down
5 changes: 3 additions & 2 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ function(input, output, session) {
style = "text-align: left"
),
br(), br(),
tableOutput("index_stats") %>% shinycssloaders::withSpinner(proxy.height = "50px"),
column(12, align = "center",
tableOutput("index_stats") %>% shinycssloaders::withSpinner(proxy.height = "50px")),
br(), br(),
"Have another data set to suggest? Email ", a(get_configs()$contact_email, href = paste0("mailto:", get_configs()$contact_email))
),
width = 1000,
width = 1200,
html = TRUE
)

Expand Down

0 comments on commit 7844f92

Please sign in to comment.