@@ -373,11 +373,69 @@ Python packages build options
373
373
374
374
The block ``base_pip_conf `` in the ``base `` Dockerfile can be used to provide
375
375
the PyPI build customisation options via the standard environment variables
376
- like ``PIP_INDEX_URL ``, ``PIP_TRUSTED_HOST ``, etc. Also here can be provided
377
- the standard environment variable ``UPPER_CONSTRAINTS_FILE `` used for building
378
- the ``bifrost_deploy `` container when PyPI upper-constraints needs to be
379
- overridden. Also this variable would be used in the ``kolla-toolbox `` if
380
- provided instead of the defaults.
376
+ like ``PIP_INDEX_URL ``, ``PIP_TRUSTED_HOST ``, etc.
377
+
378
+ To override PYPI upper-constraints of all OpenStack images, you can
379
+ define the source location of openstack-base. in ``kolla-build.conf ``.
380
+
381
+ Upstream repository of `openstack-base (requirements) <https://opendev.org/openstack/requirements >`__
382
+ has a source of
383
+ `upper constraints file <https://opendev.org/openstack/requirements/src/branch/master/upper-constraints.txt >`__.
384
+
385
+ Make a fork or clone the repository then customise ``upper-constraints.txt ``
386
+ and define the location of ``openstack-base `` in ``kolla_build.conf ``.
387
+
388
+ .. path /etc/kolla/kolla-build.conf
389
+ .. code-block :: ini
390
+
391
+ # These examples use upstream openstack-base as a demonstration
392
+ # To use custom openstack-base, make changes accordingly
393
+
394
+ # Using git source
395
+ [openstack-base]
396
+ type = git
397
+ location = https://opendev.org/openstack/requirements
398
+ reference = master
399
+
400
+ # Using URL source
401
+ [openstack-base]
402
+ type = url
403
+ location = https://tarballs.opendev.org/openstack/requirements/requirements-master.tar.gz
404
+
405
+ # Using local source
406
+ [openstack-base]
407
+ type = local
408
+ location = /home/kolla/src/requirements
409
+
410
+ To remove or change the version of specific Python packages in
411
+ ``openstack-base `` upper-constraints, you can use the block
412
+ ``openstack_base_override_upper_constraints `` in your template file,
413
+ for example, ``template-overrides.j2 ``:
414
+
415
+ .. code-block :: jinja
416
+
417
+ {% block openstack_base_override_upper_constraints %}
418
+ RUN {{ macros.upper_constraints_version_change("sqlparse", "0.4.4", "0.5.0") }}
419
+ RUN {{ macros.upper_constraints_remove("reno") }}
420
+ {% endblock %}
421
+
422
+ ``kolla-toolbox `` image needs different approach as it does not uses
423
+ ``openstack-base `` as a base image.
424
+ A variable ``UPPER_CONSTRAINTS_FILE `` is set in the
425
+ Dockerfile of ``kolla-toolbox ``.
426
+ To change variable, add the following contents to the
427
+ ``kolla_toolbox_pip_conf `` block in your template file, for example,
428
+ ``template-overrides.j2 ``:
429
+
430
+ .. code-block :: jinja
431
+
432
+ {% block kolla_toolbox_pip_conf %}
433
+ ENV UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/master
434
+ {% endblock %}
435
+
436
+ .. note ::
437
+
438
+ ``UPPER_CONSTRAINTS_FILE `` must be a valid URL to the file
381
439
382
440
Plugin functionality
383
441
--------------------
0 commit comments