Commit graph

102 commits

Author SHA1 Message Date
deeplow
356f835d32
env.py: make env run in GUI mode (--no-gui otherwise)
Now that we have GUI tests, it makes more sense to have running with
the X11 socket mounted in the environment than not.
2023-08-05 17:02:26 +01:00
Alex Pyrgiotis
c541227dd3
Drop Ubuntu 22.10 (Kinetic Kudu) support
Drop support for Ubuntu 22.10 (Kinetic Kudu), because it's past its EOL
date [1].

Closes #485

[1]: https://endoflife.date/ubuntu
2023-07-28 10:40:04 +03:00
Alex Pyrgiotis
26cf3db4b4
Install Qt6 in CI runners and dev environments
Upgrade from Qt5 to Qt6 in our CI runners and dev environments, since
the latest PySide6 versions do not support Qt5. This leaves only our
Debian / Fedora packages relying on Qt5, since there's no PySide6
package for them yet.

There are some caveats to the Qt6 upgrade:

1. Debian Bullseye has a missing dependency to `libgl1`, so we need to
   install it separately.
2. Ubuntu Jammy has a missing dependency to `libxkbcommon-x11-0`, which
   we have to install separately.
3. Ubuntu Focal does not have Qt6, but surprisingly PySide6 works with
   Qt5.
4. All Debian-based distros require `libxcb-cursor0`.

As a side effect, we have to make our `env.py` a bit more complicated,
to cater to these exceptions.

Refs #482
2023-07-25 14:53:17 +03:00
Alex Pyrgiotis
a1e3cb27a7
ci: Pass X11 socket to tests
Pass the X11 socket of the Linux CI runners to the container where our
CI tests run, with the `-g` flag of `dev_scripts/env.py`. By having a
working X11 socket, we can run GUI tests. Prior to this fix, we would
encounter this error:

    tests/gui/test_main_window.py::test_change_document_button qt.qpa.xcb: could not connect to display
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

    Available platform plugins are: xcb, offscreen, wayland-egl, wayland, eglfs, vnc, minimalegl, vkkhrdisplay, linuxfb, minimal.

Another alternative we considered was to use the
`QT_QPA_PLATFORM=offscreen` environment variable. This alternative
works, but it's less close to the end-user's environment, so we decided
in favor of the approach above.
2023-07-24 14:22:26 +03:00
deeplow
e989069712
Add ubuntu 23.04 (lunar) support
The Ubuntu 23.04 docker image includes a user by default (ubuntu) which
overtakes the 1000 uid and so our user becomes 1001 which makes the user
directory unwritable. The solution as suggested in [1] was to remove
that user.

[1]: https://bugs.launchpad.net/cloud-images/+bug/2005129

Fixes #452
2023-06-28 11:07:59 +01:00
deeplow
e773add68e
Adds support for Debian Trixie (13)
Fixes #452
2023-06-28 11:05:47 +01:00
deeplow
814d533c3b
Restructure container code
The files in `container/` no longer make sense to have that name since
the "document to pixels" part will run in Qubes OS in its own virtual
machine.

To adapt to this, this PR does the following:
- Moves all the files in `container` to `dangerzone/conversion`
- Splits the old `container/dangerzone.py` into its two components
  `dangerzone/conversion/{doc_to_pixels,pixels_to_pdf}.py` with a
  `common.py` file for shared functions
- Moves the Dockerfile to the project root and adapts it to the new
  container code location
- Updates the CircleCI config to properly cache Docker images.
- Updates our install scripts to properly build Docker images.
- Adds the new conversion module to the container image, so that it can
  be imported as a package.
- Adapts the container isolation provider to use the new way of calling
  the code.

NOTE: We have made zero changes to the conversion code in this commit,
except for necessary imports in order to factor out some common parts.
Any changes necessary for Qubes integration follow in the subsequent
commits.
2023-06-21 11:44:47 +03:00
Alex Pyrgiotis
14063349bb
ci: Fix transient errors in Debian Bullseye
Fix transient errors in Debian Bullseye CI tests by using a different
machine image (Ubuntu 22.04 vs Ubuntu 20.04), and solving some Podman
config issues along the way.

Fixes #388
2023-05-24 13:45:56 +03:00
deeplow
8059c8e1f1
Deprecate Fedora 36 support
Fixes #420
2023-05-23 09:22:59 +01:00
Alex Pyrgiotis
739ef87d6c
ci: Add checks for Fedora 38
Update our CircleCI config with checks for Fedora 38:

* Build RPMs
* Run tests
2023-05-16 16:20:32 +03:00
Alex Pyrgiotis
7613941e1f
ci: Do not deploy to PackageCloud
Pave the way for deploying .deb and .rpm packages to
packages.freedom.press. Remove the code that deploys to PackageCloud
once we tag a commit with `v<semver>`.

Refs #291
2023-03-27 13:41:08 +03:00
Alex Pyrgiotis
a2049349b1
ci: Add missing CI tests for Ubuntu Focal / Debian Bullseye 2023-03-08 17:36:42 +02:00
Alex Pyrgiotis
7979dbd653
ci: Install Poetry via APT on Debian Bookworm
We no longer need to install Poetry via PyPI, since the upstream Debian
issues have been fixed. Moreover, PEP 668 [1] is now enforced in Debian
Bookworm, so we can't install Poetry globally via `pip` in any case.

For these reasons, prefer installing Poetry via APT.

[1]: https://peps.python.org/pep-0668/

Refs #351
2023-03-08 17:23:06 +02:00
Alex Pyrgiotis
e5368b1ea0
ci: Run CI tests for Fedora 37
Run CI tests for Fedora 37 environments, now that we no longer require
PySide2 as a dev dependency.

Fixes #294
2023-02-07 18:52:09 +02:00
Alex Pyrgiotis
89e8b998d6
ci: Add a test dependency
Add libqt5gui5 as a test dependency in the 'convert-test-docs' step.
This package brings several other Qt and graphics libraries, which are
the ones that we actually require to run the tests *with PySide6*. Else,
we encounter this error:

```
Traceback (most recent call last):
  File "/home/circleci/project/dangerzone/gui/__init__.py", line 19, in <module>
    from PySide6 import QtCore, QtGui, QtWidgets
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory
```

Note that the same package is not required when importing PySide2.QtGui,
which is why we hadn't encountered this issue before. Also, in the rest
of our environments, we explicitly install libqt5gui5, in order to run
the Dangerzone GUI.
2023-02-07 17:14:01 +02:00
Alex Pyrgiotis
63a8748423
ci: Remove Poetry version pin
Remove a Poetry version pin to 1.2.2, which causes installation issues
on systems with Python 3.11.

The pin was originally introduced because Poetry 1.3 was deemed
unstable, due to the following bugs:

* https://github.com/freedomofpress/dangerzone/issues/292#issuecomment-1351368122
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029156

The first problem still stands, but we can circumvent it with the
`--no-ansi` flag, at no functionality cost. The second problem has been
resolved, but it never affected Ubuntu Focal in the first place.

Refs #292
2023-02-07 17:14:01 +02:00
deeplow
affc0ca2a8
Unpin PIP in CI; replace w/ --no-ansi fix same bug
Alternative solution to commit 0ebfe45169
but without pining the pip version.
2023-01-20 09:52:39 +00:00
Alex Pyrgiotis
0ebfe45169
Fix a failing lint check
Fix a failing lint check, that got introduced due to an upstream Debian
bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029156
2023-01-19 17:27:11 +02:00
Alex Pyrgiotis
7d0b6d44ba
ci: Remove Fedora 35 support
Fedora 35 has reached its end of life [1], so we remove it from our CI
builds.

Closes #308

[1]: https://endoflife.date/fedora
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
586240ec22
ci: Add CI tests for missing platforms
Use the `dev_scripts/env.py` script to run CI tests for some platforms
we couldn't run before.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
ea99b1e1dd
Narrow down installed system packages
Narrow down the system packages that we install in dev environments. The
rationale is that we get most of the Python dependencies from Poetry, so
we don't need to install them from the system as well.

The packages that we do need to install are non-Python ones, and this
commit adds some that were missing: make, python3-stdeb. Also, we
explicitly install the base Qt5 libraries, in order to get the graphics
and C++ libraries that we can't get from PyPI.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
14a7ca1ae5
dev_scripts: Add QA script
Add a script that makes the user go through the QA steps for a supported
Dangerzone platform, and may optionally run them automatically, if the
user agrees.

Closes #287
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
fc313d8744
ci: Fix convert-test-docs step
Fix the failing convert-test-docs step, by pinning Poetry to version
1.2.2. This way, we avoid a bug in Poetry 1.3 [1], which was recently
released on PyPI.

[1]: https://github.com/python-poetry/poetry/issues/7184

Closes #292
2022-12-15 18:32:48 +02:00
Alex Pyrgiotis
147caca524
ci: Fix failing build-debian-bookworm step
Debian has removed the python-all package from its Bookworm repos, which
breaks our CI tests. Looking into why python-all is required in the
first place, we found that it's an artificial stdeb requirement [1],
prior to 0.9.1 versions

The only platform affected by this issue is Ubuntu Focal, so our
solution is to install python-all specifically for that platform.

Finally, we further simplify our build tasks [2] (on Debian-like
distros) by not letting dh-python run tests when building the packages.
Running the tests has some issues after all:

1. It requires installing all the runtime dependencies of Dangerzone,
   since it uses `python -m unittest discover` underneath.
2. It doesn't aid in the stability of the package, since unittest cannot
   run test cases for PyTest.

[1]: https://github.com/astraw/stdeb/issues/153
[2]: https://github.com/freedomofpress/dangerzone/issues/292#issuecomment-1349967888
2022-12-15 18:30:19 +02:00
Alex Pyrgiotis
06f92747ab
ci: Fix the failing run-lint step
Fix the failing run-lint test by switching to Debian Bookworm for this
step, and installing Poetry 1.2.2 from the official repos. This way, we
circumvent a bug [1] in Poetry 1.3 (released on PyPI) and we greatly
simplify this step [2].

[1]: https://github.com/python-poetry/poetry/issues/7184
[2]: https://github.com/freedomofpress/dangerzone/issues/292#issuecomment-1351368122
2022-12-15 18:29:35 +02:00
Alex Pyrgiotis
8658753d57
Use the proper codename for Ubuntu Kinetic Kudu
In a previous commit, we used the wrong codename for Ubuntu 22.10
"Kinetic Kudu". Instead of "kudu", we should use "kinetic".
2022-12-01 21:18:40 +02:00
Alex Pyrgiotis
1ad6b59bb1
Support Ubuntu 22.10 "Kinetic Kudu"
Add support for the newly released Ubuntu 22.10 "Kinetic Kudu".

Closes #265
2022-12-01 01:05:00 +02:00
Alex Pyrgiotis
badafaaf15
ci: Reinstate Ubuntu Focal support
Reinstate support for Ubuntu Focal, which was previously removed in
commit 229ebbda14.

Refs #206
2022-11-10 16:35:48 +02:00
Alex Pyrgiotis
1daaafe2a3
install: Introduce a script for installing Podman
Introduce a script for installing Podman in Ubuntu Focal, in
environments that may, or may not, have sudo installed.

Also, update our CircleCI configuration to use this script when
installing Podman.
2022-11-10 16:35:48 +02:00
deeplow
b1892077fa
Add fedora 37 support in CI
Fedora 37 had been removed (commit d7cbe41) due to lack of support by
packagecloud (our package hosting solution at the time). This will no
longer be true and thus we can add this distro to the list of supported.
2022-10-27 14:53:17 +01:00
deeplow
77c7cba563
Add support for Debian Bookworm
Fixes #172
2022-10-27 14:49:23 +01:00
deeplow
75fe45cfb6
replace automated test code in CI 2022-09-13 13:17:15 +01:00
Micah Lee
d7cbe419cc
Comment out deploying to fedora 37, because packagecloud.io does not support it yet 2022-09-06 10:43:18 -07:00
deeplow
ece36dc287
add lint checks on CI 2022-08-22 10:15:30 +01:00
Guthrie McAfee Armstrong
395eba0a74
Remove requests dependency 2022-08-19 15:16:14 +01:00
deeplow
c713801e77
remove EOL ubuntu versions 2022-08-04 19:23:41 +01:00
deeplow
47364c200c
disable debian 12 while waiting on upsteam fix
More details at https://github.com/freedomofpress/dangerzone/issues/172
2022-07-20 10:23:58 +01:00
deeplow
a04ed076cb
update distros in CI (deprecate old & add new ver.) 2022-07-11 11:01:19 +01:00
Micah Lee
b4cae37874
Deploy ubuntu on 21.04 2021-11-30 18:01:57 -08:00
Micah Lee
3a337eee1f
Refactor deployments 2021-11-30 17:31:57 -08:00
Micah Lee
defe9ef9dc
Deploy different versions of fedora, debian, and ubuntu from the same container 2021-11-30 17:08:24 -08:00
Micah Lee
4ecaad18fd
Force ruby 2.7 2021-11-30 16:45:39 -08:00
Micah Lee
6f6dae109f
Fix typo in CircleCI deploy 2021-11-30 16:04:36 -08:00
Micah Lee
8f22c4d680
Simplify CircleCI deployment and display debug output 2021-11-30 15:56:32 -08:00
Micah Lee
32792fc143
Don't specify --platform when building in CircleCI 2021-11-29 16:12:07 -08:00
Micah Lee
0908e2941b
Use the latest docker in CI 2021-11-29 16:10:34 -08:00
Micah Lee
4a92048389
Update the CircleCI cache key to no longer rely on files that are deleted 2021-11-29 16:07:18 -08:00
Micah Lee
42f8fb9e2f
Rename the container in CircleCI 2021-11-29 16:04:20 -08:00
Micah Lee
b8b11b514d
Install poetry deps after checking out 2021-11-24 15:51:46 -08:00
Micah Lee
bd0b032c30
For testing, install deps with peotry, and run with poetry, without building a package 2021-11-24 15:39:23 -08:00