Skip to content

Commit

Permalink
Remove Perl postinstall script (apache#7841)
Browse files Browse the repository at this point in the history
* Removed old Perl postinstall script

* Change 'hidden' values to actual booleans

* Add deprecation notices for Python2

* Update docs

* Update changelog

* Add Python3 as a TO dependency

* Remove Python2 from Postinstall tests

* Remove the ability to run Postinstall with Python2

* Remove Python2 compatibility from the postinstall Python script

* Update changelog

* Update docs

* Fix bad encoding name

* Added removed notice for the Perl postinstall script

* allow integer port numbers

* Use range instead of explicit list

* Try manually installing python 3.8

* Switch minimum Python version to 3.6

* Fix integer being treated as an integer

Yes, you read that right. No, it's not a typo. Traffic Ops will refuse to load
a configuration file that gives the Traffic Ops Golang port as an integer
instead of a string.

* Remove now-unnecessary python-abi dependency
  • Loading branch information
ocket8888 authored Feb 12, 2024
1 parent b1d83a5 commit 57bae11
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 1,293 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/postinstall.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ on:

env:
PYTHON3_VERSION: '3.6'
PYTHON2_VERSION: '2.7'

jobs:
postinstall-tests:
Expand All @@ -48,11 +47,6 @@ jobs:
if: ${{ steps.checkout.outcome == 'success' }}
with:
python-version: '${{ env.PYTHON3_VERSION }}'
- name: Install Python ${{ env.PYTHON2_VERSION }}
uses: actions/setup-python@v4
if: ${{ steps.checkout.outcome == 'success' }}
with:
python-version: '${{ env.PYTHON2_VERSION }}'
- name: Run Postinstall Tests
if: ${{ steps.checkout.outcome == 'success' }}
run: traffic_ops/install/bin/postinstall.test.sh
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7918](https://github.com/apache/trafficcontrol/pull/7918) *Traffic Portal* Fixed topology link under DS-Servers tables page
- [#7846](https://github.com/apache/trafficcontrol/pull/7846) *Traffic Portal* Increase State character limit

### Removed
- [#7832](https://github.com/apache/trafficcontrol/pull/7832) *t3c* Removed Perl dependency
- [#7841](https://github.com/apache/trafficcontrol/pull/7841) *Postinstall* Removed Perl implementation and Python 2.x support

## [8.0.0] - 2023-09-20
### Added
- [#7672](https://github.com/apache/trafficcontrol/pull/7672) *Traffic Control Health Client*: Added peer monitor flag while using `strategies.yaml`.
Expand Down
13 changes: 8 additions & 5 deletions docs/source/admin/traffic_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,20 @@ Guide
| Password for the admin user | The password for the administrative Traffic Ops user. |
+----------------------------------------------------+------------------------------------------------------------------------------------------------+

.. deprecated:: ATCv6
The postinstall script is now written in Python. If you run into issues with the postinstall script, you are encouraged to file an issue at https://github.com/apache/trafficcontrol/issues/new/choose. The original Perl postinstall script is deprecated and will be removed in a future ATC release. To use the deprecated version anyway, run ``/opt/traffic_ops/install/bin/_postinstall.pl`` directly instead of ``/opt/traffic_ops/install/bin/postinstall``.

The postinstall script can also be run non-interactively using :atc-file:`traffic_ops/install/bin/input.json`. To use it, first change the values to match your environment, then pass it to the ``postinstall`` script:
.. code-block:: console
:caption: Postinstall in Automatic (-a) mode
/opt/traffic_ops/install/bin/postinstall -a --cfile /opt/traffic_ops/install/bin/input.json
.. deprecated:: ATCv6
Once the Perl script is removed, the values in ``input.json`` for the ``"hidden"`` properties will be changed from ``"1"`` and ``"0"`` to ``true`` and ``false``.
.. versionchanged:: ATCv8
The values in ``input.json`` for the ``"hidden"`` properties have been changed from ``"1"`` and ``"0"`` to ``true`` and ``false``.

.. versionchanged:: ATCv8
Python 2.x is no longer supported by the ``postinstall`` script.

.. versionremoved:: ATCv8
In earlier versions of ATC, it was possible to run ``postinstall`` using Perl - no longer.

.. _to-upgrading:

Expand Down
3 changes: 2 additions & 1 deletion infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ RUN set -o nounset -o errexit -o xtrace && \
perl-libwww-perl \
perl-TermReadKey \
perl-Test-CPAN-Meta \
perl-WWW-Curl; \
perl-WWW-Curl \
python3; \
dnf clean all

FROM trafficops-dependencies AS trafficops
Expand Down
2 changes: 1 addition & 1 deletion traffic_ops/build/traffic_ops.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Requires: openssl-devel, perl, perl-core, perl-DBD-Pg, perl-DBI, perl-Di
Requires: libidn-devel, libcurl-devel, libcap
Requires: postgresql13 >= 13.2
Requires: perl-JSON, perl-libwww-perl, perl-Test-CPAN-Meta, perl-WWW-Curl, perl-TermReadKey, perl-Crypt-ScryptKDF
Requires: python(abi)
Requires: python3
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel

Expand Down
Loading

0 comments on commit 57bae11

Please sign in to comment.