Skip to content

Development version of the recreation potential model

License

Notifications You must be signed in to change notification settings

BioDT/uc-ces-recreation2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioDT Recreation Potential model

For developers

Before you commit changes

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.

Posit Connect

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).

Containerised Recreation Potential model

This experimental branch serves as a proof of principle for containerising the RP model for running on the LUMI computing cluster.

Running locally

  1. Install Singularity - see docs

  2. 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
  1. 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!

  1. Build the container
sudo singularity build app.sif app.def
  1. 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.

Running on LUMI

This assumes you have already set up your account on LUMI.

  1. Follow steps 1-4 above to build the container image locally.

  2. 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.

  1. Request a graphical interactive environment on LUMI, following instructions here

  2. Open the 'Terminal Emulator' and cd to containers/rp_app

  3. 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.

About

Development version of the recreation potential model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages