Retrieve device image over lighttpd
Modify the fpga-agent to fetch the device image from the controller via http instead of the drbd directory. Tests performed on the following systems: AIO-DX, AIO-DX plus compute, Standard 2+1 DC with AIO-DX plus subcloud DC with Standard subcloud Upgrades on duplex system Story: 2007875 Task: 41879 Depends-on: https://review.opendev.org/c/starlingx/stx-puppet/+/776490 Change-Id: I9a53eb2131c5ce2c2b87c1740e234af65ffabf78 Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
parent
85c31c46ab
commit
96a51f34fa
|
@ -40,7 +40,6 @@ from glob import glob
|
|||
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
import time
|
||||
import urllib
|
||||
|
||||
|
@ -140,20 +139,6 @@ def fetch_device_image(filename):
|
|||
return local_path
|
||||
|
||||
|
||||
def fetch_device_image_local(filename):
|
||||
# This is a hack since we only support AIO for now. Just copy the device
|
||||
# image file into the well-known device image cache directory.
|
||||
local_path = DEVICE_IMAGE_CACHE_DIR + "/" + filename
|
||||
image_file_path = os.path.join(dconstants.DEVICE_IMAGE_PATH, filename)
|
||||
try:
|
||||
shutil.copyfile(image_file_path, local_path)
|
||||
except (shutil.Error, IOError):
|
||||
msg = ("Unable to retrieve device image from %s!" % image_file_path)
|
||||
LOG.exception(msg)
|
||||
raise exception.SysinvException(msg)
|
||||
return local_path
|
||||
|
||||
|
||||
def write_device_image_n3000(filename, pci_addr):
|
||||
# Write the firmware image to the FPGA at the specified PCI address.
|
||||
# We're assuming that the image update tools will catch the scenario
|
||||
|
@ -607,15 +592,9 @@ class FpgaAgentManager(service.PeriodicService):
|
|||
LOG.info("ensure device image cache exists")
|
||||
ensure_device_image_cache_exists()
|
||||
|
||||
# Pull the image from the controller.
|
||||
# Pull the image from the controller via HTTP
|
||||
LOG.info("fetch device image %s" % filename)
|
||||
# For now, we only need to support AIO nodes, so just copy the
|
||||
# file from where we know sysinv-conductor put it.
|
||||
local_path = fetch_device_image_local(filename)
|
||||
|
||||
# TODO: when we need to support standalone workers, we'll need to
|
||||
# pull in the image file via HTTP.
|
||||
# local_path = fetch_device_image(filename)
|
||||
local_path = fetch_device_image(filename)
|
||||
|
||||
# TODO: check CSK used to sign image, ensure it hasn't been cancelled
|
||||
# TODO: check root key used to sign image, ensure it matches root key of hardware
|
||||
|
|
Loading…
Reference in New Issue