Skip to content

Commit

Permalink
Run ldconfig after loading nvidia sysext (#15188)
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin authored Dec 12, 2024
1 parent 54fbecc commit 5f16614
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/middlewared/middlewared/plugins/docker/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ async def do_update(self, job, data):
# We want to clear upgrade alerts for apps at this point
await self.middleware.call('app.clear_upgrade_alerts_for_all')

if address_pool_changed or apps_pool_changed:
nvidia_changed = old_config['nvidia'] != config['nvidia']

if address_pool_changed or apps_pool_changed or nvidia_changed:
job.set_progress(20, 'Stopping Docker service')
try:
await self.middleware.call('service.stop', 'docker')
Expand All @@ -112,16 +114,16 @@ async def do_update(self, job, data):

await self.middleware.call('datastore.update', self._config.datastore, old_config['id'], config)

if nvidia_changed:
await self.middleware.call('docker.configure_nvidia')

if apps_pool_changed:
job.set_progress(60, 'Applying requested configuration')
await self.middleware.call('docker.setup.status_change')
elif config['pool'] and address_pool_changed:
job.set_progress(60, 'Starting docker')
await self.middleware.call('service.start', 'docker')

if old_config['nvidia'] != config['nvidia']:
await self.middleware.call('docker.configure_nvidia')

if config['pool'] and config['address_pools'] != old_config['address_pools']:
job.set_progress(95, 'Initiating redeployment of applications to apply new address pools changes')
await self.middleware.call(
Expand Down Expand Up @@ -174,6 +176,7 @@ def configure_nvidia(self):

if refresh:
subprocess.run(['systemd-sysext', 'refresh'], capture_output=True, check=True, text=True)
subprocess.run(['ldconfig'], capture_output=True, check=True, text=True)

if config['nvidia']:
cp = subprocess.run(['modprobe', 'nvidia'], capture_output=True, text=True)
Expand Down

0 comments on commit 5f16614

Please sign in to comment.