Application deployment
Online use
In online mode, the server is assumed to have permanent connectivity to the Internet.
Python preparation
dnf --assumeyes install pip
Component installation
During execution of the pip install command below there is a warning about the absence of the wheel Python package,
Using legacy 'setup.py install' for htmlmin, since package 'wheel' is not instal
led.
Adding an updated version of it to the local Python environment (through a command like pip install wheel) makes no difference to the warning.
pip install --no-cache-dir mkdocs-material mkdocs-glightbox htmlmin
Python minimalization
dnf --assumeyes remove pip
Component downloading
One-off downloading of packages that can later be deployed in entirely offline fashion.
Python preparation
dnf --assumeyes install pip
Context recording
pip freeze >/tmp/before.txt
Connectivity establishment
ip route add default via 10.5.0.1
Component installation
During execution of the pip install command below, there is a warning about the absence of the wheel Python package,
Using legacy 'setup.py install' for htmlmin, since package 'wheel' is not instal
led.
This warning also appears when offline-installing the package files that were downloaded previously.
Adding an updated version of it to the local Python environment (through a command like pip install wheel) makes no difference to the warnings. The htmlmin package is still getting downloaded as a .tar.gz file.
pip install --no-cache-dir mkdocs-material mkdocs-glightbox htmlmin
Context rerecording
pip freeze >/tmp/after.txt
Delta calculation
comm -13 <(sort /tmp/before.txt) <(sort /tmp/after.txt) >/tmp/fetched.txt
Ingredient gathering
mkdir --verbose /tmp/download
pip download --dest /tmp/download --requirement /tmp/fetched.txt
Connectivity revocation
ip route del default
Ingredient archiving
# (cd /tmp/download;
# find . -mindepth 1 -print0 | cut --zero --characters=3- \
# | tar --create --owner=root:0 --group=root:0 \
# --directory /tmp/download --null --files-from -) \
# | xz -9 --extreme --verbose \
# > /tmp/download.tar.xz
(cd /tmp/download;
find . -mindepth 1 -print0 \
| cut --zero --characters=3- \
| sort --zero-terminated \
| cpio --create --null) \
| xz -9 --extreme --verbose > /tmp/download.cpio.xz
The /tmp/download.cpio.xz file must be pulled off the downloading server. After that, the server can be trashed or – in the event it is expected to continue functioning as a live server for Uptick – cleaned up using the following.
Download cleanup
rm --recursive /tmp/{{before,after,fetched}.txt,download{/,.cpio.xz}}
Python minimization
dnf --assumeyes remove pip
Offline use
Python preparation
dnf --assumeyes install pip
Download extraction
mkdir --verbose /tmp/download
xz --decompress --stdout downloaded-material-glightbox-htmlmin-rocky96.cpio.xz \
| ssh root@10.5.2.5 \
'(cd /tmp/download && cpio --extract --preserve-modification-time)'
Ingredient installation
pip install --no-index --find-links /tmp/download/*.{whl,tar.gz}
Download cleanup
rm --recursive /tmp/download
Python minimization
dnf --assumeyes remove pip