cosmic-pi-deprecated / cosmicpi-rpi_V1.5

Our web interface and data collection software for Raspberry Pi
Other
4 stars 5 forks source link

Package software for easier roll out + updates #16

Open pingud98 opened 6 years ago

pingud98 commented 6 years ago

We should convert this into a .deb/.rpm or ideally a PPA that we can use to integrate with Raspbian for automatic installation and future updates. This should be a high priority - so that other features can be more easily installed by users.

lukicdarkoo commented 6 years ago

I created a Python package: https://github.com/CosmicPi/cosmicpi-rpi_V1.5/blob/rest/setup.py

Should we create .deb/.rpm as well? setuptools supports "out of the box" converting Python package to .rpm (https://docs.python.org/2.0/dist/creating-rpms.html). Conversion to .deb is supported by third-party applications (https://github.com/paylogic/py2deb).

We should also consider posting installation script on Cosmic Pi website, so a user would be able to install it by running something like this:

curl http://cosmicpi.org/install | sh

Meteor is using that approach - https://github.com/meteor/meteor

heborras commented 6 years ago

Sweet!

So this installs the requirements via pip? Or does it just check if the needed libraries are installed? I'm asking because installing numpy and matplotlib via pip takes very long (>1h) on a Pi zero. Installing those packages as precompiled versions from the offical PPA is a lot faster (~few minutes). Could those installs be moved into the post install or can the setup.py already do that? Or maybe we can take care of that when doing the conversion to .deb/.rpm?

lukicdarkoo commented 6 years ago

Oh, I forgot about it, good point, thanks! I tested a speed of the new UI/REST on Raspberry Pi Zero W, but not the packaging.

As you said we can take care of in .deb/.rpm package, eg. if pip sees that python-numpy package is already installed it will skip the installation of numpy (tested). Also, it is possible to add Shell script in setup.py which will install Debian dependencies.

P.S. @pingud98 @HenniOVP Please verify a name of the package, licence, description etc, so we can publish it on PyPi.

heborras commented 6 years ago

Nice!

Licence looks good and some minor details:

project_urls={
    'Source': 'https://github.com/CosmicPi/cosmicpi-rpi_V1.5',
},
description='UI for the CosmicPi cosmic ray detector',
long_description='This software provides the user interface, temporary storage and connection to the internet storage for the detectors of the CosmicPi project. The Cosmic Pi project aims to build the world\'s largest open source distributed cosmic ray telescope. You too can be a part of the project, by becoming a Cosmic Pixel!',

Added one urls. Changed description a bit, since people are not downloading the detector, but the software for interfacing with it.

Another thing: I'm a bit uneasy about the noarch thing. In theory the package should run on any system that can supply the dependencies. However, if we manage the package installs via an additional script. That could possibly create problems with people installing the package under e.g. windows and running into errors.

lukicdarkoo commented 6 years ago

Good suggestion! Changed.

I am not sure if package name should be cosmicpi or cosmicpi-rpi. Also, suffix _V1.5 of this repository name may be deleted?

heborras commented 6 years ago

Nice!

So, I think cosmicpi as the package name should be enough. Because if I have the future plans correctly in mind, then from a users perspective this should be the only software they need to install/touch. The software on the Arduino / later STM should under normal circumstances not be directly touched by the user. The repository on the other hand can still keep the cosmicpi-rpi, since we still have more than one software to manage...

And yeah, I think we can drop the suffix _V1.5. The detector_connect is designed to be extended for future detector interfaces.

pingud98 commented 6 years ago

Aha. I've discovered 80 rules in my gmail that delete messages automatically; like this thread! Now I'm back. Will try to catch up.

On 27 March 2018 at 13:41, Hendrik Borras notifications@github.com wrote:

Nice!

So, I think cosmicpi as the package name should be enough. Because if I have the future plans correctly in mind, then from a users perspective this should be the only software they need to install/touch. The software on the Arduino / later STM should under normal circumstances not be directly touched by the user. The repository on the other hand can still keep the cosmicpi-rpi, since we still have more than one software to manage...

And yeah, I think we can drop the suffix _V1.5. The detector_connect is designed to be extended for future detector interfaces.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmicPi/cosmicpi-rpi_V1.5/issues/16#issuecomment-376494034, or mute the thread https://github.com/notifications/unsubscribe-auth/ABs1pzSqShxa0qvXEwkqBVgKfZU1htJmks5tiiVVgaJpZM4Stll8 .

lukicdarkoo commented 6 years ago

The software is now packaged. Everything related to the package (code, dependencies, services and config file) is packed as a part of Python package (pip install cosmicpi). The Raspberry Pi configuration (that also includes software installation) is now available as a script and you can run it by

curl https://gist.githubusercontent.com/lukicdarkoo/e33e00c6780ad0215d3932b810a10e46/raw | sh`

PIP Packages issue Because of some weird reason pip install cosmicpi doesn't put .conf and .service files to /etc but to Python home directory. The same command works perfectly on my laptop. On the other hand, calling python setup.py install works fine everywhere, therefore that approach is used in the configuration script.

Installation script location The installation script is now located in my private Gist. It would be nice if we could move it to e.g. https://cosmicpi.org/configure. If you agree I can put it there, it would look very professional ;)

curl https://cosmicpi.org/configure | sh
pingud98 commented 6 years ago

@lukicdarkoo looking good! Sorry I didn't have time to roll my own version yesterday. Please go ahead with the cosmicpi.org/configure - how do you put it there with Jekyll? I will run it on the hardware tonight!

lukicdarkoo commented 6 years ago

Done, the configuration command is:

curl http://cosmicpi.org/configure | sh
pingud98 commented 6 years ago

Installation worked flawlessly! Nice one. Will leave it running tonight and then pop it in to the demo unit tomorrow.

One comment, the native IP should be 192.168.12.1, not 192.168.10.1 as currently set.

Haven't/didn't test it with cosmipi as the default username, just pi. Will do that next time.

Good stuff!

On Tue, 22 May 2018, 23:47 Darko Lukić, notifications@github.com wrote:

Done, the configuration command is:

curl http://cosmicpi.org/configure | sh

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmicPi/cosmicpi-rpi_V1.5/issues/16#issuecomment-391151595, or mute the thread https://github.com/notifications/unsubscribe-auth/ABs1p2qx3QjhOIfXJEf7wuXXuKu7Mx2Zks5t1Id2gaJpZM4Stll8 .