How to install PhotoPrism in Jail?

pinsyd

Cadet
Joined
Apr 12, 2021
Messages
4
Ok, I got this to run but like many others, it took a bit of fiddling so I'd like to share my lessons learned. Maybe I've had a few more steps for running in a VM but here goes.

================
TL:DR;
================
Code:
iocage create -n "photoprism" -r 12.2-RELEASE vnet="on" allow_raw_sockets="1" dhcp="on" bpf="yes" boot="on"
#if you get a DHCP failure, open the jail in the GIU and do the following
#1. NAT=Enabled
#2. Port forward 2342 to 2342 (UDP and TCP)
#3. Start jail from GUI
iocage console photoprism
pkg install git
pkg install npm
pkg install ca_root_nss
pkg install wget
pkg install sudo
svnlite co https://svn.freebsd.org/ports/head /usr/ports
cd /usr/ports; svnlite update
cd ~
git clone https://github.com/huo-ju/photoprism-freebsd-port
cd photoprism-freebsd-port
pkg install `make all-depends-list | cut -d / -f 4,5`
# accept all defaults, either "Y" or enter
find . | grep docker | grep third_party/repo.bzl$
# implement this workaround on the above file https://github.com/tensorflow/tensorflow/issues/31196#issue-475147706
make config-recursive && make install
#Enter a lot of times to accept defaults (critical that only defaults are accepted)
#Tensorflow compiling is heavy on CPU for a long time

# if you get "pkg-static: Unable to access file /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore:No such file or directory" run the following with the "# ", accept defaults
# touch /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore
# make install


# Stop the PhotoPrism service
service photoprism stop

# Change the directory references to photoprism within /etc/rc.conf (use vi or install nano) to:
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"

mkdir /var/db/photoprism/storage
chmod 755 /var/db/photoprism/storage
chown photoprism /var/db/photoprism/storage/

# Now reset all the directories and initial password:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd

#Start the PhotoPrism service
service photoprism start


=================
Longer story, sorry kiddies
=================


Hardware: My 10GB RAM for my 9TB zpool was not enough for this to install. Several times during install the 4GB swap was exhausted. I bumped up to 14GB then finally to 24GB to get tensorflow to compile. I will also note that I had 10 CPU allocated with always 10 actions running and perhaps if I have had 5 CPU, then half the things would be compiling so maybe half the ram would be needed (theory, not tested)???

1. This in fact appears to have done nothing for me. git/npn/sudo were missing in the jail.

echo '{"pkgs":["git","ca_root_nss","wget","npm","sudo"]}' > /tmp/pkg.json


Running all of this after spin up required (after lesson #2 below).
Code:
pkg install git
pkg install npm
pkg install ca_root_nss
pkg install wget
pkg install sudo



2. After running this, the jail created properly but wouldn't start due to no DHCP. I had to edit the Jail in the GUI to "NAT=enable" and port forward 2342. This is just because of how my LAN/system/network is setup.

iocage create -n "photoprism" -p /tmp/pkg.json -r 12.2-RELEASE vnet="on" allow_raw_sockets="1" dhcp="on" bpf="yes" boot="on"


3. As Patrick M. Hausen said this work around needs to be done. Maybe there are those who don't know what to do. So after this step:

pkg install `make all-depends-list | cut -d / -f 4,5`


Code:
cd /root/photoprism-freebsd-port/
find . | grep docker | grep third_party/repo.bzl$


Then about half way down change the file from the above command output to look like this using your favourite editor.


Code:
# Apply a patch_file to the repository root directory
# Runs 'git apply' on Unix, 'patch -p1' on Windows.
def _apply_patch(ctx, patch_file):
    #if _is_windows(ctx):
    #    patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
    #else:
    #    patch_command = ["git", "apply", "-v", ctx.path(patch_file)]
    #cmd = _wrap_bash_cmd(ctx, patch_command)
    if not _is_windows(ctx) and not ctx.which("patch"):
        fail("patch command is not found, please install it")
    cmd = _wrap_bash_cmd(
        ctx,
        ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)],
    )
    _execute_and_check_ret_code(ctx, cmd)

def _apply_delete(ctx, paths):



4. I got the following error, but for whatever reason it stopped the compile.

===> Registering installation for photoprism-g20210222
pkg-static: Unable to access file /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore:No such file or directory
*** Error code 1

Stop.
make[1]: stopped in /root/photoprism-freebsd-port
*** Error code 1

Stop.
make: stopped in /root/photoprism-freebsd-port


Just running the following fixed it.

Code:
touch /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore
make install



5. Then I had to run the steps above that had ericm14 posted. But I had to run a few more steps.


Code:
mkdir /var/db/photoprism/storage
chmod 755 /var/db/photoprism/storage
chown photoprism /var/db/photoprism/storage/
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

SkimxCAT

Cadet
Joined
Apr 12, 2021
Messages
2
Ok, I got this to run but like many others, it took a bit of fiddling so I'd like to share my lessons learned. Maybe I've had a few more steps for running in a VM but here goes.

================
TL:DR;
================
Code:
iocage create -n "photoprism" -r 12.2-RELEASE vnet="on" allow_raw_sockets="1" dhcp="on" bpf="yes" boot="on"
#if you get a DHCP failure, open the jail in the GIU and do the following
#1. NAT=Enabled
#2. Port forward 2342 to 2342 (UDP and TCP)
#3. Start jail from GUI
iocage console photoprism
pkg install git
pkg install npm
pkg install ca_root_nss
pkg install wget
pkg install sudo
svnlite co https://svn.freebsd.org/ports/head /usr/ports
cd /usr/ports; svnlite update
cd ~
git clone https://github.com/huo-ju/photoprism-freebsd-port
cd photoprism-freebsd-port
pkg install `make all-depends-list | cut -d / -f 4,5`
# accept all defaults, either "Y" or enter
find . | grep docker | grep third_party/repo.bzl$
# implement this workaround on the above file https://github.com/tensorflow/tensorflow/issues/31196#issue-475147706
make config-recursive && make install
#Enter a lot of times to accept defaults (critical that only defaults are accepted)
#Tensorflow compiling is heavy on CPU for a long time

# if you get "pkg-static: Unable to access file /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore:No such file or directory" run the following with the "# ", accept defaults
# touch /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore
# make install


# Stop the PhotoPrism service
service photoprism stop

# Change the directory references to photoprism within /etc/rc.conf (use vi or install nano) to:
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"

mkdir /var/db/photoprism/storage
chmod 755 /var/db/photoprism/storage
chown photoprism /var/db/photoprism/storage/

# Now reset all the directories and initial password:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd

#Start the PhotoPrism service
service photoprism start


=================
Longer story, sorry kiddies
=================


Hardware: My 10GB RAM for my 9TB zpool was not enough for this to install. Several times during install the 4GB swap was exhausted. I bumped up to 14GB then finally to 24GB to get tensorflow to compile. I will also note that I had 10 CPU allocated with always 10 actions running and perhaps if I have had 5 CPU, then half the things would be compiling so maybe half the ram would be needed (theory, not tested)???

1. This in fact appears to have done nothing for me. git/npn/sudo were missing in the jail.




Running all of this after spin up required (after lesson #2 below).
Code:
pkg install git
pkg install npm
pkg install ca_root_nss
pkg install wget
pkg install sudo



2. After running this, the jail created properly but wouldn't start due to no DHCP. I had to edit the Jail in the GUI to "NAT=enable" and port forward 2342. This is just because of how my LAN/system/network is setup.




3. As Patrick M. Hausen said this work around needs to be done. Maybe there are those who don't know what to do. So after this step:




Code:
cd /root/photoprism-freebsd-port/
find . | grep docker | grep third_party/repo.bzl$


Then about half way down change the file from the above command output to look like this using your favourite editor.


Code:
# Apply a patch_file to the repository root directory
# Runs 'git apply' on Unix, 'patch -p1' on Windows.
def _apply_patch(ctx, patch_file):
    #if _is_windows(ctx):
    #    patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
    #else:
    #    patch_command = ["git", "apply", "-v", ctx.path(patch_file)]
    #cmd = _wrap_bash_cmd(ctx, patch_command)
    if not _is_windows(ctx) and not ctx.which("patch"):
        fail("patch command is not found, please install it")
    cmd = _wrap_bash_cmd(
        ctx,
        ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)],
    )
    _execute_and_check_ret_code(ctx, cmd)

def _apply_delete(ctx, paths):



4. I got the following error, but for whatever reason it stopped the compile.




Just running the following fixed it.

Code:
touch /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore
make install



5. Then I had to run the steps above that had ericm14 posted. But I had to run a few more steps.


Code:
mkdir /var/db/photoprism/storage
chmod 755 /var/db/photoprism/storage
chown photoprism /var/db/photoprism/storage/

Thank you for the summary!
One addtional piece of information: yes, by reducing number of simultaneous jobs - you can build tensor flow on machine with less RAM (in my case 16Gb where 7 were occupied). I made this change:
Code:
diff --git a/Makefile b/Makefile
index 2dd98c6..df4a16a 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ post-extract:

pre-build:
@${REINPLACE_CMD} -e 's|0\.26\.1|0\.29\.0|g' ${WRKSRC}/docker/tensorflow/tensorflow-$(TF_VERSION)/configure.py
- cd ${WRKSRC}/docker/tensorflow/tensorflow-${TF_VERSION} && ./configure && bazel --output_user_root="${WRKDIR}/.bazel" build --config=opt //tensorflow:libtensorflow.so ${BAZEL_COPT} && ./create_archive.sh freebsd-cpu ${TF_VERSION}
+ cd ${WRKSRC}/docker/tensorflow/tensorflow-${TF_VERSION} && ./configure && bazel --output_user_root="${WRKDIR}/.bazel" build --jobs 2 --config=opt //tensorflow:libtensorflow.so ${BAZEL_COPT} && ./create_archive.sh freebsd-cpu ${TF_VERSION}
@${REINPLACE_CMD} -e 's| go build -v ./...| CGO_CFLAGS="-I${WRKSRC}/docker/tensorflow/tensorflow-$(TF_VERSION)/tmp/include" CGO_LDFLAGS="-L${WRKSRC}/docker/tensorflow/tensorflow-$(TF_VERSION)/tmp/lib" go build -v ./cmd/... ./i
nternal/... ./pkg/...|g' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's| scripts/build.sh debug| CGO_CFLAGS="-I${WRKSRC}/docker/tensorflow/tensorflow-$(TF_VERSION)/tmp/include" CGO_LDFLAGS="-L${WRKSRC}/docker/tensorflow/tensorflow-$(TF_VERSION)/tmp/lib" scripts/build.sh debug|g'
${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's|PHOTOPRISM_VERSION=.*|PHOTOPRISM_VERSION=${GH_TAGNAME}|' ${WRKSRC}/scripts/build.sh


So I've managed to build and run photoprism, but I can not access it:
Code:
[root@photoprismJail ~/photoprism-freebsd-port]# curl http://localhost:2342/
curl: (7) Failed to connect to localhost port 2342: Connection refused
[root@photoprismJail ~/photoprism-freebsd-port]# photoprism status
ERRO[2021-04-13T01:41:18+03:00] can't connect to 0.0.0.0:2342                
[root@photoprismJail ~/photoprism-freebsd-port]# service photoprism status
photoprism is running as pid 63769.
[root@photoprismJail ~/photoprism-freebsd-port]# photoprism config
NAME VALUE
debug false
public false
read-only false
experimental false
config-file /root/photoprism-freebsd-port/.photoprism/storage/config/options.yml
config-path /root/photoprism-freebsd-port/.photoprism/storage/config
settings-file /root/photoprism-freebsd-port/.photoprism/storage/config/settings.yml
originals-path
originals-limit 1048576000
import-path
storage-path /root/photoprism-freebsd-port/.photoprism/storage
sidecar-path /root/photoprism-freebsd-port/.photoprism/storage/sidecar
albums-path /root/photoprism-freebsd-port/.photoprism/storage/albums
cache-path /root/photoprism-freebsd-port/.photoprism/storage/cache
temp-path /tmp/photoprism
backup-path /root/photoprism-freebsd-port/.photoprism/storage/backup
assets-path
static-path static
build-path static/build
img-path static/img
templates-path templates
workers 3
wakeup-interval 900
auto-index 300
auto-import 180
disable-backups false
disable-settings false
disable-places false
disable-exiftool true
disable-tensorflow false
tensorflow-version 1.15.2
tensorflow-model-path nasnet
detect-nsfw false
upload-nsfw false
site-url http://localhost:2342/
site-preview http://localhost:2342/static/img/preview.jpg
site-title PhotoPrism
site-caption Browse Your Life
site-description
site-author
log-level info
log-filename /root/photoprism-freebsd-port/.photoprism/storage/photoprism.log
pid-filename /root/photoprism-freebsd-port/.photoprism/storage/photoprism.pid
http-host 0.0.0.0
http-port 2342
http-mode release
admin-password
database-driver sqlite3
database-server localhost
database-host localhost
database-port 3306
database-name photoprism
database-user photoprism
database-password
database-conns 40
database-conns-idle 20
rawtherapee-bin
darktable-bin
darktable-presets false
sips-bin
heifconvert-bin
ffmpeg-bin /usr/local/bin/ffmpeg
ffmpeg-encoder libx264
ffmpeg-bitrate 50
ffmpeg-buffers 32
exiftool-bin
download-token 3tm5s777
preview-token d8c1cf93
thumb-filter lanczos
thumb-uncached false
thumb-size 2048
thumb-size-uncached 7680
thumb-path /root/photoprism-freebsd-port/.photoprism/storage/cache/thumbnails
jpeg-size 7680
jpeg-quality 92


Any help?
 

pinsyd

Cadet
Joined
Apr 12, 2021
Messages
4
Did this return an error?
Code:
service photoprism start


I get this, have a check in messages too. (Looks like restart doesn't wait enough for the kill before starting)
Code:
root@photoprism:/ # service photoprism status
photoprism is running as pid 37632.
root@photoprism:/ # service photoprism restart
Stopping photoprism.
Waiting for PIDS: 37632.
Starting photoprism.
daemon: process already running, pid: 37632
/usr/local/etc/rc.d/photoprism: WARNING: failed to start photoprism
root@photoprism:/ # service photoprism start
Starting photoprism.
root@photoprism:/ # service photoprism status
photoprism is running as pid 75350.
root@photoprism:/ # tail /var/log/messages
Apr 13 20:10:11 photoprism photoprism[37631]: time="2021-04-13T20:10:11+10:00" level=info msg="shutting down..."
Apr 13 20:10:11 photoprism photoprism[37631]: time="2021-04-13T20:10:11+10:00" level=info msg="shutting down workers"
Apr 13 20:10:11 photoprism photoprism[37631]: time="2021-04-13T20:10:11+10:00" level=info msg="closed database connection"
Apr 13 20:10:11 photoprism photoprism[37631]: time="2021-04-13T20:10:11+10:00" level=info msg="http: shutting down web server"
Apr 13 20:10:11 photoprism photoprism[37631]: time="2021-04-13T20:10:11+10:00" level=info msg="http: web server shutdown complete"
Apr 13 20:10:14 photoprism root[75341]: /usr/local/etc/rc.d/photoprism: WARNING: failed to start photoprism
Apr 13 20:10:27 photoprism photoprism[75349]: time="2021-04-13T20:10:27+10:00" level=info msg="webdav: /originals/ enabled, waiting for requests"
Apr 13 20:10:27 photoprism photoprism[75349]: time="2021-04-13T20:10:27+10:00" level=info msg="webdav: /import/ enabled, waiting for requests"
Apr 13 20:10:27 photoprism photoprism[75349]: time="2021-04-13T20:10:27+10:00" level=info msg="http: starting web server at 0.0.0.0:2342"




================================================


Side note: Do you see these files or directories listed in your config?

config-file /root/photoprism-freebsd-port/.photoprism/storage/config/options.yml
config-path /root/photoprism-freebsd-port/.photoprism/storage/config
settings-file /root/photoprism-freebsd-port/.photoprism/storage/config/settings.yml


Because I don't see yours, but then I can't see whats in my config either. (curious how ours are different)

config-file /root/.photoprism/storage/config/options.yml
config-path /root/.photoprism/storage/config
settings-file /root/.photoprism/storage/config/settings.yml

But I found it here, but it's all up and running somehow.

root@photoprism:/ # find / | grep settings.yml
/var/db/photoprism/storage/config/settings.yml

Obviously set during but not sure how to update these configs just yet.

Code:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd
 

SkimxCAT

Cadet
Joined
Apr 12, 2021
Messages
2
My issue was due to disabled raw sockets (I've created jail using UI). After enabling it works fine.
As you mentioned - I don't understand where photoprism takes config. (All path are empty in my case. Only settings.yaml exists) I've tried to change originals and import path using this call
Code:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/library --import-path=/var/db/photoprism/import passwd

But it did take effect (i've tried even on clean setup). So I used some magic with symlinks, but still want to understand. What is going on.

By the way - it took 2 days to go over my photo collection :)
1618786641050.png

Right now, working on auto uploading photos from my phone using nextCloud (Plan B is to use SeafileApp) and auto rescan in photoprism.
 

pinsyd

Cadet
Joined
Apr 12, 2021
Messages
4
Outstanding, a win is a win. Photoprism is as natural on Truenas as is Nextcloud, I hope this becomes a plugin someday.

BTW, a few typos in my original. Fixed here. I'm a bit shy in my git knowledge so I haven't included SkimxCATs more elegant work around.

Code:
iocage create -n "photoprism" -r 12.2-RELEASE vnet="on" allow_raw_sockets="1" dhcp="on" bpf="yes" boot="on"
#if you get a DHCP failure, open the jail in the GIU and do the following
#1. NAT=Enabled
#2. Port forward 2342 to 2342 (UDP and TCP)
#3. Start jail from GUI
iocage console photoprism
pkg install git npm ca_root_nss wget sudo
svnlite co https://svn.freebsd.org/ports/head /usr/ports
cd /usr/ports; svnlite update
cd ~
git clone https://github.com/huo-ju/photoprism-freebsd-port
cd photoprism-freebsd-port
pkg install `make all-depends-list | cut -d / -f 4,5`
# accept all defaults, either "Y" or enter

# Once the install fails complaining about ld issues find this file
find . | grep docker | grep third_party/repo.bzl$
# edit this file above with your favourite editor as per  https://github.com/tensorflow/tensorflow/issues/31196#issue-475147706

make config-recursive && make install
#Enter a lot of times to accept defaults (critical that only defaults are accepted)
#Tensorflow compiling is heavy on CPU for a long time

# if you get "pkg-static: Unable to access file /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore:No such file or directory" run the following without the "# "
# touch /root/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/static/build/.gitignore
# make install


# Stop the PhotoPrism service
service photoprism stop

# Change the directory references to photoprism within /etc/rc.conf (use vi or install nano) to:
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"

mkdir /var/db/photoprism/storage
chmod 755 /var/db/photoprism/storage
chown photoprism /var/db/photoprism/storage/

# Now reset all the directories and initial password:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd

#Start the PhotoPrism service
service photoprism enable
service photoprism start

#if service starts but you are unable to http to it, then try disabling raw sockets in the jail and restart via the gui


 

pinsyd

Cadet
Joined
Apr 12, 2021
Messages
4
Anyone else have this?

Code:
root@photoprism:~ # photoprism config
......................
site-url                  http://localhost:2342/
site-preview              http://localhost:2342/static/img/preview.jpg
...................... 


I'm trying to change the default URL (for when you share an album) from "http://localhost:2342/..." to "https://sub.domain.com/..." with this command below I just get the help page.

Code:
root@photoprism:~ # sudo -u photoprism /usr/local/bin/photoprism --site-url="https://sub.domain.com" 


Further to the above not doing anything helpful, I have doubts this below does anything other than change the admin password. If you leave off the passwd command, it just dumps the help page without any clues as to what it doesn't like, and I don't see any clues one way or the other in any logs.

Code:
# Now reset all the directories and initial password:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd
 

madfenris

Cadet
Joined
Nov 12, 2018
Messages
1
Anyone else have this?

Code:
root@photoprism:~ # photoprism config
......................
site-url                  http://localhost:2342/
site-preview              http://localhost:2342/static/img/preview.jpg
...................... 


I'm trying to change the default URL (for when you share an album) from "http://localhost:2342/..." to "https://sub.domain.com/..." with this command below I just get the help page.
Code:
root@photoprism:~ # sudo -u photoprism /usr/local/bin/photoprism --site-url="https://sub.domain.com" 

I am still new to this but I suspect using the photoprism_args option would be one option for what you need to make other non-static changes. (It is listed as flags in the comments, but the call uses args) :
Code:
root@photoprism:~ # sysrc photoprism_args="--workers=3" 


another option would be using environmental variables:
Code:
root@photoprism:~ # setenv PHOTOPRISM_WORKERS 3" 


You will still need to stop and restart the service in any case.

Further to the above not doing anything helpful, I have doubts this below does anything other than change the admin password. If you leave off the passwd command, it just dumps the help page without any clues as to what it doesn't like, and I don't see any clues one way or the other in any logs.

Code:
# Now reset all the directories and initial password:
sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd

I am inclined to agree in that I believe the config is not getting data from the running service but an instance fed off environmental defaults, set environmental settings and any included command line settings. I did notice it used any environmental variables and command line options I had set.
Also considering this it does make sense that running the program without any command and only options would not do anything and return the help options.

As a side note, thank you to all who have been helping getting this working, it was a great find.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Can an experienced user create a port? It will make the things much easier for everyone. I saw this installer also, I asked the developer if he could look into making a port.
It would be cheaper and faster to make sure your system has enough RAM for a VM and run the docker container in that.

In future, TrueNAS SCALE would be able to support the docker container in a RELEASE quality version.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
It would be cheaper and faster to make sure your system has enough RAM for a VM and run the docker container in that.

In future, TrueNAS SCALE would be able to support the docker container in a RELEASE quality version.
I hear you for but for now until SCALE is adopted by a majority of users, I'm sticking with CORE. Yes a VM will work (I have 192GB of RAM on a 8TB 12disks tank) but if we can have an official package to use inside a jail it would be a very elegant solution IMO.

@Patrick M. Hausen, could someone else submit that port to Bugzilla or it has to be the actual author? I'm used to build Linux RPM packages, I don't know much about ports. I mean someone else can always fork the port if the author is not active, so we get this rolling. @FrankNAS?

That port should be split in two, one for libtensorflow library and one for photoprism. See issue discussion.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The process to build an official port isn't appreciably different from the process to build the code on github--not only would making it an official port not make it "much easier," it wouldn't make it significantly easier at all. Perhaps you're misunderstanding what a port is?

could someone else submit that port to Bugzilla
I'd imagine so, if that "someone else" would commit to maintaining it.
 

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
Perhaps you're misunderstanding what a port is?
I see the port as a different method of building an Linux RPM, which I've been building for over 10 years. It will produce packages instead of rpms. Then packages and their deps (in our case libtensorflow, madiadb etc.) can be easily installed in FreeBSD:
# pkg install photoprism VS # yum install photoprism
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The process to build an official port isn't appreciably different from the process to build the code on github--not only would making it an official port not make it "much easier," it wouldn't make it significantly easier at all. Perhaps you're misunderstanding what a port is?
I disagree, ambassador :wink:

Assuming that the port on github works, having it in the FreeBSD ports repo would eventually lead to a package being available, so users could install the software with a simple pkg install photoprism including pulling all dependencies etc.

I'd imagine so, if that "someone else" would commit to maintaining it.
Right. That's why I am not going to submit it unless I decide for myself that photoprism is the software I want to run for my photo library. I am actually looking for solutions. I just have one very specific requirement that i would want to see fulfilled to pick a winner.

But, @TECK, a port really is just a collection of files, most important a Makefile, telling how a certain piece of software can be built on FreeBSD. The github repo does contain a complete FreeBSD port. Whether it works or not, I did not check.
The difference to an official FreeBSD port is: an official port is part of the FreeBSD ports repo, and it has got an official maintainer who is responsible to keep it working on FreeBSD and up-to-date (which can be stretched somewhat) with upstream versions.
The FreeBSD ports collection is some tens of thousands of directories exactly like that one on github. Only as part of the FreeBSD project.

Kind regards,
Patrick
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I see the port as a different method of building an Linux RPM, which I've been building for over 10 years. It will produce packages instead of rpms.
Spot on. Ports are the framework to build packages. Every port that does not have technical or legal reasons against it, is automatically build as a binary package and available for FreeBSD users to install via pkg add. Automatically and reliably are the key features here, contrary to e.g. Debian packages which still seem to be a black art to build (but maybe I just missed recent developments).

With this two-step approach organisations who want to tweak ports for some reason (different modules, options, ...) can easily build their own binary package repository by using a tool called "poudriere" - a bulk package builder. We do that for our hosting environment.
You could e.g. build pecl-imagick with HEIC support - something that the standard FreeBSD package doesn't.

"Infrastructure, not product", is the FreeBSD mantra. So instead of just packages you get the entire toolset to build your own.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
having it in the FreeBSD ports repo would eventually lead to a package being available
Would it? There's a whole lot of software has ports but no packages. But I'll admit I've never dug into the reasons very much.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
But I'll admit I've never dug into the reasons very much.
Either technical - e.g. does not build on specific architectures. But this is rather rare.
Or legal - the license requires that the user interactively downloads a particular file while agreeing to "terms and conditions" and all that. Or the license specifically forbids binary redistribution.

The default is that a package is built.

I just checked out a current ports tree. There are roughly 30.000 ports directories, not counting flavours. Of these 2.400 have NO_BUILD set, which means there is no package.

E.g. with a specific project of yours you can easily install Nextcloud and all dependencies with just pkg add from the FreeBSD package repo.

So, if this photoprism thing is true open source, there would be a package.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The py-tensorflow port is marked as "BROKEN" - that seems to be the major impediment to making photoprism a first class citizen at the moment.
 
Top