Simplifying the deployment of Shiny applications to the cloud
This is the home of the tool, shiny-forge. Its long-term goals are to simplify the process of running, managing, and deploying Shiny applications.shiny-forge is a command-line tool designed to streamline the deployment of R Shiny applications to Google Cloud Platform (GCP) and Posit Connect. With integrated support for Docker, Google Cloud Platform (GCP), and Posit Connect, this tool enables users to build, deploy, and manage Shiny applications to the cloud with ease!
Requires: docker gcloud
Before getting started, please ensure you have the following dependencies installed:
- Docker: To build portability and reproducibility Shiny applications.
- Google Cloud SDK: To deploy applications directly to GCP for scalable, cloud-based hosting.
- Python3: To run
shiny-forgeon your local machine.
Once you have installed the dependencies above, please run the following commands to setup and install shiny-forge:
# Clone Repository from Github
git clone https://github.com/OpenOmics/shiny-forge.git
# Change your working directory
cd shiny-forge/
# Create a python virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install the required python packages
pip install -U pip
pip install -r requirements.txt
# Add shiny-forge to your $PATH
export PATH="${PATH}:${PWD}"
# Get usage information
shiny-forge -h# Create a new GCP deployment
shiny-forge create my-app ./path/to/Dockerfile ./path/to/artifacts.txt
# Update an existing GCP deployment
shiny-forge update my-app ./path/to/Dockerfile ./path/to/artifacts.txt
# List all deployed applications
shiny-forge read
# Get details about a specific application
shiny-forge read my-app
# Delete an application
shiny-forge delete my-app
# View application logs
shiny-forge logs my-appThe posit subcommand allows you to deploy Shiny applications to Posit Connect servers. You can provide credentials and configuration either via command-line arguments or a JSON configuration file.
shiny-forge posit \
--username your-username \
--api-key your-api-key \
--server https://connect.example.com \
--app-dir ./path/to/shiny-app \
--app-name my-shiny-app \
--title "My Shiny Application"Create a configuration file (e.g., posit-config.json):
{
"username": "your-username",
"api_key": "your-api-key-here",
"server": "https://connect.example.com",
"app_dir": "/path/to/your/shiny-app",
"app_name": "my-shiny-app",
"title": "My Shiny Application"
}Then deploy using:
shiny-forge posit --config posit-config.jsonYou can use a config file for most settings and override specific values via command-line:
shiny-forge posit --config posit-config.json --app-dir ./different-app