How to build/run container with writable file system using Singularity 3?












0















I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.



singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787


The container process starts but when I try to connect via a browser I get the following error log.



01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689


Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?



Update:



I was able to get the RStudio Server running on the university cluster as follows.



singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787


This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory in the above.



However I still cannot install R packages into the container as the file system is not writable.



> install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) cancel
Error in install.packages : unable to install packages


Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.










share|improve this question





























    0















    I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.



    singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
    singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787


    The container process starts but when I try to connect via a browser I get the following error log.



    01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
    01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689


    Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?



    Update:



    I was able to get the RStudio Server running on the university cluster as follows.



    singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787


    This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory in the above.



    However I still cannot install R packages into the container as the file system is not writable.



    > install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
    Installing packages into ‘/usr/local/lib/R/site-library’
    (as ‘lib’ is unspecified)
    Warning in install.packages :
    'lib = "/usr/local/lib/R/site-library"' is not writable
    Would you like to use a personal library instead? (yes/No/cancel) cancel
    Error in install.packages : unable to install packages


    Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.










    share|improve this question



























      0












      0








      0








      I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.



      singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
      singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787


      The container process starts but when I try to connect via a browser I get the following error log.



      01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
      01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689


      Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?



      Update:



      I was able to get the RStudio Server running on the university cluster as follows.



      singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787


      This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory in the above.



      However I still cannot install R packages into the container as the file system is not writable.



      > install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
      Installing packages into ‘/usr/local/lib/R/site-library’
      (as ‘lib’ is unspecified)
      Warning in install.packages :
      'lib = "/usr/local/lib/R/site-library"' is not writable
      Would you like to use a personal library instead? (yes/No/cancel) cancel
      Error in install.packages : unable to install packages


      Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.










      share|improve this question
















      I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.



      singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
      singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787


      The container process starts but when I try to connect via a browser I get the following error log.



      01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
      01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689


      Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?



      Update:



      I was able to get the RStudio Server running on the university cluster as follows.



      singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787


      This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory in the above.



      However I still cannot install R packages into the container as the file system is not writable.



      > install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
      Installing packages into ‘/usr/local/lib/R/site-library’
      (as ‘lib’ is unspecified)
      Warning in install.packages :
      'lib = "/usr/local/lib/R/site-library"' is not writable
      Would you like to use a personal library instead? (yes/No/cancel) cancel
      Error in install.packages : unable to install packages


      Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.







      docker rstudio-server singularity-container






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 6:10







      davidrpugh

















      asked Jan 1 at 13:00









      davidrpughdavidrpugh

      1,71611633




      1,71611633
























          1 Answer
          1






          active

          oldest

          votes


















          0














          try --writable flag in your container:



          singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2

          singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787





          share|improve this answer
























          • The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

            – davidrpugh
            Jan 2 at 5:36











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995644%2fhow-to-build-run-container-with-writable-file-system-using-singularity-3%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          try --writable flag in your container:



          singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2

          singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787





          share|improve this answer
























          • The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

            – davidrpugh
            Jan 2 at 5:36
















          0














          try --writable flag in your container:



          singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2

          singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787





          share|improve this answer
























          • The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

            – davidrpugh
            Jan 2 at 5:36














          0












          0








          0







          try --writable flag in your container:



          singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2

          singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787





          share|improve this answer













          try --writable flag in your container:



          singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2

          singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 1 at 17:31









          al3x609al3x609

          8710




          8710













          • The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

            – davidrpugh
            Jan 2 at 5:36



















          • The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

            – davidrpugh
            Jan 2 at 5:36

















          The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

          – davidrpugh
          Jan 2 at 5:36





          The --writable flag was deprecated in Singularity 3.0 and requires sudo rights (which I don't have on university cluster) for Singularity 2.5.

          – davidrpugh
          Jan 2 at 5:36




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995644%2fhow-to-build-run-container-with-writable-file-system-using-singularity-3%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory