Cloudslab / FogBus2

FogBus2: A Lightweight and Distributed Container-based Framework for Integration of IoT-enabled Systems with Edge and Cloud Computing
23 stars 10 forks source link

Demo.py default running on Big Sur OS #2

Open RPPrado opened 2 years ago

RPPrado commented 2 years ago

Hi there, I am trying to run the default application (FaceDetection) on Big Sur OS. Following the guide, I have successfully run the initial installation after preparing all the prerequisites and downloading the fogbus2 folder, indicated in Section 19.3.1 Building From Scratch, that is:

--STEP 3-- $ cd fogbus2 $ pwd /home/ubuntu/fogbus2 --STEP 4-- $ python3.9 -m pip install -r /containers/user/sources/requirements.txt --STEP 5-- $ cd containers/database/mariadb/ $ python3.9 configure.py --create --init --STEP 6-- $ pwd /home/ubuntu/fogbus2/demo $ python3.9 demo.py --buildAll

However, when trying to execute the default application:

$ python3.9 demo.py --default

I get errors:

sh-3.2# python3.9 demo.py --default [2021-10-18 00:28:21,615][TempDebugLogger] Listening at ('127.0.0.1', 5000) Traceback (most recent call last): File "/workplace/remoteLogger.py", line 101, in remoteLogger_.run() File "/workplace/remoteLogger.py", line 48, in run self.loggerManager.retrieveAll() File "/workplace/utils/remoteLogger/logger/manager.py", line 106, in retrieveAll self.retrieveResources() File "/workplace/utils/remoteLogger/logger/manager.py", line 118, in retrieveResources readAllResources = self.database.readAllResources() File "/workplace/utils/remoteLogger/logger/database/mysqlDB.py", line 383, in readAllResources result = self.threadSafeRead(self.connResources, sql) File "/workplace/utils/remoteLogger/logger/database/base.py", line 35, in threadSafeRead cursor.execute(sql) Exception in thread Thread-5: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner File "/usr/local/lib/python3.9/site-packages/mysql/connector/cursor.py", line 568, in execute self.run() File "/usr/local/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/workplace/utils/component/periodicTaskRunner.py", line 49, in periodicTask runner() File "/workplace/utils/remoteLogger/logger/manager.py", line 106, in retrieveAll self.retrieveResources() File "/workplace/utils/remoteLogger/logger/manager.py", line 118, in retrieveResources self._handle_result(self._connection.cmd_query(stmt)) File "/usr/local/lib/python3.9/site-packages/mysql/connector/connection.py", line 846, in cmd_query readAllResources = self.database.readAllResources() File "/workplace/utils/remoteLogger/logger/database/mysqlDB.py", line 383, in readAllResources result = self.threadSafeRead(self.connResources, sql) File "/workplace/utils/remoteLogger/logger/database/base.py", line 35, in threadSafeRead cursor.execute(sql) File "/usr/local/lib/python3.9/site-packages/mysql/connector/cursor.py", line 568, in execute self._handle_result(self._connection.cmd_query(stmt)) File "/usr/local/lib/python3.9/site-packages/mysql/connector/connection.py", line 846, in cmd_query result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) File "/usr/local/lib/python3.9/site-packages/mysql/connector/connection.py", line 656, in _handle_result File "/usr/local/lib/python3.9/site-packages/mysql/connector/connection.py", line 656, in _handle_result raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'platform' in 'field list' raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'platform' in 'field list' Traceback (most recent call last): File "/workplace/master.py", line 16, in from utils.master import ApplicationManager File "/workplace/utils/master/init.py", line 4, in from .messageHandler import AcknowledgementHandler File "/workplace/utils/master/messageHandler/init.py", line 1, in from .acknowledgementHandler import AcknowledgementHandler File "/workplace/utils/master/messageHandler/acknowledgementHandler.py", line 3, in from ..registry.base import Registry File "/workplace/utils/master/registry/base.py", line 19, in from .tools.prettyDecision import prettyDecision File "/workplace/utils/master/registry/tools/init.py", line 1, in from .prettyDecision import prettyDecision File "/workplace/utils/master/registry/tools/prettyDecision.py", line 4, in from ...scheduler.types.decision import Decision File "/workplace/utils/master/scheduler/init.py", line 1, in from .tools import assessResourceScore File "/workplace/utils/master/scheduler/tools/init.py", line 3, in from .initSchedulerByName import initSchedulerByName File "/workplace/utils/master/scheduler/tools/initSchedulerByName.py", line 5, in from ..policies.nsga.nsga2 import NSGA2 File "/workplace/utils/master/scheduler/policies/nsga/init.py", line 1, in from .nsga2 import NSGA2 File "/workplace/utils/master/scheduler/policies/nsga/nsga2.py", line 3, in from pymoo.algorithms.genetic_algorithm import GeneticAlgorithm ModuleNotFoundError: No module named 'pymoo.algorithms.genetic_algorithm' [2021-10-18 00:28:31,648][TempDebugLogger] Listening at ('127.0.0.1', 50000) [2021-10-18 00:28:31,680][Actor-?_127.0.0.1-50000] Profiling... [2021-10-18 00:28:32,392][Actor-?_127.0.0.1-50000] Registering... [2021-10-17 15:28:35,904][TempDebugLogger] Listening at ('127.0.0.1', 50101) OpenCV: Couldn't read video stream from file "0" [2021-10-17 15:28:35,952][User-?_127.0.0.1-50101] Waiting for enough Actor at ('127.0.0.1', 5001) [0/1] Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 107, in messageSender self.sendBytes( File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 56, in sendBytes self.resendBytes(messageInBytes, destAddr, retries - 1) File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 69, in resendBytes self.sendBytes(messageInBytes=message, File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 56, in sendBytes self.resendBytes(messageInBytes, destAddr, retries - 1) File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 69, in resendBytes self.sendBytes(messageInBytes=message, File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 56, in sendBytes self.resendBytes(messageInBytes, destAddr, retries - 1) File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 69, in resendBytes self.sendBytes(messageInBytes=message, File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 56, in sendBytes self.resendBytes(messageInBytes, destAddr, retries - 1) File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 69, in resendBytes self.sendBytes(messageInBytes=message, File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 56, in sendBytes self.resendBytes(messageInBytes, destAddr, retries - 1) File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 69, in resendBytes self.sendBytes(messageInBytes=message, File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 58, in sendBytes raise OSError OSError [2021-10-17 15:28:37,483][/Users/admin/Documents/FogBus2/demo/demo.py:77][Demo][INFO] Demo finished

What is missing there to get this error?what arguments should I include to get it executed? I have also tried to include the video path, but a similar output is obtained:

$ python3.9 demo.py --default --videoPath Users/admin/Documents/videos/example.mp4

It seems there is socket problem, as pointed out above in:

Traceback (most recent call last): File "/Users/admin/Documents/FogBus2/containers/user/sources/utils/connection/messageSender.py", line 49, in sendBytes clientSocket.connect(destAddr) ConnectionRefusedError: [Errno 61] Connection refused

I would appreciate the help. Thanks.

pancak3 commented 2 years ago

Hey @RPPrado, thanks for your interest in FogBus2!

I went through the logs, there are 3 apparent issues,

  1. Python dependencies are not prepared (or the module has changed its structure).
  2. Docker for macOS network environment is not configured correctly.
  3. There is no available camera connected to the device (or there is a driver issue with your camera).

For 1 and 2, we will improve the env preparation script to be more clear later once we get time. If you cannot wait, please make your hand dirty to change it a little bit based on your environment. For 3, since there is no video issue when you pass the video path in, it is very likely to be a camera issue.


Update: Just found we missed the 'Requirements' section in the readme :( I will put it soon.

Update: I have uploaded guiding for python env, it may help. I will update the docker env setup for BigSur later.