-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use pyinstaller #446
Use pyinstaller #446
Conversation
Deploying opendataeditor with Cloudflare Pages
|
Test OS: UbuntuTest case 1: installing the Ubuntu artifacts from this PR at https://github.com/okfn/opendataeditor/actions/runs/9710357555Hello, @pdelboca I am testing this in Ubuntu with the file generated in the distribution files in the PR, and while I dont get any errors when opening the app after installation without access to the Internet, I can't open any files in the app: This is what i see, the files/folders I try to add are not displayed either on the left menu or the right content panel. Test case 2: Making a build locallyI can't make a local build because I am missing some dependencies. I have run
I have googled the issue and I have found a couple links like this one and this one suggesting to change to remove the
So I also failed to build it manually for my particular cpu version. Test OS: WindowsVersion from artifactsThe version from the PR artifacts installs well in Windows 10 inside VirtualBox and works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. It works on Windows 10 for me but not in Ubuntu. I left a comment explaining my findings.
Given that the results for Windows and Ubuntu were very different, we should test this as well natively in MacOS, can we organize a call for this @romicolman ? 🙏 (We test it together and we make some comments for Patricio based in our findings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! It works for me on Ubuntu 🎉
I confirm that something weird is happing for the project selector (it was select
and select
for me as well initially but then it showed folders)
Also can be reported here - frictionlessdata/frictionless-py#1600. Interestingly, what have happened to pyinstaller
that fixes the setup compared to the year ago. The setup is pretty simple so I guess I was doing the same but it had a lot of dependency problems then
PS.
@guergana
Probably we might not need to fix these warnings. It seems to be working anyway, as I have them as well
@guergana I see that you are using Python 3.10. This PR migrates to Python 3.11 since it became a dependency for PyInstaller (it didn't worked for me on Python 3.10). Could you update your virtualenv to use 3.11 and try building the application again? @guergana and @roll the weird behaviour of showing select and then the project is due that we are starting the FastAPI process in the |
@guergana regarding your Test Case 1. Is there any log in your machine that could help me debug what's going on? |
Yes, I have just messaged you to coordinate so I can test it |
Hello @pdelboca I tested again with the new changes and at first the app wouldn't install at all. Then I upgraded my local version to Python 3.11 and the app was installed. I think this is less than ideal, because there is no notification at all that this is the reason why the installation is failing. This probably has to more with my ubuntu file installer than with the app itself perhaps? After upgrading to python 3.11 I could open the app but I still see the select select. I tried importing a file and opening a new project and I got the file prompt but the left menu didn't load any files and had a loader running for some very long minutes (5 to10) and then I got a message saying that the app couldn't connect to the server and the app crashed. I don't see any logs from the second run I did, but from the first run I got these logs only.
I almost broke my Ubuntu installation by replacing the Python version. The base Python version in my system should be 3.8. I can imagine other users having the same issue I am having... Can we somehow forsee what will be the amount of users of the ODE using Ubuntu? |
@guergana thanks for the detailed input. Let's clarify some points. We have 2 scenarios mixing up: developer experience and user experience. User experienceWe need to test whether the distribution files that our pipelines create can be installed in Ubuntu and if the application works. (Same for Windows and Mac) This scenario is usually tested with the following actions:
This scenario tests that the desktop application can be installed and it words. ODE is a Desktop application so it shouldn't be affected by the local Python versions. Developer experienceThis is what happens when we, as a developers, build and run the application in our machines. This scenario usually relates to our day to day work:
User vs Developers.So back to your questions:
I should have been more explicit in the description of the PR. To be able to use
There shouldn't be needed to update the base Python Distribution of your Ubuntu for this. Ubuntu can have several python's installed (I have 3.9, 3.10 and 3.11 in my machine). It is true that there is no notification why the installation is failing, but this PR includes changes in the documentation and the config files to make it explicity that Python 3.11 is now required to develop.
As mentioned before, we should distinguish end users with developers. End Users shouldn't care about the Ubuntu Version or the Python version since ODE should install all the dependencies required as any normal Desktop application. If installing the Let's have a call to clarify further this scenarios. But in a nutshell I have one follow-up questions for you: Does the error your are discribing happens with the application you build (developer experience) or with the distribution file you downloaded (end user experience)? |
@pdelboca Ah, sorry for not being clear. I installed the |
@guergana I installed the application in a new VM running Ubuntu 20.04 and I was able to reproduce the error. I was reading a little bit about it and I got to this section of pyinstaller documentation: https://pyinstaller.org/en/stable/usage.html?highlight=glibc#making-gnu-linux-apps-forward-compatible Which suggest to always build the application in the oldest version of the OS we want to support:
I will try to build our application using Ubuntu 20.04 to see if it fixes the error. |
@pdelboca It works!!!! amazing find! 💯 i see here that version 20.04 was released on 2020 so I guess that's enough support for now? Maybe we can mention that this is the minimum version we support from ubuntu somewhere in the docs as well. My local version is For the record, I tested again with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work @pdelboca !
🎉 |
This PR refactors the application to use PyInstaller to handle the backend FastAPI server when building the application.
Main Changes:
runServer
logic to only one function and one module.TODO:
loading.html
splash screen do not work properly since we need to migrate the logic of waiting to the server from the main application to the launch script. This will be better to do in Improve the launch & onboarding experience for first time, and subsequent users #445 .