Closed khintz closed 2 years ago
Hi @khintz
I think the partial
function comes with purrr
which is a dependency of dplyr
- I think. On my PC (CentOS8, R==4.0) I can see both installed in /home/ewhelan/R/x86_64-redhat-linux-gnu-library/4.0
. Can you explore your ubuntu installation in the same way?
Eoin
I just added require("purrr")
to sqlite/sqlite_wrappers.R
and then I could produce a plot. So for some reason, obsmon have not loaded the required packages.
I have both dplyr
and purrr
installed under /usr/local/lib/R/site-library/
(which is also what I expected, as I am only using the install
script in obsmon)
Great! Progress. Don't know enough about R or Obsmon to point the finger of blame here.
The packages are also in .installer_local_R-libs/R-libs/dplyr/
(see .Rprofile).
For now, I add the require('purrr')
, but waiting to hear if @paulovcmedeiros has any suggestions for a real fix.
Hi!
Before I start looking into this: Have you changed anything else in the code? The start banner shows a lot of unknown
s, which indicates that you are not carrying over the .git
directory when copying the code to its final destination. This is in principle not a problem but then it gets a bit difficult for me to know if there are modified or missing files.
Another strange thing is that in your log I don't see the line saying Looking for R-libs in the following directories (listed in order of priority):
and the subsequent list of directories. Can you double-check this?
Hi again,
Can you try reinstalling obsmon using the version in the devel
branch? I've made some changes to the install script. Btw, take a look at the new "Advanced install options" section of the PDF doc file. It should now be easier to install selected versions of R-packages, or install the latest versions of all packages from CRAN.
Let me know how it goes. I won't merge this into master
until the install works correctly.
Hi @paulovcmedeiros,
The only things I changed was changing version of many packages, as reported in the first comment in this issue, and I had to add require("purrr")
in src/sqlite/sqlite_wrappers.R
The repo is cloned so everything is brought over, also .git and .Rcache.
Now I tried using your devel branch, and it worked out-of-the-box... No changes to the code at all from my side.
I have tried loading data from an experiment and it works as expected (after creating a config.toml
file)
For reference, I put my ansible pipeline related to obsmon below, so you can see all the steps I did on an Ubuntu 22.04 VM.
---
- name: Write ansible log
shell: date "+{{ ansible_log_date_format }} - DMI helper scripts" >> "{{ ansible_log_file }}"
changed_when: False
#####################
# Include vars
#####################
- name: Include role environment variables
include_vars:
dir: "vars"
extensions:
- "yml"
#####################
# Install and configure required packages
#####################
- name: Update apt cache and install dependencies
apt:
name:
- build-essential
- git
- dirmngr
- gnupg
- apt-transport-https
- ca-certificates
- software-properties-common
- gdebi-core
- libopenblas-base
- libudunits2-dev
- libcairo2-dev
- libxt-dev
- libgdal-dev
- libgeos-dev
- libv8-dev
- libgeos++-dev
- libproj-dev
- sqlite3
- libsqlite3-dev
- libharfbuzz-dev
- libfribidi-dev
state: latest
update_cache: yes
- name: Install CRAN devtools dependencies
apt:
name:
- libxml2-dev
- libssl-dev
- libcurl4-openssl-dev
state: latest
update_cache: yes
- name: Add key for CRAN-R repository
apt_key:
url: https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc
state: present
- name: Add CRAN-R repository
apt_repository:
repo: "deb https://cloud.r-project.org/bin/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }}-cran40/"
state: present
update_cache: yes
- name: Install r-base
apt:
name:
- r-base #=4.2.1-1.2204.0
state: present
update_cache: yes
- name: Install the necessary CRAN devtools package
shell: R -e "install.packages('devtools', repos='http://cran.rstudio.com/')"
args:
warn: yes
- name: Install shiny
shell: R -e "require(devtools); install_version('shiny', version = '1.7.1', repos = 'http://cran.us.r-project.org')"
args:
warn: yes
- name: Get and install shiny-server
shell: |
wget https://download3.rstudio.org/ubuntu-18.04/x86_64/shiny-server-1.5.18.987-amd64.deb
gdebi --non-interactive shiny-server-1.5.18.987-amd64.deb
ufw allow 3838
args:
warn: yes
- name: Install rmarkdown
shell: R -e "require(devtools); install_version('rmarkdown', version = '2.14', repos = 'http://cran.us.r-project.org')"
args:
warn: yes
- name: Install tidyverse required by obsmon
shell: R -e "require(devtools); install_version('tidyverse', version = '1.3.1', repos = 'http://cran.us.r-project.org')"
args:
warn: yes
#####################
# Replace Nginx role default configuration
#####################
- name: Default webpage content
copy:
src: "var/www/default/{{ item }}"
dest: "/var/www/{{ hostname }}.{{ domain }}/"
owner: "root"
group: "root"
with_items:
- 'index.html'
- 'uwc.png'
- name: Redirect obsmon to shiny by overwriting default nginx configuration
copy:
src: "etc/nginx/sites-enabled/{{ hostname }}.{{ domain }}"
dest: "/etc/nginx/sites-enabled/{{ hostname }}.{{ domain }}"
owner: "root"
group: "root"
- name: Overwrite default shiny server sample apps location
copy:
src: "etc/shiny-server/shiny-server.conf"
dest: "/etc/shiny-server/shiny-server.conf"
owner: "root"
group: "root"
- name: Reload Nginx configuration for obsmon
service:
name: "nginx"
state: "reloaded"
- name: Reload shiny-server configuration for obsmon
service:
name: "shiny-server"
state: "reloaded"
- name: Create data directories for obsmon
shell: |
mkdir -p /obsmondata/dini/
mkdir -p /obsmondata/ig/
args:
warn: yes
#####################
# Fetch and install obsmon
#####################
- name: Git checkout obsmon
git:
repo: "https://github.com/Hirlam/obsmon.git"
dest: /srv/checkout
version: "devel"
- name: Make sure to start from a fresh obsmon installation
shell: cd /srv/checkout/ && ./install clean all
args:
warn: yes
- name: Install obsmon frontend
shell: cd /srv/checkout/ && ./install
args:
warn: yes
Hi @khintz ,
Great that the version on devel
works! I will merge it into master
and wrap up a new release soon then.
Thank you very much indeed for the ansible pipeline! This is very useful, I may even include it in a future release as a reference for those interested.
I have installed obsmon v. 4.3.2 (e27e705) on a fresh server running ubuntu 22.04 with ansible.
Obsmon is running and I have some sqlite files holding both ecma and ccma, eg. on the path
/obsmondata/dini/ecma/2022070512/ecma.db
I run obsmon through a shiny-server. From these log files I see the errorpreformQuery: could not find function "partial"
. Full log file is below.I guess that the error probably comes from src/sqlite/sqlite_wrappers.R but I don't know where the ´partial´ function is defined.
Any suggestions will be very much appreciated.
I had to update multiple packages for the obsmon installation to succeed:
These are the debian packages I installed before installing R-4.2.1, Shiny-server and Obsmon:
The config file looks as follows:
The shiny-server log file: