none
Snapshots and packages RRS feed

  • Question

  • Hi,

    I'm setting up some snapshots for my R Server environment, and I'm trying to understand whether snapshots are supposed to include any additional R packages I may have installed prior to creating the snapshot.  From my experiments, it appears they are not included.  Here's a quick summary of what I have seen:

    •    I created a remote session via remoteLogin(), go to a REMOTE> prompt and install an additional package ("randomForest"), and then successfully call createSnapshot() locally to create a snapshot.
    •    Subsequently, I created a new remoteLogin(), go to a REMOTE> prompt, and call loadSnapshot().  I see that variables that were defined in my workspace are then available, but the randomForest package is not installed.

    The documentation seems slightly contradictory on this point:

    • I found a page on MSDN (https://msdn.microsoft.com/en-us/microsoft-r/operationalize/remote-execution) that says: "a snapshot is an image of a remote R session saved to Microsoft R Server, which includes: * The session's workspace along with the installed R packages, * Any files and artifacts in the working directory."  (emphasis added)
    • In addition, another page on MSDN (https://msdn.microsoft.com/en-us/microsoft-r/operationalize/package-management#mrsdeploy) says, "...packages remain installed for the lifecycle of the R session. You can prolong this lifecycle by saving the session workspace and working directory into a snapshot and then recalling the snapshot using its ID later whenever you want access to the workspace, the installed R packages, and the files in the working directory as they were at the time the snapshot was created." (emphasis added)
    • However, the R documentation for createSnapshot() (viewed via ?createSnapshot at an R prompt) simply says, "the workpace and the files in the working directory are saved."  Packages are not mentioned.

    Can someone help confirm whether snapshots are supposed to include additional packages I may have installed, and if so, what I am doing wrong?

    I do see that the second link above discusses alternative approaches to configuring R Server so that additional packages are available.  I can follow those steps, but I would also like to understand how snapshots are supposed to work.

    Thanks in advance,

    Andrew Brown

    Wednesday, February 8, 2017 6:39 AM

All replies

  • Hi Andrew,

    I've just seen your post, and not sure if this is still an issue for you given is was posted back in February.  This works for me. I think you need to be in your local session to loadSnapshot.

    mrsdeployUrl <- "< your mrsdeploy server url here"

     

    remoteLogin(mrsdeployUrl, session=TRUE, diff=TRUE, commandline=TRUE)

     

    installed.packages()[1:10,1]

    install.packages("abind")

    library("abind")

    installed.packages()[1:10,1]

    x <- matrix(1:12,3,4)

    y <- x+100

    dim(abind(x,y,along=0)) 

    pause()

     

     

    tstchk <- createSnapshot("tstchk")

    listSnapshots()

     

    resume()

    exit

    remoteLogin(mrsdeployUrl, session=TRUE, diff=TRUE, commandline=TRUE)

     

    # note: no abind package

    installed.packages()[1:10,2:3]

    library(abind)

    pause()

     

    # now load the snapshot

    loadSnapshot(tstchk)

     

    resume()

    # check installed packages.  abind is now there.

    installed.packages()[1:10,2:3]

    library(abind)

    exit

    Monday, July 10, 2017 4:17 PM