Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCS-1990 Trying to get the webenabled downloads to work #717

Draft
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

ThomasSchellenbergNextCentury
Copy link
Collaborator

Ideally, we should be able to double-click on the "mcsweb" package file (binary/executable) to start the application.

NOTES BEFORE YOU BEGIN:

  • I had problems using pyinstaller with a python virtual environment installed in the MCS root folder. I'd recommend installing a new python virtual environment in the webenabled folder (see the webenabled README for details).
  • You'll need to pip install portalocker before you use pyinstaller (I've just added it to the MCS setup.py file, but since it wasn't there for the latest release, you'll need to do it manually for now).
  • From what I've read, you can't use pyinstaller to build an application on Linux, and then run that application on Windows; you need to use pyinstaller to build the application on Windows, and have separate packages for each OS.
  • When running everything via the pyinstaller file, to open the webpage, I had to use 127.0.0.1:8080/mcs instead of localhost:8080/mcs

STATUS REPORT:

Previously we tested by executing ./dist/mcsweb/mcsweb on the command line (from the webenabled/ folder), and this still works on Linux.

As an intermediary step, I tried executing ./mcsweb (from the webenabled/dist/mcsweb/ folder). There were a few problems that I've since resolved, so that also works on Linux. As you'll see in the "Package" instructions on the README, the resolution involved copying a bunch of files into the dist/mcsweb/ folder (not ideal, but, hey, it works).

PROBLEM 1: Unfortunately, double-clicking on the binary in Linux doesn't work; you can still load the webpage, but Unity doesn't start, so clicking on a scene doesn't do anything. Since running things this way means you can't see log messages in a terminal, I don't know what sort of error is being thrown. You could try temporarily hard-coding the logger in mcsweb.py to write to a log file, which might get you some information.

PROBLEM 2: I can't get the Windows package to run at all, for any of these three methods; the flask server starts, but when I open the webpage, I get a ModuleNotFoundError for the watchdog python module, which should be installed correctly on my machine... I don't remember who originally tested this on Windows (maybe it was Phi?), but I'm not sure why it's not working at all anymore.

Comment on lines -1 to 4
from enum import Enum, unique
from enum import Enum


@unique
class TaskDescription(Enum):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this particular decorator was causing pyinstaller to fail...

@@ -60,6 +60,7 @@ def get_version():
'numpyencoder==0.3.0',
'opencv-python==4.4.0.46; python_version<="3.9"',
'opencv-python==4.5.4.60; python_version>="3.10"',
'portalocker',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this branch never gets merged, it'd probably be good to add this to the setup.py on the development branch

Base automatically changed from MCS-1983 to new-webenabled December 15, 2023 19:56
Base automatically changed from new-webenabled to development December 27, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant