facerecognition icon indicating copy to clipboard operation
facerecognition copied to clipboard

Add Support for nextcloud 24

Open jakobroehrl opened this issue 2 years ago • 20 comments

https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule

jakobroehrl avatar Apr 12 '22 09:04 jakobroehrl

Do you know of any breaking changes in 24 that might affect face recognition?

guystreeter avatar Apr 15 '22 21:04 guystreeter

Yep, support for NC24 would be greatly appreciated.

elpraga avatar May 02 '22 08:05 elpraga

with ubuntu 22.04 and NC24 support for php 8.1 is needed

adeepn avatar May 02 '22 10:05 adeepn

We install this in the Nextcooud VM, and we are about to upgrade to Ubuntu 22.04 with PHP 8.1. Support for that would be great!

https://github.com/nextcloud/vm/blob/master/apps/face-recognition.sh

enoch85 avatar May 02 '22 17:05 enoch85

Hi all, Some notes..

In general, except for #574 (Fix on https://github.com/matiasdelellis/facerecognition/pull/575/commits/0bc2b115945a6716fad0d4b08f4ae2e0491e8e31), it seems that support NC24... Please test and confirm..

About php 8.1, this app passes the lint test, but I understand that probably Nextcloud is not even ready for it. See https://github.com/nextcloud/server/issues/29287 among many other reports.

About Ubuntu 22.04, note that my repository (Used in that script) does not have packages for this version. But there you absolutely no need to upgrade to this LTS when the old one is still supported until at least 2025.

Please be patient... There is no any reason to upgrade as soon as new versions come out. It never brings good results!. 🙈

matiasdelellis avatar May 02 '22 18:05 matiasdelellis

Nextcloud 24 works fine with PHP 8.1. 👍🏻

So now the questions remains when you will push repos for jammy (22.04) 🙃

enoch85 avatar May 02 '22 19:05 enoch85

Ok.. One step at a time... We have a repository for ubuntu jammy and dlib package..

echo "deb https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list
wget -qO - https://repo.delellis.com.ar/repo.gpg.key | sudo apt-key add -
apt update
apt install libdlib-dev

To achieve that, I had to prepare an entire development environment (which I already have working elsewhere, but ubuntu now uses Zstd, and basically it doesn't work anywhere other than ubuntu > 21.10). :flushed: Then, first I try to compile pdlib using the official ubuntu package, and obviously it fails because the ubuntu package doesn't add the f**g pkg-config file. :weary: (the dev package is almost useless)

Well.. I compile dlib again and seems that work. 🤔 I copy this to my repository server, add the distribution to reprepro, and try to add the package to that, and as obviously it couldn't be easy, it failed because reprepro doesn't understand Zstd packages either.. :tired_face:

Well. I go back to my original packaging environment, I have to repackage reprepro with Zstd support.. Luckily it compiled correctly, but being a sensible component, you never know. 🤔 I copied it to my server, installed it with my fingers crossed and it seems to work. 🎉 (I still don't know if I broke something else 😅)

So, I was able to add the dlib package, and with that, if I'm in a better mood 🙈 (and have time 😅 ), I compile pdlib using that package that just uploaded. :tired_face:

Please at least test that the repository works and that package can be installed. 🙏🏻

p.s: Excuse the catharsis, (and believe me that this is summarized). haha

matiasdelellis avatar May 11 '22 00:05 matiasdelellis

Well.. I woke up in a better mood.. 😅 ... and did the php8.1-pdlib package.. 😄

echo "deb [arch=amd64] https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list
wget -qO- https://repo.delellis.com.ar/repo.gpg.key | sudo tee /etc/apt/trusted.gpg.d/pdlib.asc
apt update
apt install php8.1-pdlib

EDIT: Changed with the new apt-key way.. EDIT 2: Change repo to only look for amd64 packages to avoid a warning in apt update..

matiasdelellis avatar May 11 '22 14:05 matiasdelellis

@matiasdelellis Is an RPM for Fedora 36 in the works?

TylerVigario avatar May 14 '22 20:05 TylerVigario

@TylerVigario https://copr.fedorainfracloud.org/coprs/matias/dlib/

😉

matiasdelellis avatar May 14 '22 20:05 matiasdelellis

@matiasdelellis Maybe we can compile pdlib targeting dlib 19.23?

[root@tylervigario ~]# dnf install pdlib
Last metadata expiration check: 0:22:44 ago on Sat 14 May 2022 01:31:55 PM PDT.
Error:
 Problem: conflicting requests
  - nothing provides libdlib.so.19.22.0()(64bit) needed by pdlib-1.0.2-4.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
[root@tylervigario ~]# dnf info dlib
Last metadata expiration check: 0:23:34 ago on Sat 14 May 2022 01:31:55 PM PDT.
Available Packages
Name         : dlib
Version      : 19.18
Release      : 1.fc32
Architecture : src
Size         : 11 M
Source       : None
Repository   : copr:copr.fedorainfracloud.org:matias:dlib
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.

Name         : dlib
Version      : 19.23
Release      : 1.fc36
Architecture : i686
Size         : 791 k
Source       : dlib-19.23-1.fc36.src.rpm
Repository   : fedora
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.

Name         : dlib
Version      : 19.23
Release      : 1.fc36
Architecture : x86_64
Size         : 734 k
Source       : dlib-19.23-1.fc36.src.rpm
Repository   : fedora
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.

TylerVigario avatar May 14 '22 20:05 TylerVigario

@TylerVigario Ohhh.. Try again.. Maybe you should clear dnf cache since it is the same version.

matiasdelellis avatar May 14 '22 21:05 matiasdelellis

This is now implemented in the Nextcloud VM.

enoch85 avatar May 14 '22 21:05 enoch85

@matiasdelellis It works now!

TylerVigario avatar May 14 '22 22:05 TylerVigario

@matiasdelellis Forget my original comment! It works now!

I had to recompile as you pointed out, but to make it fast I didn't even bother to change the version of the package. 😅

Thanks to everyone!.

matiasdelellis avatar May 14 '22 22:05 matiasdelellis

The official Docker image for Nextcloud 24 runs Debian Bullseye, but has PHP 8.0.18. Is it possible for you to pre-build pdlib for that?

guystreeter avatar May 16 '22 17:05 guystreeter

Hi @guystreeter

The official Docker image for Nextcloud 24 runs Debian Bullseye, but has PHP 8.0.18. Is it possible for you to pre-build pdlib for that?

Well, it is impossible make a pdlib package when inside the docker image they don't use official repositories.. For my part, what I can offer you is the dlib package that works in Bullseye, and compiling pdlib against that is relatively easy.

See:

  • https://github.com/matiasdelellis/facerecognition/wiki/PDlib-Installation#debian-bullseye (Install dlib insted php7.4-pdlib
  • https://github.com/matiasdelellis/facerecognition/wiki/PDlib-Installation#install-pdlib
  • https://github.com/matiasdelellis/facerecognition/wiki/Docker

NOTE: Obviously it's not impossible, but it doesn't make sense, since there is no control over dependencies which is essential for a package system to work.

p.s: I'm not an docker fan for services as Nextcloud, so I was never able to document it well, but docker-php-ext-install seems to simplify everything.

matiasdelellis avatar May 16 '22 18:05 matiasdelellis

@guystreeter

[matias@nube docker]$ cat Dockerfile 
FROM nextcloud:apache

RUN apt update \
  && apt install -y wget gnupg2 unzip

# Install dlib
RUN echo "deb https://repo.delellis.com.ar bullseye bullseye" > /etc/apt/sources.list.d/20-pdlib.list \
  && wget -qO - https://repo.delellis.com.ar/repo.gpg.key | apt-key add -
RUN apt update \
  && apt install -y libdlib-dev

# Install pdlib extension
RUN wget https://github.com/goodspb/pdlib/archive/master.zip \
  && mkdir -p /usr/src/php/ext/ \
  && unzip -d /usr/src/php/ext/ master.zip \
  && rm master.zip
RUN docker-php-ext-install pdlib-master

# These last lines are just for testing the extension.. You can delete them.
RUN wget https://github.com/matiasdelellis/pdlib-min-test-suite/archive/master.zip \
  && unzip -d /tmp/ master.zip \
  && rm master.zip
RUN cd /tmp/pdlib-min-test-suite-master \
    && make

😉

matiasdelellis avatar May 16 '22 19:05 matiasdelellis

@matiasdelellis I must say, you're an amazing maintainer!

enoch85 avatar May 16 '22 19:05 enoch85

I am running AlmaLinux. Any chance of a pdlib "dnf installer" for PHP version 8.1 ?

# dnf search pdlib | grep php
Last metadata expiration check: 3:07:51 ago on Thu 29 Dec 2022 01:36:30 PM CET.
php70-php-pdlib.x86_64 : A PHP extension for Dlib
php71-php-pdlib.x86_64 : A PHP extension for Dlib
php72-php-pdlib.x86_64 : A PHP extension for Dlib
php73-php-pdlib.x86_64 : A PHP extension for Dlib
php74-php-pdlib.x86_64 : A PHP extension for Dlib
php80-php-pdlib.x86_64 : A PHP extension for Dlib

mrAceT avatar Dec 29 '22 15:12 mrAceT

echo "deb [arch=amd64] https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list wget -qO- https://repo.delellis.com.ar/repo.gpg.key | sudo tee /etc/apt/trusted.gpg.d/pdlib.asc

Seems the repo is down? I keep getting 404

dibya-ikea avatar Feb 25 '23 10:02 dibya-ikea

@dibya-ikea https://github.com/matiasdelellis/facerecognition/issues/631

enoch85 avatar Feb 25 '23 17:02 enoch85