Please run the format.R
script from within RStudio or from the terminal using
Rscript format.R
Hopefully this should format your code without crashing.
Note that the formatR
tool does not work for in-line comments that occur within an expression (see here for an explanation.
Probably the easiest way to publish to Posit Connect is to install the R package rsconnect
and run the following commands from the root of the repository:
rsconnect::addServer("https://connect-apps.ceh.ac.uk", name="connect-apps.ceh.ac.uk")
rsconnect::connectApiUser(server="connect-apps.ceh.ac.uk", account="<username>", apiKey="<api key>")
rsconnect::deployApp(appDir=".")
This will take a long time since it needs to upload a couple of gigabytes of data. If you do not have access to this data, please contact Joe MR.
You can repeat these steps if you make any changes.
See the documentation for further guidance (requires account with UKCEH Posit Connect).
This experimental branch serves as a proof of principle for containerising the RP model for running on the LUMI computing cluster.
-
Install Singularity - see docs
-
Get a local copy of the source code
# Clone this repository
git clone https://github.com/BioDT/uc-ces-recreation2
# Change directory to the repository root
cd uc-ces-recreation2
# Checkout the lumi-container branch
git checkout lumi-container
- Get hold of the input data.
Important
Unless you have access to the DataLab, unfortunately this means asking one of the developers to send it to you (for now). Please open an issue if this affects you!
- Build the container
sudo singularity build app.sif app.def
- Run the container
singularity run --bind ./Data:/srv/shiny-server/myapp/Data app.sif
Note: you may need to manually open the http URL in your browser.
This assumes you have already set up your account on LUMI.
-
Follow steps 1-4 above to build the container image locally.
-
Copy the container image and input data to LUMI
scp -r Data <user>@lumi.csc.fi:/users/<user>/containers/rp_app
scp app.sif <user>@lumi.csc.fi:/users/<user>/containers/rp_app
In the above, <user>
is your LUMI username and containers/rp_app
is just a suggestion for a location in which to run the container.
Note
This will take a long time; both the container image and the data directory are ~1GB.
-
Request a graphical interactive environment on LUMI, following instructions here
-
Open the 'Terminal Emulator' and
cd
tocontainers/rp_app
-
Run the container
singularity run --bind ./Data:/srv/shiny-server/myapp/Data app.sif
Warning
This will crash while 'defining the area of interest' if you have not requested enough memory for your interactive session.