Skip to content
/ Rulia Public

Create a docker image with R, Julia, and shiny-server

License

Notifications You must be signed in to change notification settings

jjlynch2/Rulia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rulia

Skeleton projects for deploying R/Shiny apps that call Julia code via Docker. Two approaches are provided:

Approaches

sysimage/ — JuliaCall + Sysimage

Uses the JuliaCall R package with a precompiled sysimage for faster startup. Julia is installed in the Docker image at runtime.

  • Pro: Simple R integration via julia_call()
  • Con: Requires Julia installation in the Docker image (~1.5GB overhead)
cd sysimage
docker build -t myapp-sysimage .
docker run -d -p 4444:3838 myapp-sysimage

sharedlib/ — Compiled Shared Library

Compiles Julia code into a shared library (libmyjulia.so) via PackageCompiler.create_library. R calls Julia functions directly via .C() — no JuliaCall, no Julia installation in the runtime image.

  • Pro: Smaller image, no runtime Julia dependency, faster cold start
  • Con: Requires C shim for ABI bridging, more build setup
cd sharedlib
docker build -t myapp-sharedlib .
docker run -d -p 4444:3838 myapp-sharedlib

Access

http://localhost:4444/MyApp/

How It Works

Both approaches call the same Julia function (mymean) from R/Shiny:

Sysimage Shared Library
R calls Julia via julia_call("myjulia.mymean", data) .C("c_mymean", data, n, result)
Julia compiled as Sysimage (.so loaded by JuliaCall) Shared library (.so loaded by dyn.load)
Docker stages 1 (Julia installed in image) 2 (builder compiles, runtime is lean)
Needs JuliaCall Yes No
Needs Julia in runtime Yes No

About

Create a docker image with R, Julia, and shiny-server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors