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

Create installation methods for non-developers #10

Open
9 of 13 tasks
ErikBjare opened this issue Jul 11, 2016 · 37 comments
Open
9 of 13 tasks

Create installation methods for non-developers #10

ErikBjare opened this issue Jul 11, 2016 · 37 comments

Comments

@ErikBjare
Copy link
Member

ErikBjare commented Jul 11, 2016

Right now you pretty much need to be a developer to start using ActivityWatch. (not anymore!)

One easy improvement we could make is to create a bash one-liner that installs ActivityWatch (much like the one-liner used to install brew). In the future (when we leave beta) we'd likely have to distribute installers/packages.

Would require some kind of process management for aw-server and watchers. (we now have aw-qt)

Must do:

  • Linux: Build a portable .zip
  • macOS: Build a portable .zip
  • Windows: Create a portable .zip

May do (secondary goals):

And finally:

  • Put installation instructions in README

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ErikBjare ErikBjare changed the title Create an installation method for end-users Create an installation method for non-developers Jul 11, 2016
@johan-bjareholt
Copy link
Member

johan-bjareholt commented Jul 11, 2016

PyInstaller has gotten much better and more stable the past 3 years and has windows, mac and linux support. I don't know how advanced Gitlab CI is, but if it supports generating artifacts and such we could probably make a job that generates an executable pretty easily.

@ErikBjare
Copy link
Member Author

@johan-bjareholt Holy shit, managed to get aw-server bundled in less than 5 minutes on OS X. We should definitely investigate PyInstaller further. 🎉

Looks like GitLab CI supports artifacts. If we could use it then hooray. Building for OS X and Windows might still be an issue on a Linux host (which we'll probably use for GitLab CI), and will probably have to involve VMs. 😭

Anyway, automating building the packages is probably premature optimization. For now we could just do it by manually running a simple build script.

@johan-bjareholt
Copy link
Member

The only bad thing is that it sometimes creates pretty huge binaries but that can be optimized.

I agree, let's just make build scripts for now and do automation later.

@ErikBjare ErikBjare modified the milestone: 1.0.0 Jul 14, 2016
@ErikBjare
Copy link
Member Author

I think the primary action on this issue would be to build a .deb, and then build a macOS .app. When Windows support is tested we should create a portable .zip and also a installer using NSIS.

Adding these actions as TODOs.

@ErikBjare ErikBjare changed the title Create an installation method for non-developers Create installation methods for non-developers Apr 17, 2017
@ErikBjare
Copy link
Member Author

I've been looking into snap packages. Looks promising and not too difficult. Definitely something to explore but might not be a priority.

@johan-bjareholt
Copy link
Member

@ErikBjare Flatpak is also a alternative to snaps.

@ErikBjare
Copy link
Member Author

Ah yes, so flatpak is closer to snap? My first impression was that it was more akin to AppImage but looks like I was wrong.

@ErikBjare
Copy link
Member Author

ErikBjare commented Apr 25, 2017

Flatpak seems to have much better support across distros: https://kamikazow.wordpress.com/2017/02/09/adoption-of-flatpak-vs-snap/

I must say I'm leaning towards flatpak after some reading. AppImages are also nice (for its usecase, sudo-less portability) but doesn't make much sense with the almost microservice-like architecture of ActivityWatch, for portability people might as well use the PyInstaller zips.

@johan-bjareholt
Copy link
Member

In terms of functionality and community (freedesktop vs canonical) I would prefer flatpak, but flatpak is currently not available in the official ubuntu and debian repositories so we might be forced to use snap until then.

If i remember correctly it might be in the debian testing repos and the next debian version will be late this summer i believe so it might be in ubuntu 17.10? But that's just a guess.

@ErikBjare
Copy link
Member Author

@johan-bjareholt Perhaps a .deb is the best way forward for now. Most people who don't use a distro supporting debs don't mind writing a few commands in the terminal to get what they want anyway.

On a more personal level, I think a PKGBUILD would be nice (started working on it as you saw) but I think I'd need some input from a more seasoned packager. Might check if there are some people on an IRC somewhere that can review my work when I get there.

@johan-bjareholt
Copy link
Member

I don't think that we should make a pkgbuild, that would mean that we should provide all of our other python dependencies via pacman. It would be easier to just make packages installable via pip directly from github with "sudo pip install git+git://github.com/activitywatch/aw-server.git#egg=aw-server" and then watchers with "sudo pip install git+git://github.com/activitywatch/aw-qt.git#egg=aw-qt" as a start for developers.

@ErikBjare
Copy link
Member Author

Ah right, fair enough. I remember I had thought about that in the past, thanks for clarifying.

@ErikBjare
Copy link
Member Author

@johan-bjareholt I don't think we need to provide all dependencies via pacman. We could opt to install all dependencies via pip if we wanted in the pkgbuild, perhaps even specify an isolated environment where all dependencies would end up using the --root option to pip install (not polluting other Python programs on the system).

One major argument for providing a PKGBUILD would be to enable easier updates by end-users. People rarely (if ever) update their pip-installed packages. But perhaps still not a priority.

@johan-bjareholt
Copy link
Member

@ErikBjare Have never seen a PKGBUILD which actually incorporates this, but it sounds pretty clean.

@ErikBjare
Copy link
Member Author

Since the zips are done, I'm downgrading this to low priority.

@johan-bjareholt
Copy link
Member

I don't think we should do a PKGBUILD, I'd prefer if we simply fixed so we could install from pip via git (such as "pip install git+git://github.com/activitywatch/aw-server.git#egg=aw-server") and then fix our .app bundle. After that I'd say that the packaging is in a rather good shape.

@ErikBjare
Copy link
Member Author

ErikBjare commented Nov 26, 2017

We could do a simple activitywatch-bin PKGBUILD that just unzips into /opt/activitywatch or something. But yeah, a install-from-source PKGBUILD would probably be too much work for too little gain at this point.

Installing using pip alone would be nice, but can't be installed from git since we'd need to pre-build the web UI and some other stuff (like aw-qt's PyQt resource build step). One approach would be to register the packages on PyPI and ship source bundles with the prebuildt stuff included, but the complexity of maintaining the packages on PyPI is something I'd rather be without. Perhaps it could be automated in the CI process though.

The .app bundle definitely needs fixing (but I'm not sure how).

@ErikBjare
Copy link
Member Author

ErikBjare commented Feb 26, 2018

Just completed that activitywatch-bin PKGBUILD and uploaded to AUR. See PR #174.

@ErikBjare ErikBjare removed this from the v0.8 milestone May 7, 2018
@ErikBjare
Copy link
Member Author

Just started working on a .deb package here: https://github.com/ActivityWatch/deb-activitywatch-bin

@0xdevalias
Copy link

It would be awesome if this was included in homebrew.

@ErikBjare
Copy link
Member Author

@0xdevalias Indeed it would be! Hopefully someone makes it so.

@ErikBjare
Copy link
Member Author

Getting it up on Chocolatey would make installation and updating easier on Windows, I submitted a request for packager here: chocolatey-community/chocolatey-package-requests#552

@BrunoVernay
Copy link

In terms of functionality and community (freedesktop vs canonical) I would prefer flatpak, but flatpak is currently not available in the official ubuntu and debian repositories so we might be forced to use snap until then.

If i remember correctly it might be in the debian testing repos and the next debian version will be late this summer i believe so it might be in ubuntu 17.10? But that's just a guess.

Flatpak are available everywhere.

@freayd
Copy link

freayd commented Mar 14, 2019

Hi everyone. The brew formula is now available. You can install it with:

brew cask install activitywatch

Creating a .app would be a nice next step for macOS.

@johan-bjareholt
Copy link
Member

@freayd Thanks for submitting the brew formula!

Yes, we definitely need a .app bundle, we have pushed on that issue for a bit too long now and really makes the macOS experience sub-par. It is not trivial though as PyInstallers support for apps is not great and I find the documentation on how .app bundles work from Apple being quite bad for non-xcode projects.

@ErikBjare
Copy link
Member Author

ActivityWatch is now available on Chocolatey! Although the version published is ancient (the last stable version: v0.7.1) it's a good first step.

@ErikBjare
Copy link
Member Author

Just finished putting together a Windows installer (that also sets up autostart for you). Here's the PR: #303

Will be available in the next release.

@xylix
Copy link
Contributor

xylix commented Dec 27, 2019

Are there any plans to implement or is there an update script?

I personally have upgraded aw a couple times on MacOS just by overwriting the old activitywatch folder with the newer ones and leaving all data intact. Is there some undesirable side effect or is this the preferred update method as of now?

@ErikBjare
Copy link
Member Author

@xylix That's the preferred method yes. You can wipe the entire installation folder if you'd like as well, all your data is stored elsewhere.

There's now an installer for Windows, but macOS has been lagging behind in terms of packaging (we still haven't gotten around to building the .app) and unless someone with a mac picks this up that's unlikely to change anytime soon.

@ErikBjare
Copy link
Member Author

With ActivityWatch/deb-activitywatch-bin#1 merged I think we can start building the .deb in CI and offer it as an installation method.

@Baltix
Copy link

Baltix commented May 18, 2020

@ErikBjare Please, make normal ActivityWatch deb packages and repository for Ubuntu and Debian systems, I can help you with this task, it's not hard, see https://wiki.debian.org/Packaging/Intro
The main task is to make correct Debian source package and only from this source package you can then build the Debian binary package which is what actually get installed.
The source package consists, in its simplest form, of two things:
The upstream tarball, renamed to follow a systematic pattern.
A debian directory, with any changes made to upstream source, plus all the files created for the Debian package.

If you wanna make useful and correct debian packages then we should create separate packages for activitywatch-server (and maybe one more for activitywatch-server-rust), activitywatch-watchers, activitywatch-systray-qt. Each package should start his service (aw-server, aw-watcher-afk, aw-watcher-window, etc) in user-session either by having .desktop file in /etc/xdg/autostart or with systemd, see https://wiki.archlinux.org/index.php/Systemd/User and https://www.freedesktop.org/software/systemd/man/systemd.special.html#graphical-session.target
systemd offers users the ability to manage services under the user's control with a per-user systemd instance, enabling users to start, stop, enable, and disable their own units. This is convenient for daemons and other services that are commonly run for a single user, such as mpd

Only activitywatch-systray-qt package should depend on QT libraries and this package could depend or recommend activitywatch-server and activitywatch-watchers packages.

I can help you and take some tasks - please just create debian/control and debian/rules according to https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf#Outline0.2.3.15 (you can use dh-make command for this) for each package (activitywatch-server, activitywatch-watchers, activitywatch-systray-qt) or one debian/control and debian/rules file for all packages if you will always distribute all activitywatch components sources in one archive.
I can do all other taks - compile and test deb packages, fix packaging issues, create PPA repository and write automated packaging building recipe from git, see for example
https://code.launchpad.net/~gnome-shell-extensions/+recipe/gnome-shell-extensions-enhancements and https://help.launchpad.net/Packaging/SourceBuilds

@ErikBjare
Copy link
Member Author

@Baltix Your comment is mostly just duplicating what you already said in ActivityWatch/deb-activitywatch-bin#1 (comment).

Each package should start his service in user-session with systemd

As I said in ActivityWatch/deb-activitywatch-bin#1 (comment): We can't run the watchers as systemd services (at least not reliably), as they rely on an X session (and graphical-session doesn't work reliably on all distros, yet: https://superuser.com/questions/759759/writing-a-service-that-depends-on-xorg).

We welcome work to improve things, but we (the maintainers) do not prioritize working on the deb to get it up to Debian standards, since the issues are so many. I've created an issue with the past discussion we've had with @thomasgoirand here: ActivityWatch/deb-activitywatch-bin#2

@stale
Copy link

stale bot commented Mar 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 12, 2021
@stale
Copy link

stale bot commented Mar 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 17, 2022
@guysoft
Copy link

guysoft commented Mar 25, 2022

Hey,
I wrote a script that creates an appimage, but I am not sure how to append it to the existing ci. I can't test on my fork because mac breaks stuff.
See #725

@stale stale bot removed the stale label Mar 25, 2022
@redactedscribe
Copy link

Scoop is another popular Windows package manager. It uses a method of persisting user data across upgrades which requires that the user data files reside in the same location as the program's files. If the %localappdata%\activitywatch folder could exist and be read from the same location as aw-qt.exe (perhaps renaming the folder to portable-data), then ActivityWatch would be suitable for adding to Scoop's Extras bucket (group of manifests). Otherwise the package will be have to be added to the nonportable Scoop bucket, which isn't ideal and generally undesired by those who use Scoop.

In the meantime, for anyone who uses Scoop, a non-portable manifest:

{
    "version": "0.12.1",
    "description": "A cross-platform, extensible, privacy-focused, free and open-source automated time tracker.",
    "homepage": "https://activitywatch.net/",
    "license": {
        "identifier": "MPL-2.0",
        "url": "https://github.com/ActivityWatch/activitywatch/blob/master/LICENSE.txt"
    },
    "url": "https://github.com/ActivityWatch/activitywatch/releases/download/v0.12.1/activitywatch-v0.12.1-windows-x86_64.zip",
    "extract_dir": "activitywatch",
    "hash": "1d7eb9dc706f3ef3fe866e025277f8296c0744a87f31e78befaf393e70ae41ad",
    "bin": [
        "aw-qt.exe",
        "aw-server\\aw-server.exe",
        "aw-server-rust\\aw-server-rust.exe"
    ],
    "shortcuts": [
        [
            "aw-qt.exe",
            "ActivityWatch"
        ]
    ],
    "persist": [],
    "checkver": {
        "github": "https://github.com/ActivityWatch/activitywatch"
    },
    "autoupdate": {
        "url": "https://github.com/ActivityWatch/activitywatch/releases/download/v$version/activitywatch-v$version-windows-x86_64.zip"
    }
}

@pringithub
Copy link

As an ubuntu power user, it would be great to see a .deb or AppImage for installation. Also the documentation is lacking on setting up autostart on ubuntu (https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en).

vasuemme111 referenced this issue in vasuemme111/activitywatch Mar 26, 2024
sync data from sundial to ralvie server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants