System Maintenance

The Legislative Insights VM should be updated periodically to ensure it has the latest application updates and operating system security fixes.

Application Updates

Legislative Insights versions are released as container images in Artifact Registry.

Update to the latest version

A shell script /home/insights/update-insights.sh is provided to download the latest versions of the code. An alias to it was created during the Post install setup steps of the Quick Start guide.

Ssh into the VM using the user that performed the setup steps and run update-insights to check for updates. Restart the application if new updates are found:

cd /home/insights
update-insights

# Restart the application if new container images are downloaded
docker-compose down
docker-compose up -d

Downgrading to an earlier version

The docker-compose.yaml can be used to restore an older version of the application if required. Shutdown the application, make a copy of the file and then edit the original:

cd /home/insights
docker-compose down

sudo cp docker-compose.yaml docker-compose.yaml.safe
sudo vi docker-compose.yaml

Find the Legislative Insights image reference us-docker.pkg.dev/dito-public/marketplace/legislative-insights:1.0. Note the 1.0 tag is used to identify the latest version of the application

services:
  redis:
    image: redis:latest
    container_name: redis
    networks:
      - insights-network

  insights:
    image: us-docker.pkg.dev/dito-public/marketplace/legislative-insights:1.0
    container_name: insights
    ports:
      - "80:8000"

Modify the tag to identify the desired version (See the release notes below for a list of version tags)

  insights:
    image: us-docker.pkg.dev/dito-public/marketplace/legislative-insights:1.0.15

Restart the application to apply the change:

cd /home/insights
docker-compose up -d

Note: Setting the insights image to a specified version will prevent future updates from being applied. Undo the change and restart the application to return to the latest version to test new versions as they are made available.

Troubleshooting Issues

no space left on device error while running update-insights. Example:

update-insights
latest: Pulling from docker/compose
Digest: sha256:b60a020c0f68047b353a4a747f27f5e5ddb17116b7b018762edfb6f7a6439a82
Status: Image is up to date for docker/compose:latest
docker.io/docker/compose:latest
latest: Pulling from library/redis
Digest: sha256:93a8d83b707d0d6a1b9186edecca2e37f83722ae0e398aee4eea0ff17c2fad0e
Status: Image is up to date for redis:latest
docker.io/library/redis:latest
1.0: Pulling from dito-public/marketplace/legislative-insights
cf799a8da63a: Already exists
ad669615d205: Already exists
287d35cca2f2: Already exists
ec3a42ecee71: Already exists
d7008ae36a96: Already exists
212e231444fe: Already exists
259b7b599e26: Pull complete
ccf2ba0d9086: Pull complete
9c4dd00bd1e9: Pull complete
d80c2707c585: Pull complete
c7767838e7ef: Pull complete
f16319d5b61b: Extracting [==================================================>]  816.8MB/816.8MB
failed to register layer: write /app/.playwright/firefox-1471/firefox/browser/omni.ja: no space left on device

Use docker system prune -a to recover space:

docker system prune -a
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache

Are you sure you want to continue? [y/N] y
Deleted Containers:
883da7a70db54de9289ec3e4cc623e55d28ecf7eadf5d0e54611979c33a4954b
aef878c389c893f0475d5326b965d67fa9a99be1eb7d48fa5161462f8c3635ee

...

Total reclaimed space: 13.95GB

dial unix /var/run/docker.sock: connect: permission denied while running docker commands. Example:

update-insights
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=docker%2Fcompose&tag=latest": dial unix /var/run/docker.sock: connect: permission denied

Add user to docker group and update permissions on /var/run/docker.sock

  sudo usermod -aG docker $USER
  sudo setfacl --modify user:$USER:rw /var/run/docker.sock

Operating System Updates

The Legislative Insights VM uses Google’s Container-Optimized OS (COS). It has built-in capability to automatically upgrade to a newer version when released. This capability, when enabled, allows user instances to stay up-to-date with respect to security fixes and bug fixes.

Enable auto-update

The auto-update feature is disabled by default. Open a Cloud Shell session in the Google Cloud Console to check the status of your VM:

# Run the following command to see if the feature is enabled
gcloud compute instances describe *VM Name* --zone=*VM Network Zone* --format="value(metadata.cos-update-strategy)"

# Example:
gcloud compute instances describe legislative-insights-20 --zone=us-central1-b --format="value(metadata.cos-update-strategy)"

Follow the instructions in the Container-Optimized OS documentation to enable auto-update if required:

# Example
gcloud compute instances add-metadata  legislative-insights-20  --metadata cos-update-strategy=update_enabled

Apply updates

With auto-updates enabled the VM will update to the latest version each time it is rebooted.

  1. ssh into the VM
  2. Read the /etc/os-release file to find the current OS version
  3. Identify the VERSION and BUILD_ID and compare to the COS Release Notes
  4. Reboot the VM if a later version is available
  5. Restart the application using docker-compose up -d (see description above)

Example:

cat /etc/os-release

NAME="Container-Optimized OS"
ID=cos
PRETTY_NAME="Container-Optimized OS from Google"
HOME_URL="https://cloud.google.com/container-optimized-os/docs"
BUG_REPORT_URL="https://cloud.google.com/container-optimized-os/docs/resources/support-policy#contact_us"
KERNEL_COMMIT_ID=e468c68a19c18e38b48ff36243a1bbdce8950a4c
GOOGLE_CRASH_ID=Lakitu
GOOGLE_METRICS_PRODUCT_ID=26
VERSION=117
VERSION_ID=117
BUILD_ID=18613.164.28

Shows VERSION=117 and BUILD_ID=18613.164.28. Compare these values to the COS 117 Release Notes

Release Notes

Date Release Tag Details
Feb 26, 2025 1.0.18 OpenStates API key registration fix
Feb 19, 2025 1.0.17 Support for saved sessions
Feb 14, 2025 1.0.16 Increases LLM context window size to 2 million tokens
Improves exception handling and reporting
Documentation updates
Security update for UI
Feb 7, 2025 1.0.15 Add support for Federal bills and regulations
Automatic summarization on bill selection
Form upload in bill URL fields
Add comparison checkboxes for Federal Search
Custom alert dialog in UI
Cut and paste button for session results
Jan 23, 2025 1.0.10 Add Google grounding to LLM analysis
Switch to Gemini 2.0
Aug 28, 2024 1.0.5 Initial release on Google Cloud Marketplace
Support for State bill search and comparison

Copyright © Dito LLC, 2022, 2025