天道酬勤,学无止境

opencpu

Rmpi, OpenCPU, and Apparmor: DENIED request for "/"

I have an R package that sends out a job to the OpenMPI cluster I have running by means of the Rmpi package. All works as expected within an R session run from the console. However, when I try to execute the relevant function with from my OpenCPU server like this (details changed to protect the innocent): curl -XPOST http://99.999.999.99/ocpu/library/MyPackage/R/my_cluster_function I get this error: R call failed: process died. (Other, non-cluster calling functions within the package work as expected via OpenCPU). I noticed in /var/log/kern.log a variety of requests being DENIED by apparmor

2021-10-19 03:55:57    分类:问答    r   mpi   openmpi   opencpu   apparmor

OpenCPU 管理员 opencpu.demo(OpenCPU admin opencpu.demo)

问题 我在运行时收到错误 我的 OpenCPU 服务器上的管理应用程序错误消息:未找到 The requested URL /Radmin/call/opencpu.demo/install.opencpu/json was not found on this server. 我有opencpu repo的R文件夹和安装的包但我不知道install.opencpu函数文件在哪里 回答1 我不确定您在哪里找到/Radmin/ url,但该功能从未进入 opencpu。 尽量坚持使用手册页中的内容:www.opencpu.org。

2021-09-30 14:17:26    分类:技术分享    r   opencpu

OpenCPU admin opencpu.demo

I am recieveing an error when I run the admin app on my OpenCPU Server Error Message : Not Found The requested URL /Radmin/call/opencpu.demo/install.opencpu/json was not found on this server. I have the R folder of the opencpu repo and the package installed yet I dont know where the install.opencpu function file is

2021-09-30 12:10:08    分类:问答    r   opencpu

Test R app via openCPU localy

I wrote an R package and now I want to provide let's say a small demo fronted as a webapplication. For this I already wrote a index.html file which I saved to the <pkgRoot>/inst/www/ folder. I also installed the opencpu package which works fine wehen I use it via the localhost:<portNum>/ocpu/test/ "Interface", where I already can see my Package and use the Ajax POST and GET requests in order to see the package is doing what it's ment to do. But now im stuck in a sense that I do not know how to test my own app (index.html) localy. localhost:<portNum>/ocpu/<pkgName>/www/index.html does not work

2021-09-29 02:16:58    分类:问答    r   opencpu

是否有一种机制可以将请求中的数据持久化/记录到 OpenCPU 服务器?(Is there a mechanism to persist/record data from requests to an OpenCPU server?)

问题 首先,我明白有很多很好的理由不这样做,但出于兴趣,我的问题是:是否有推荐(或容忍)的方法将信息从 http 请求持久化到运行服务器的 R 会话? 例如,外部系统中的触发器在更新时触发 http 请求,其中包含基本信息(更新时间)。 在 R 中使(现在更新的)时间变量可用的最佳方法是什么? 作为下面的示例,我尝试使用..\identity API 编写一个简单的 .csv 文件。 我得到的结果似乎不是失败,但文件没有创建(我同意这是一件好事,默认情况下),但我想了解是否可以更新另一个状态服务器的一侧(即除了 \tmp 对象存储之外的任何地方),即使(例如)必须使用和安装自定义包? 抱歉,如果它记录在某处,但是当我单击管理指南 https://raw.github.com/jeroenooms/opencpu/opencpu-0.7/manual/document.pdf 的链接时,我得到了 404 谢谢。 require(opencpu) #Loading required package: opencpu #Initiating OpenCPU server... #OpenCPU started. #[httpuv] http://localhost:8810/ocpu #OpenCPU single-user server ready. require(RCurl) #

2021-09-24 06:31:50    分类:技术分享    r   opencpu

Is there a mechanism to persist/record data from requests to an OpenCPU server?

Firstly, I appreciate there are many good reasons NOT to do this, but for interest, my question is: is there a recommended (or tolerated) method to persist information from an http request to the R session which is running the server? As an example, a trigger in an external system fires an http request on update, which contains basic information (time of update). What is the best way to make that (now-updated) time variable available in R? As an example below, I tried using the ..\identity API to write a simple .csv file. I got a result which didn't appear to be a failure, but the file wasn't

2021-09-23 18:35:37    分类:问答    r   opencpu

如何在 CentOS6 上启动/停止/刷新 OpenCPU?(How to start/stop/flush OpenCPU on CentOS6?)

问题 我已经在 CentOS6 上成功构建并安装了 OpenCPU 和 RStudio 服务器。 一切都按预期工作,我确实获得了本地 R 包的成功 GET/POST 响应。 然而,有几件事似乎不起作用: 我想不出一种干净的方法来启动/停止/刷新 OpenCPU。 我目前正在使用apachectl restart但我什至不确定是否会按预期重新加载 R 包。 我在/usr/lib/opencpu/scripts尝试了 Jeroen 的 bash 脚本,但它们似乎需要相当多的调整才能在 CentOS 上工作。 (可能与上述有关)我在/etc/opencpu/Renviron文件中使用load()和readRDS() (也在/etc/opencpu/Rprofile尝试过)将持久性数据集加载到全局环境中——但这并没有似乎工作。 我没有收到任何错误日志,但这些对象在后续请求中不可用。 在 Ubuntu OpenCPU 上似乎配置为在opencpu用户下运行。 在 CentOS6 上,它似乎在安装后在root下运行。 我想修改它,但不知道如何修改。 只是想知道是否有人在 CentOS6 上成功配置了 OpenCPU。 非常感谢,--梅尔。 回答1 一些答案 运行sudo apachectl restart将重新启动。 目前,rpm 中没有包含用于 opencpu 的特殊 init 或

2021-09-15 08:44:16    分类:技术分享    r   centos6   opencpu

在 opencpu 会话中访问对象(Accessing objects in opencpu sessions)

问题 如何在后续函数调用中访问 opencpu“会话”中的特定对象? 给定一个请求,说 /ocpu/library/base/R/eval 带参数 expr = "x <- 10; y <- 20" 这使 /ocpu/tmp/x08dfddafe3/R/.val /ocpu/tmp/x08dfddafe3/R/x /ocpu/tmp/x08dfddafe3/R/y /ocpu/tmp/x08dfddafe3/stdout /ocpu/tmp/x08dfddafe3/source /ocpu/tmp/x08dfddafe3/console /ocpu/tmp/x08dfddafe3/info 现在.val的值为 20。 假设我想将x传递给 ocpu/library/stats/R/rnorm 有没有一种快速的方法,比如 n = x08dfddafe3/R/x 在“伪”... 回答1 很好的问题。 从1.4.4版开始,有两种方法可以做到这一点: 您可以使用x08dfddafe3::x来引用会话x08dfddafe3的命名空间中的对象x 。 您可以传递完整的 URL http://your.server.com/ocpu/tmp/x08dfddafe3/R/x/rds。 如果网络允许,这将自动抓取对象并将其反序列化。

2021-09-01 02:46:09    分类:技术分享    r   opencpu

How many requests can be processed simultaneously by R OpenCPU

I am new to OpenCPU, I look at the documents at https://www.opencpu.org/, It looks that OpenCPU can process http requests concurrently? I ask so because R itself only has single-thread mode, and how many requests can it process concurrently? Thanks.

2021-08-11 00:49:33    分类:问答    r   opencpu

如何在opencpu中链接两个函数调用(How to chain two function calls in opencpu)

问题 据说 OpenCPU 支持链接函数调用以计算例如 f(g(x), h(y)) 关于参数格式的文档:https://public.opencpu.org/api.html#api-arguments 包含一个示例,通过计算来说明这一点 summary(read.csv("mydata.csv")) 在这个例子中,f 是通用函数摘要,它将一个对象作为参数。 我需要计算类似的东西: mycalc(read.csv("mydata.csv")) 或者 myplot(read.csv("my data.csv")) 其中 f 将数据帧作为参数。 当将 read.csv 函数返回的 sessionid 或哈希键作为对象参数提供时,这似乎不起作用。 如何解决这种两个非泛型函数的链接? 这是一个完整的例子: 准备包在 R 中测试 f(g(x)) 这里的 plotcars(dfcars()) dfcars<-function(){ data(cars); cars } plotcars<-function(df){ matplot(1:nrow(df),df) } plotcars(dfcars()) # test the two chained functions are working package.skeleton(list = c("dfcars", "plotcars")

2021-07-28 13:00:04    分类:技术分享    r   opencpu