Configure Storage Directories#

Configure the Assets Directory#

ASSET_STORAGE_DIR is the host path used to store uploaded files to. If not specified, an empty non persistent directory inside the container is used.

To configure, add the following to the Helm overrides file discussed in Configuration Options. In the following, <ASSET_DIR_ON_HOST> is a directory on host machine that will be used to save assets like video files uploaded to VSS.

vss:
  applicationSpecs:
    vss-deployment:
      containers:
        vss:
          env:
          - name: ASSET_STORAGE_DIR
            value: "/tmp/custom-asset-dir"
  extraPodVolumes:
  - name: custom-asset-dir
    hostPath:
      path: <ASSET_DIR_ON_HOST>
  extraPodVolumeMounts:
  - name: custom-asset-dir
    mountPath: /tmp/custom-asset-dir

Note

Make sure the directory ASSET_STORAGE_DIR is writable by non root users. You can try running: chmod 777 <ASSET_DIR_ON_HOST> to make it writable.

Configure the Input Video Streams Directory#

You might want to skip uploading files using Gradio and instead add them from a local path.

To do this, use EXAMPLE_STREAMS_DIR environment config, which allows you to specify a directory containing sample streams for Gradio UI to load.

For each video file, create a poster image file with name <video.mp4>.poster.jpg. Example command to generate a poster image:

ffmpeg -i <video.mp4> -vframes 1 <video.mp4>.poster.jpg

The EXAMPLE_STREAMS_DIR contents should look like this:

ls <SAMPLE_STREAMS_DIR_ON_HOST>/
video1.mp4 video1.mp4.poster.jpg video2.mp4 video2.mp4.poster.jpg image1.jpg image2.jpg

To configure, add the following to the Helm overrides file discussed in Configuration Options. In the following, <SAMPLE_STREAMS_DIR_ON_HOST> is a directory on the host machine that contains sample streams for Gradio UI to load.

vss:
  applicationSpecs:
    vss-deployment:
      containers:
        vss:
          env:
          - name: EXAMPLE_STREAMS_DIR
            value: "/tmp/custom-example-streams-dir"
  extraPodVolumes:
  - name: custom-example-streams-dir
    hostPath:
      path: <SAMPLE_STREAMS_DIR_ON_HOST>
  extraPodVolumeMounts:
  - name: custom-example-streams-dir
    mountPath: /tmp/custom-example-streams-dir