---
agentTools:
  projectIndex: https://diffgram.readme.io/llms.txt
---

# Update Production

[block:api-header]
{
  "title": "Helm Production Updates"
}
[/block]

Make sure you have the latest helm chart version by doing

`git clone https://github.com/diffgram/diffgram-helm`

Then change the `diffgramVersion` on the `values.yaml` file to the new version released. And redeploy chart with updated values.

[block:api-header]
{
  "title": "Breaking Changes"
}
[/block]

[Breaking changes](https://diffgram.readme.io/docs/breaking-changes) tracking.

[block:api-header]
{
  "title": "DB Upgrades / Deadlock Prevention"
}
[/block]

We use [Alembic](https://alembic.sqlalchemy.org/en/latest/) to manage upgrades of the database schema. Some of these upgrade may include new indexes and constraints. We strongly suggest that you reduce the database access to a minimum to prevent deadlocks on an index creation as it can cause unexpected CPU spikes and degrade the entire system's performance.

### Helm Timeouts

When using `helm upgrade` you may need to add the `--timeout` flag if the index or migration to add will require significant time due to the large amount of data to index. You can upgrade with the timeout flag in the following manner:

```
helm upgrade diffgram . --timeout 5000
```

[block:callout]
{
  "type": "warning",
  "title": "Index Upgrades",
  "body": "Use a HA (High Availability) database system for uptime during maintenance, or run during a low usage period or schedule a dedicated maintenance window to prevent deadlocks when upgrading DB schema."
}
[/block]

[block:api-header]
{
  "title": "Production Overview"
}
[/block]

This is usually automated, e.g. through a github action

1. Initialize tracking on your preferred deployment tracking pipeline
2. Migrate the database using the provided almebic migrations
3. Pull the latest images
4. Run tests
5. Migrate traffic

[block:api-header]
{
  "title": "Updating the SDK"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "pip install diffgram --upgrade",
      "language": "text"
    }
  ]
}
[/block]

[block:api-header]
{
  "title": "Warnings"
}
[/block]

[block:callout]
{
  "type": "danger",
  "body": "[Read more](https://diffgram.readme.io/docs/helm-kubernetes-installation#updating-kubernetes-cluster-version)",
  "title": "Use Extreme Caution When Updating Kubernetes Cluster Version"
}
[/block]