Upgrade the RAI Native App#

New releases of the RelationalAI (RAI) Native App are published on a weekly basis. This section explains how the upgrade process works and how to manage your app’s upgrades.

Table Of Contents#

Automatic Upgrades#

The RAI Native App receives automatic updates every week. Engines provisioned after an update are created using the latest version. Existing engines created prior to the update must be upgraded to the latest version to access new features and improvements.

By default, outdated engines are automatically upgraded every Monday at 10:00 AM UTC. You may change the upgrade schedule or disable automatic engine upgrades and upgrade manually at your convenience.

IMPORTANT

While an engine is upgrading, in-progress transactions are cancelled and queries from RAI Python models using the engine will fail. Upgraded engines are available for use as soon as their upgrade is complete. See Get Engine Details for information on viewing an engine’s status.

The first time you use an upgraded engine, you may be required to update the model’s libraries.

Set the Engine Upgrade Schedule#

Requires the app_admin application role.

To set or alter the engine upgrade schedule, call the app.schedule_upgrade() procedure with the day name and time in UTC:

#-- Schedule upgrades for Wednesdays at 15:00 UTC
CALL relationalai.app.schedule_upgrade('WEDNESDAY', '15:00');
/* +-------------------------------------+
   | Upgrade task scheduled successfully |
   +-------------------------------------+ */

View Current Engine Upgrade Schedule#

Requires the app_admin application role.

To view the current engine upgrade schedule, call the app.upgrade_schedule_status() procedure:

#-- View the current upgrade schedule and task status.
CALL relationalai.app.upgrade_schedule_status();

Manual Engine Upgrades#

RAI Native App updates are mandatory, However, if you prefer, you may disable automatic engine upgrades and manually upgrade engines at your convenience.

Disable Automatic Engine Upgrades#

Requires the app_admin application role.

To disable automatic engine upgrades, call the app.unschedule_upgrade() procedure:

#-- Disable automatic upgrades.
CALL relationalai.app.unschedule_upgrade();
/* +-------------------------------------+
   | Upgrade task cancelled successfully |
   +-------------------------------------+ */

To re-enable automatic engine upgrades, set a new upgrade schedule.

Upgrade Engines#

Requires the app_admin application role.

To start the engine upgrade process, call the app.upgrade() procedure:

#-- Start the upgrade process.
CALL relationalai.app.upgrade();
/*+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  | Upgrade started. Monitor the upgrade status using the app.upgrade_status view to verify that all engines have been upgraded and use the app.finalize_upgrade() procedure to complete the upgrade process.    |
  +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ */
IMPORTANT

While an engine is upgrading, in-progress transactions are cancelled and queries from RAI Python models using the engine will fail. Upgraded engines are available for use as soon as their upgrade is complete. See Get Engine Details for information on viewing an engine’s status.

The first time you use an upgraded engine, you may be required to update the model’s libraries.

The status of the engine upgrade can be viewed in the app.upgrade_status view:

#SELECT * FROM relationalai.app.upgrade_status;
/*+-------------------------+---------+-------+--------------+-------------------------------+-------------------------------+
  | NA_VERSION              | ATTEMPT | STATE | ENGINE_COUNT | STARTED_AT                    | LAST_UPDATE                   |
  |-------------------------+---------+-------+--------------+-------------------------------+-------------------------------|
  | 2024.10.27-e829e39d     | 1       | DONE  | 9            | 2024-10-27 08:11:32.490 -0700 | 2024-10-27 08:17:45.108 -0700 |
  +-------------------------+---------+-------+--------------+-------------------------------+-------------------------------+ */

Once the STATE columns shows DONE, call the app.finalize_upgrade() procedure to complete the upgrade:

#CALL relationalai.app.finalize_upgrade();
/*+---------------------------------+
  | Upgrade completed successfully. |
  +---------------------------------+ */

A message indicating the success or failure of the upgrade is returned. If the upgrade fails, repeat the upgrade process to attempt the upgrade again. You may view error messages and other details using the app.upgrade_status_details view.

Update Model Libraries#

Requires the all_resource_admin application role.

The first time a Python user attempts to run a query on an upgraded engine, they may see an error message indicating that the model’s libraries are out of date.

NOTE

COMING SOON: Library updates will be automated in a future release and the api.update_libraries() will be deprecated.

To update the libraries for a model, pass the model’s name to the api.update_libraries() procedure:

#-- Updating libraries requires an engine. If necessary, create an engine.
CALL relationalai.api.create_engine('my_engine', 'HIGHMEM_X64_S');

-- Update the libraries for the model 'MyModel'.
CALL relationalai.api.update_libraries('MyModel', 'my_engine');