Commit Graph

29 Commits

Author SHA1 Message Date
Tim Orling
a7e77286ca Dockerfile: fix mysqlclient==2.2.1 build
To build mysqlclient==2.2.1 we need to add default-libmysqlclient-dev
and pkg-config

Drop conflicting libmariadb-dev-compat
Drop python3-mysqldb to allow requirements.txt to override version

Upgrade pip and setuptools before installing from requirements.txt
as newer versions are required to properly build mysqlclient wheel.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2024-01-12 14:16:22 -08:00
Tim Orling
f5bad078f9 Dockerfile: sort apt packages alphabetically
Make it is a bit easier to see what is installed by
sorting the package list alphabetically.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2024-01-12 14:16:22 -08:00
Tim Orling
fcce3cdcde Dockerfile: drop python3-pil
This prevents upgrading Pillow in requirements.txt

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:12:27 -07:00
Michael Halstead
13c94088b4 Dockerfile: switch to ubuntu:jammy for >python3.8
ubuntu:jammy provides python 3.10.6 which supports current bitbake.
Dropped unneeded python2 packages.
Moved locale generation high to reduce error messages during image building.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Michael Halstead
c7b02096e0 Dockerfile: add captcha dependencies
The current version of django-simple-captcha requires libz and freetype
development libraries.

Refactor to apply. Fix typo. Fix previous mixed use of space vs tab.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-12-16 08:59:37 -08:00
Tim Orling
88b13592c3 Dockerfile: add back python2 dependencies
We have some layers and especially older releases that still support
python2. Add python2 dependencies back to the container so that the
older releases still function.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:38 -08:00
Tim Orling
c99a1ed4e7 Dockerfile: fix warnings
* Define LANGUAGE to quiet perl warnings
* Set DEBIAN_FRONTEND=noninteractive before apt call to quiet TERM/Dialog
  warnings

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 21:00:33 -08:00
Tim Orling
f9c640a7c0 Dockerfile: cleanup, install python3-wheel
Remove duplicate python3-pip, etc. lines
Need python3-wheel for bdist_wheel command

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:57:42 -08:00
Tim Orling
2da03f4711 Dockerfile: debian 10 "buster" and drop python2
Debian 10 "buster" actually has Django 2.2 available
python2 is now EOL, so drop all usage

Signed-off-by: Tim Orling <ticotimo@gmail.com>
Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org>
2020-06-30 05:37:09 +12:00
Paul Eggleton
2c709617bc dockersetup: proxy support fixes
* We need a SOCKS proxy to support fetching from git:// or ssh:// URLs
  within the container, so add an option to specify it
* It's possible for the http and https proxy settings to be the same, so
  set one from the other if only one of them is set.
* If we want to be able to fetch from internal servers inside the proxy
  then we also need a "no-proxy" list, so add support for that.
* It's not unlikely that machines within networks requiring use of a
  proxy for external network access will have all of the proxy settings
  set in the environment, so we can try to pick up the defaults from
  there.
* Ensure that we can switch from proxy to no proxy (when reinstalling)
  which means we always need to edit the config files and ensure the
  proxy options get commented out if we don't want them set.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-02 14:13:47 +13:00
Paul Eggleton
c1925e42e0 docker: fix comment at top of Dockerfile
docker/README is no more - the info is all in the main README now.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-02 14:13:47 +13:00
Paul Eggleton
b5ba406a07 dockersetup.py: add connectivity check
It's easy to get the proxy settings wrong and not realise until you've
got quite a long way into the process of setting things up. Thus, add a
check where we actually try to fetch various things within the container
environment and fail reasonably early if things aren't working.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-02 14:13:47 +13:00
Paul Eggleton
1756579024 docker: delete docker directory from /opt/layerindex
There's no reason for this directory to be present in the source tree.
(The rest of the docker files are already excluded via .dockerignore,
but files in docker/ need to be picked up by COPY directives so we can't
do that for these as well.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
145ddcf4ba docker: ensure application files are owned by root
We really don't want the layers user to be able to write to the
application code / settings in /opt/workdir or /opt/bin within the
layersapp container - only selected directories under /opt. It appears
that we only need to set the ownership on /opt/workdir for now.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
7f3b4934a9 docker: add dependencies for derivative import
We use rpm/rpm2cpio/cpio to deal with the derivative packages, so we
need them in the application container.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
2e51e53110 docker: increase gunicorn worker timeout to handle large images
Currently, the processing of larger images takes some time, for example
a manifest generated from core-image-sato-sdk seems to take about 45s to
load into the database which is longer than gunicorn's default worker
timeout of 30s. Increase the timeout to 60s as a workaround until we
optimise the import.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
53e6ed36b6 docker: add wget to dependencies
The upstream version checking used by the RRS needs wget to fetch
http/https URLs, so add it into the container.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-02-14 10:05:53 +13:00
Paul Eggleton
308a1c6cfe docker: remove one step from proxy setup
We can always deploy these files since the default versions have all the
settings commented out - save proxy users from needing to uncomment
these (it's annoying if you miss doing so).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-08-29 21:42:02 +12:00
Paul Eggleton
8dc728bf62 docker: fix copying .gitconfig for proxy setup
The home directory path in the commented line here had not been updated
when we switched to running the app as a normal user ("layers"), so do
that now. Additionally we need to copy the file *after* we create the
user, otherwise the home directory will be created by the COPY operation
first and will thus end up being owned by root which we don't want.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-08-06 12:34:57 +02:00
Konrad Scherer
65d058237f Dockerfile: Reduce image size by merging RUN stages together
Docker commits changes after each RUN stage and commands that delete
files must part of the sane RUN command to actually reduce image size.

Debian stretch contains pip 9.0.3 and the upgrade to 10 caused pip
install to fail.

Signed-off-by: Konrad Scherer <Konrad.Scherer@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
272f0eded2 docker: enhance example setup
* Put NGINX, Celery, and RabbitMQ into their own separate containers
* Use a docker network instead of the deprecated --link
* Allow for collecting the static files properly
* Create a copy of settings.py specifically for the docker setup. This
  will need to be kept in sync with the main example settings.py, but
  it avoids the user having to edit it too much.
* Add optional SSL configuration using letsencrypt certificate
* Create some volumes for static files / fetched repos
* Add some more helpful setup instructions

Largely based upon work by Michael Halstead <michael@yoctoproject.org>.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
c0d68848c7 docker: use a normal user account to run the application
It's best practice to run as a normal account, so create one and use it.
Thanks to Michael Halstead <michael@yoctoproject.org> for this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
eafd78de1e docker: trim down container size
* Use plain debian instead of buildpack-deps as a base (and install just
  the additional packages we need on top)
* Purge the development packages after we're done with them (they aren't
  used at runtime)
* Run apt-get clean to drop package cache files

Thanks to Konrad Scherer <konrad.scherer@windriver.com> for this idea.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
16c25c9800 docker: split out pip install of requirements
If we split dealing with requirements.txt out before we copy the entire
source tree then docker can keep that part cached more often when we're
making changes to the code and thus rebuilds are faster. Thanks to
Konrad Scherer <konrad.scherer@windriver.com> for this idea.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
163a84ff00 docker: enable UTF-8 locale
Python 3 is a lot more sensitive to locale, plus we will definitely be
dealing with non-ASCII names and email addresses, so we need to get this
right.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
1bb2d1fd7c docker: use Python 3 to run web interface
Python 2 is only supported for indexing layers in older branches - the
web interface should be running under Python 3.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Paul Eggleton
5ee59b1564 docker: dockerfile cleanups
* Use LABEL instead of the deprecated MAINTAINER

* Use COPY instead of ADD. There's no difference in operation here, it's
  just that we don't need the extra magic that ADD provides and best
  practice is to use COPY in that case.

* Fix the mkdir /opt/workdir line - it wasn't being run since it was a
  CMD not RUN, and thus was overridden by a later CMD directive.

* Drop the CMD line to run celery - having more than one CMD directive
  does not work. We'll launch a separate container to run it instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00
Diana Thayer
2e671480c7 Asynchronous email notifications, task execution
This patch adds asynchronous task execution using a Celery backend
and RabbitMQ task queue, so that the layer submission process to
proceed even in the event that sending the notification email fails,
and establishing an asynchronous execution mechanism that we can use
in the future e.g. for triggering parse operations from the web UI.
This pertains to bug 11197:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=11197

It updates the README to reflect the installation and configuration
of a basic RabbitMQ setup, adds a 'tasks.py' file to contain task
definitions, updates the 'edit_layer_view' function to send
emails to administrators about new and updated layers asynchronously,
modifies the 'settings.py' to include a default configuration
for a RabbitMQ connection, and updates the Dockerfile to start a Celery
worker alongside the Gunicorn daemon.

Fixes [YOCTO #11197].

Signed-off-by: Diana Thayer <garbados@gmail.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-01 16:59:43 +12:00
Alex Franco
4daaf718db Docker based environment setup
Replicate production setup in Docker containers

[YOCTO #7575]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-10-07 11:34:34 +01:00