Git Product home page Git Product logo

immunespaceapi's Introduction

ImmuneSpaceAPI

R-CMD-check docker Codecov test coverage Lifecycle: stable

This package holds all API endpoints for use within ImmuneSpace internally by reports or front-end elements. The inst/api/main.R script defines all the endpoints used by plumber::plumb() that is started when a docker container is created from an image defined by the inst/Dockerfile. The endpoint functions are simple wrappers for private functions in the /R directory. Since these higher level private functions depend on file inputs often, the unit tests are focused on the analysis and data munging functionality.

Local Development

To do local development, the file-loading function loadLocalFile() that pulls in .rds artifacts for munging is found in utils.R. It looks for a localPath environmental variable specifying the local path to use. If this is not found, then it assumes the location is the server and will use the /app directory specified during the docker run command. So, it is recommended to put localPath in your .Renviron file.

mkdir /share/resources
scp rsT:'/share/resources/*.rds' /share/resources

cd /labkey/git
git clone https://github.com/RGLab/ImmuneSpaceAPI.git
cd ImmuneSpaceAPI
git checkout dev
docker build -t immunespaceapi .
docker run -p 1169:8000 -v /share/resources:/app immunespaceapi

Server Deployment

After changes are made locally, push changes to the respective branch on GitHub. GitHub Actions will build and push the image to Docker Hub and GitHub Packages.

Pull the latest image on the wsT/wsP machine and start a new container with a command that includes an "always" restart policy:

# on wsT
ssh wsT
s
docker pull rglab/immunespaceapi:dev
docker run -d --restart always -p 1169:8000 -v /share/resources:/app rglab/immunespaceapi:dev

# on wsP
ssh wsP
s
docker pull rglab/immunespaceapi:latest
docker run -d --restart always -p 1169:8000 -v /share/resources:/app rglab/immunespaceapi:latest

Proxy Note

Extending

  • Add endpoint in the inst/api/main.R
  • Add functions in /R with the format <ModuleName>_<endpointName>.R

Resources

immunespaceapi's People

Contributors

ehfhcrc avatar juyeongkim avatar

Watchers

James Cloos avatar Greg Finak avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.