Merge "Remove useless interfaces in agent"

This commit is contained in:
Zuul 2020-03-21 00:53:55 +00:00 committed by Gerrit Code Review
commit d25bc6569f
2 changed files with 0 additions and 48 deletions

View File

@ -47,19 +47,6 @@ class AgentManager(periodic_task.PeriodicTasks):
def periodic_tasks(self, context, raise_on_error=False):
return self.run_periodic_tasks(context, raise_on_error=raise_on_error)
def hardware_list(self, context, values):
"""List installed hardware."""
pass
def fpga_program(self, context, deployable_uuid, image_uuid):
"""Program a FPGA region, image can be a url or local file"""
# TODO(Shaohe Feng) Get image from glance.
# And add claim and rollback logical.
path = self._download_bitstream(context, image_uuid)
dep = self.cond_api.deployable_get(context, deployable_uuid)
driver = self.fpga_driver.create(dep.vendor)
driver.program(dep.address, path)
def fpga_program_v2(self, context, controlpath_id,
bitstream_uuid, driver_name):
# TODO() Use tempfile module?
@ -72,19 +59,6 @@ class AgentManager(periodic_task.PeriodicTasks):
LOG.info('Driver program() API returned code %s', ret)
os.remove(download_path)
def _download_bitstream(self, context, bitstream_uuid):
"""Download the bistream
:param context: the context
:param bistream_uuid: v4 uuid of the bitstream to reprogram
:returns: the path to bitstream downloaded, None if fail to download
"""
download_path = "/tmp/" + bitstream_uuid + ".bin"
self.image_api.download(context,
bitstream_uuid,
dest_path=download_path)
return download_path
@periodic_task.periodic_task(run_immediately=True)
def update_available_resource(self, context, startup=True):
"""Update all kinds of accelerator resources from their drivers."""

View File

@ -20,7 +20,6 @@ import oslo_messaging as messaging
from cyborg.common import constants
from cyborg.common import rpc
from cyborg import objects
from cyborg.objects import base as objects_base
from oslo_log import log
@ -52,27 +51,6 @@ class AgentAPI(object):
version_cap=self.RPC_API_VERSION,
serializer=serializer)
def hardware_list(self, context, values):
"""Signal the agent to find local hardware."""
pass
def program_fpga_with_bitstream(self,
context,
deployable_uuid,
bitstream_uuid):
"""Actiion to program a target FPGA"""
version = '1.0'
dpl_get = objects.Deployable.get(context, deployable_uuid)
if not dpl_get:
# TODO(Li Liu) throw an exception here
return 0
cctxt = self.client.prepare(server=dpl_get.host, version=version)
return cctxt.call(context, 'fpga_program',
deployable_uuid=deployable_uuid,
image_uuid=bitstream_uuid)
def fpga_program_v2(self, context, hostname, controlpath_id,
bitstream_uuid, driver_name):
LOG.info('Agent fpga_program_v2: hostname: (%s) ' +