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

Feat: Tracim/Tracim docker support for non-AMD64 platform with Debian Bullseye #3985

Closed
10 tasks done
inkhey opened this issue Dec 27, 2020 · 10 comments
Closed
10 tasks done
Assignees
Labels
add to changelog fix need to be added in changelog docker Issue related to Docker images feature This issue describes a new feature p3 Low priority technical debt Rework caused by choosing an easy solution or obsolete code over time. Transparent to the user.

Comments

@inkhey
Copy link
Contributor

inkhey commented Dec 27, 2020

Feature description and goals

Currently Tracim and Tracim docker is only working/tested on AMD64 platform.
To make it functional on other plateform some change should be done, as some dependencies doesn't exist on other platform.

All these point are closely related for compatibility, so it make not much sense to split them.

Which Plateforms to support ?

Docker support multiple plateform:
https://github.com/docker-library/official-images#architectures-other-than-amd64

AMD64 is the most common and the default one for intel/amd processor, this architecture is already supported by tracim. It covered almost all server.

ARM is the challenger, there is many version:

Official debian version support armv5 (armel), arm v7(armhf), armv8 (arm64)

  • support for armv5 will target: some plug computers like sheevaplugs.
  • support for armv6 will target: raspberry pi zero, raspberry pi 1 and some other single board computers. Note that raspbian support armv6 but not debian, so the easiest to support them may be to create a armv5 image.
  • support for armv7 will target: raspberry pi 2, 3 and some others single board computers.
  • support for armv8 will target: some servers, raspberry pi 4, modern sbc like helios64, etc…

i386 is the 32bit version on AMD64, all current x86 processor are 64bit(AMD64), it's not very useful to support this one.

Others architectures (ppc64le,s390x,mips64le) are exotics enough to not be really useful to check now.

One other architecture that may be useful to support later is riscv64.

I do suggest to focus on armv8 and (maybe) armv7.

Current issues with arm build:

Prerequisites

These 2 PR should be merged:

Implemented solution:

#5081

  • use new bullseye docker images and new python dependencies that support python 3.6-3.9.
  • create a new docker image based on the non-encrypted docker that remove vtk as dependencies.
  • improve the setup_default_backend.sh for minimal dependencies case.
  • add documentation about building arm64 docker image.

deprecated ticket informations:

New Working Proof of Concept (04/07/2021) 🎉:

After the merge of https://github.com/tracim/tracim/issues/4751. I do success to generate a "minimal" tracim image for arm64 (didn't try 32 bit arm build). I did also a rebase the code of #4785.

source code is here: https://github.com/tracim/tracim/tree/POC/ARM_docker
container build for both arm64 and amd64 are available here (for now): https://github.com/inkhey/tracim/pkgs/container/tracim (old version !)

What's work:

  • building arm64 and amd64 image with minimal dependencies (mostly removing preview builder stuff).
  • building amd64 with full dependencies.
  • running this image on real hardware including:
    • Fonctionnal frontend.
    • Fonctionnal API.
    • Fonctionnal preview for png/jpeg/gif.
    • TLM with pushpin.🎉
  • New feature due to bulleyes: out of the box HEIC file preview support.
  • New feature if we use the latest colalbora version: csv file support , see also Feat: Tracim/Tracim docker support for non-AMD64 platform with Debian Bullseye #3985 (comment)
    note:
  • for the amd64, the image was tested with docker (debian sid and ubuntu 18.04) without reverse-proxy.
  • for the arm64, the image was tested on a Helios64 (on debian buster) with podman in rootless mode with nginx as reverse proxy + https, http/2 support (*)

What is not included/tested:

  • docker test. Tested.
  • support for encryption with gocryptfs Tested on amd64
  • building with full preview-generator dependencies (should work for amd64 only as vtk and probably others are not build for arm64). Tested on amd64. should find a solution for arm64
  • webdav. partially tested.
  • collabora. partially tested. tested on amd64 only with docker test process.
  • non-sqlite database
  • s3 storage
  • tracimcli
  • caldav. partially tested: only checked caldavzap.
  • probably other complex features.
  • running backend test on debian bulleyes.

What doesn't work for now :

What has changed:

  • code from develop branch with unfinished features ⚠️ .
  • Most python dependencies are updated to last version due to Feat/4784 update dependencies #4785 . Some package like lxml get binary package for arm64 only in last release. It's was easier to update most things than trying to make thing work.
  • Docker image use Bullseye (future stable !) which use python 3.9. To get latest python binary package available for arm64 and to get pushpin > 0.31 (there is no official repository for arm64, so we need to use debian package).
  • Dockerfile was heavily modified:
    • optional options to disable installation of packages + debug mode.
    • apt package list outside of dockerfile
    • option to install tracim from local dir install/compressed archive.
    • remove the old docker to keep only one.
    • fix pushpin support with this new package (override default config).
    • split front and backend build as frontend build
    • use buildx by default in documentation of docker build
    • some cleanup in each stage of the build.
    • document how to build arm64 and amd64 minimal build using buildx and qemu.
    • use node 12 with node 12 build docker: no need to download node/npm/yarn.

TODO:

Deprecated previous poc comment:

I just tried a POC here:
(https://github.com/tracim/tracim/tree/poc/ARM_build
but failed to success now as there are some complex issue related to dependencies version of requirements.txt that cannot be solved properly on other platform. As this file is handled by pip-tools and there is currently not preview-generator with optional dependency support, it's complicated to properly fix dependencies issues. Fixing preview-generator optional dependencies support and create and official release with it will make finding the good dependencies version to support arm much easier.

Another point which may help too, is upgrading docker from stretch to buster.

To test this poc, check the documentation:
https://github.com/tracim/tracim/blob/593f74c1e5100495b6e0dd23a4771f5d2bcd7735/tools_docker/README.md#arm-build-experimental)

@inkhey inkhey added docker Issue related to Docker images to sort need first level analyse and release association low priority Issue that should not be handled right now - label to be discussed labels Dec 27, 2020
@inkhey
Copy link
Contributor Author

inkhey commented Dec 27, 2020

This is related to previous issue related to arm support:
#1458
#3727
#3729

@raphj raphj added the feature This issue describes a new feature label Jan 13, 2021
@inkhey
Copy link
Contributor Author

inkhey commented Jul 4, 2021

I updated the issue with my new working arm64 build ! 🎉

PS: here a working config for using nginx as reverse-proxy (ssl is defined somewhere else), the proxy buffering is disabled for making tlm to work as expected.

upstream tracim_local_apache{
    server 127.0.0.1:8080;
}
server {
  listen 443 http2 ssl;
  listen [::]:443 http2 ssl;
  server_name tracim.domainname;
  include common.conf;
  location / {
    client_max_body_size 300M;
    include proxy_params;
    proxy_pass http://tracim_local_apache;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_buffering off;
  }
}

@inkhey
Copy link
Contributor Author

inkhey commented Jul 20, 2021

Side notes when trying to generate a full dependency docker using docker code for manual testing #4785 ):

  • RAW file preview is fully broken due to the fact that ufraw-batch is removed from latest debian (unmaintained library). The good way to solve this could be either building imagemagick with libraw support or add a darktable builder. i do suggest to go to the darktable road as the cli is easy to use and there is no need for recompilation. Note: this also avoid creating big png, if we do use for direct preview (without intermediate png to jpeg builder). Feat: Better Raw preview builder with Darktable-cli or rawpy ? algoo/preview-generator#249. Another potential advantage of doing so, is better preview generation perf for raw files.
  • using slim image of bulleyes broke libreoffice install due to issue with doc files during jre install.
  • i have fixed few minors issue testing this.

@inkhey inkhey added this to Issue to review in Tracim V4.0.0 Jul 21, 2021
@inkhey
Copy link
Contributor Author

inkhey commented Jul 21, 2021

Other side notes:

  • HEIC preview work out of the box !!
  • SVG preview using inkscape fail (command line has changed ?)

@inkhey
Copy link
Contributor Author

inkhey commented Jul 21, 2021

Others side notes:

  • Collabora work with latest collabora version. It work for csv too but ui is not perfect (the ui propose to convert to odt but it doesn't work).
  • caldav work (from web ui)
  • Webdav is working
  • encryption work (amd64 full version)

@inkhey inkhey changed the title Feat: Tracim/Tracim docker support for non-AMD64 platform Feat: Tracim/Tracim docker support for non-AMD64 platform with bulleyes Jul 23, 2021
@inkhey inkhey added technical debt Rework caused by choosing an easy solution or obsolete code over time. Transparent to the user. and removed low priority Issue that should not be handled right now - label to be discussed to sort need first level analyse and release association labels Jul 23, 2021
@raphj raphj changed the title Feat: Tracim/Tracim docker support for non-AMD64 platform with bulleyes Feat: Tracim/Tracim docker support for non-AMD64 platform with Debian Bullseye Jul 23, 2021
@gbonaspetti gbonaspetti removed this from Issue to review in Tracim V4.0.0 Jul 28, 2021
@gbonaspetti gbonaspetti added the to sort need first level analyse and release association label Jul 28, 2021
@inkhey inkhey added this to Issue to review in Tracim V4.0.0 via automation Sep 28, 2021
@grignards grignards added the p2 Medium priority label Oct 4, 2021
@gbonaspetti gbonaspetti removed the to sort need first level analyse and release association label Oct 4, 2021
@agile-marmot agile-marmot added p3 Low priority and removed p2 Medium priority labels Oct 8, 2021
@agile-marmot agile-marmot moved this from Issue to review to To do in Tracim V4.0.0 Oct 20, 2021
@grignards
Copy link
Collaborator

With the changes from #4874 a build for arm64 stops as the python package vtk==9.0.2 is not available.

@inkhey
Copy link
Contributor Author

inkhey commented Oct 20, 2021

With change from #4874, the change required to handle arm64 look like:

  • find some way to make some PG dependencies optional like VTK which is not builded for linux_arm64.
  • clarify how to deal with the encryption feature, it has been known to not work on arm64 (make only one of the image compatible, create another image, other ?)
  • reintroduce documentation about how to build arm64 image.

@grignards
Copy link
Collaborator

My opinion on your points:

  • setup_default_backend.sh should get an argument to only install minimal dependencies
  • discuss with @PhilippeAccorsi which of a dedicated Dockerfile or an option to the current one is preferred (the option only impacts one line of the Dockerfile)
  • ok for the documentation, don't forget to add the link to the official documentation for installing buildx.

@agile-marmot agile-marmot removed this from To do in Tracim V4.0.0 Nov 2, 2021
@agile-marmot agile-marmot added this to Issue to review in Tracim v4.1.0 via automation Nov 2, 2021
@inkhey inkhey mentioned this issue Nov 8, 2021
9 tasks
@inkhey
Copy link
Contributor Author

inkhey commented Nov 8, 2021

I can confirm that removing vtk is enough to make arm64 docker image work.

@inkhey inkhey moved this from Issue to review to to/under review in Tracim v4.1.0 Nov 17, 2021
@inkhey inkhey moved this from to/under review to To close in Tracim v4.1.0 Nov 25, 2021
@knodelle knodelle added the add to changelog fix need to be added in changelog label Jan 19, 2022
@knodelle knodelle moved this from To close to Done in Tracim v4.1.0 Jan 19, 2022
@gbonaspetti
Copy link
Contributor

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog fix need to be added in changelog docker Issue related to Docker images feature This issue describes a new feature p3 Low priority technical debt Rework caused by choosing an easy solution or obsolete code over time. Transparent to the user.
Projects
No open projects
Development

No branches or pull requests

6 participants