Connecting your Shiny application to a persistent storage volume

Use deployed Shiny applications to read and write files to persistent storage volumes.

To connect your Shiny application to a storage volume, follow these steps:

  1. Create a new storage volume connection.

    1. In your Cloud Pak for Data deployment space, click Add to space and then choose Connection.
    2. Search for storage volume and select Storage volume. Give your storage volume connection a name.
  2. If you don't have an available storage volume, click New volume.

  3. Give your new storage volume a name.

    1. If you have an existing persistent volume claim (PVC) or external connection that you would like to connect, select that. Otherwise, select New PVC. Complete the fields as required.
    2. If you do not have a storage space that is associated with your project, ask your Cloud Pak for Data admin to create one.
  4. Check Cloud Pak for Data authentication.

  5. Click Create.

  6. If your Shiny app was already running when you were creating the volume connection, deploy your Shiny app again.

  7. If your Shiny app was not running when you were creating the volume connection, save your Shiny app to the same deployment space (see previous instructions). Click Deploy.

  8. Optional: By default, auto-mounting is enabled. A few settings are available for tuning with API only. See the following API POST to: Disable auto-mount:

    {
        "r_shiny": {
          "authentication": "anyone_with_url",
          "parameters": {
            "auto_mount": false
          }
        }
    }
    

    Set individual mounts for more security in access. Only volumes that match mount paths will be mounted:

    {
        "r_shiny": {
          "authentication": "anyone_with_url",
          "parameters": {
            "mounts": [ "/mnts/same_dir" ]
          }
        }
    }
    

    Provide the parameter serving name:

    {
        "r_shiny": {
          "authentication": "anyone_with_url",
          "parameters": {
            "serving_name": "myapp"
          }
        }
    }
    

For more information, refer to the Watson Machine Learning API documentation.

Parent topic: Deploying Shiny apps from a deployment space