Testing Debian Packaging - AtlasOfLivingAustralia/documentation Wiki
This page describes the testing of Debian packaging system of ALA modules.
We are using this template system for help in the generation of Debian Living Atlases debian packages:
We have published some work-in-progress ALA modules
Using demo repository
The above modules are build and tested via this demo repo (generated via
aptly), and for now, dummy gpg key:
echo "deb [arch=amd64] https://apt.gbif.es/ bionic main" > /etc/apt/sources.list.d/ala.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F697D8D2ADB9E24A apt update
Testing ala-collectory service
After configuring the previous demo repository you can in ubuntu xenial ala-collectory without db:
apt install ala-collectory dbconfig-no-thanks
or if you want to install also mysql and to create an empty collectory db in the same server:
apt install ala-collectory
To see the package installation status and contents:
dpkg -l ala-collectory dpkg -L ala-collectory
Note: You should tune
/etc/default/tomcat7 memory opts as ala-install does.
After installing, with the default configuration, you will have the service running in
In ubuntu/bionic you should add xenial repositories as ala-install does (for install
tomcat7 and similar dependencies).
Testing ala-image service
For instance for ubuntu/xenial:
# Add postgresql repos echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/postgresql.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8 apt install ala-image # or if you want to install without db for use a external container/vm with the postgresql database apt install ala-image dbconfig-no-thanks # You can check the service with: service ala-image status
The image service will be running in port
The service require the
elacticsearch service to work properly.
Testing ala-cas-5 package
apt install ala-cas-5 # You can check the service with: service ala-cas-5 status
Note: this cas package is not totally updated and finished.
Testing ala-i18n package
A new package following this proposal.
apt install ala-i18n dpkg -L ala-i18n
Testing la-pipelines package
- Install yq: https://github.com/mikefarah/yq#on-ubuntu-1604-or-higher-from-debian-package
- Install docopts: https://github.com/docopt/docopts#install
apt install la-pipelines dpkg -L la-pipelines
Other WIP packages:
apt remove ala-image ala-collectory
Usage in docker images
You can preseed this package with something similar to (if this package uses mysql):
ENV DEBIAN_FRONTEND noninteractive ENV DB_MYSQL_ROOT_PASS somemysqlpassw ENV DB_COL_USER collectory ENV DB_COL_PASS somepass (...) RUN echo "ala-collectory ala-collectory/mysql/admin-pass password $DB_MYSQL_ROOT_PASS" | debconf-set-selections && \ echo "ala-collectory ala-collectory/mysql/app-pass password $DB_COL_PASS" | debconf-set-selections && \ echo "ala-collectory ala-collectory/db/app-user string $DB_COL_USER" | debconf-set-selections && \ echo "ala-collectory ala-collectory/dbconfig-install boolean true" | debconf-set-selections && \ echo "ala-collectory ala-collectory/dbconfig-upgrade boolean true" | debconf-set-selections
To check these values in debian debconf database about some package like
ala-collectory (for instance, to preseed it in Docker or to verify it) install that package in a test server or in a image and get the previous values with:
debconf-get-selections | grep ala-collectory
Other possibility is to install dbconfig-no-thanks instead of asking for db user and passwords. Useful if you have your db in other docker container or VM.
Create your own apt repository
aptly for our testing repository but there are some other repository management alternatives.
We used this tutorial for that configuring
aptly but without using S3, just a simple vhost configuration in our webserver.
So we do something like this to publish new packages:
aptly repo add unstable ala-image_1.0.6-7_all.deb aptly snapshot create unstable-ai1067 from repo unstable aptly publish switch bionic unstable-ai1067
gpg key generation for package signing
You will need a gpg key to sign that packages. Before generating it add to your:
personal-digest-preferences SHA256 cert-digest-algo SHA256
so you'll generate a gpg key compatible with apt.