Skip to content

Commit 3a3922a

Browse files
committed
Updated documentation for release 2.0.4
1 parent 34ae84f commit 3a3922a

File tree

2 files changed

+249
-160
lines changed

2 files changed

+249
-160
lines changed

doc/source/install.rst

Lines changed: 92 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,97 @@ Installing and running HEPCloud's Decision Engine on EL9
66

77
Currently the only version supporting EL9 is the development version, DE 2.0.x, which corresponds to the master branch in Git.
88

9-
Decision engine uses a PostgreSQL database back-end and Redis as message broker and cache.
9+
Decision Engine uses a PostgreSQL database back-end and Redis as message broker and cache.
1010

11-
You need to install first PostgreSQL, Redis, and then the Decision engine framework (decisionengine) and install and add the standard channels (decisionengine_modules).
11+
The first one is installed as RPM requirement, the second is used as container. You need to install the pre-requisites RPM and then the Python packages for Decision Engine framework (decisionengine) and install and add the standard channels (decisionengine_modules).
1212

1313
The following instructions assume Alma Linux 9. You may need to adapt them slightly for other EL9 flavors.
1414

1515
These also assume a system installation, performed as ``root``.
1616
decisionengine will run as the decisionengine user.
1717

1818

19-
Install PostgreSQL
20-
------------------
19+
Install Decision Engine and the standard modules
20+
------------------------------------------------
21+
22+
RPM installation
23+
24+
1. Prerequisites setup. Make sure that the required yum repositories and some required packages (python3, gcc, ...) are installed and up to date. ::
25+
26+
# Possible OSG versions: 24, 23, 24-upcoming
27+
OSG_VERSION=24
28+
# YUM repo for Decision Engine
29+
GWMS_REPO=osg-development
30+
dnf install -y epel-release yum-utils sed
31+
dnf config-manager --set-enabled crb
32+
/bin/sed -i '/^enabled=1/a priority=99' /etc/yum.repos.d/epel.repo
33+
dnf -y install "https://repo.osg-htc.org/osg/$OSG_VERSION-main/osg-$OSG_VERSION-main-el9-release-latest.rpm"
34+
35+
2. Setup the decision engine yum repositories ::
36+
37+
wget -O /etc/yum.repos.d/ssi-hepcloud.repo http://ssi-rpm.fnal.gov/hep/ssi-hepcloud.repo
38+
wget -O /etc/yum.repos.d/ssi-hepcloud-dev.repo http://ssi-rpm.fnal.gov/hep/ssi-hepcloud-dev.repo
39+
# Note the above repos are only accessible within Fermilab. There is an alternative place on github to get the RPMs if you are off-site.
40+
41+
3. Install the decision engine (add `--enablerepo=ssi-hepcloud-dev` for the latest development version) ::
42+
43+
DE_REPO=ssi-hepcloud-dev
44+
dnf install -y --enablerepo="$DE_REPO" decisionengine-onenode
45+
# Individual packages are: decisionengine-deps (framework req) decisionengine-modules-deps (modules req) decisionengine-standalone (2 deps+httpd)
46+
47+
4. Install the required Python packages (these are taken from setup.py) ::
48+
49+
decisionengine-install-python
50+
# This shell script (included in decisionengine-deps) installs the Decision Engine Python code.
51+
# You can run it as root or as the decisionengine user
52+
# To see all the options: decisionengine-install-python --help
53+
54+
# Double check that pip added $HOME/.local/bin to the PATH of user decisionengine
55+
56+
5. Start and enable HTCondor::
57+
58+
systemctl start condor
59+
systemctl enable condor
60+
61+
6. Optionally install these extra packages ::
62+
63+
# htgettoken - if you need it to generate SciTokens
64+
dnf -y install htgettoken
65+
66+
67+
Fix the GlideinWMS Frontend installation
68+
----------------------------------------
69+
70+
We will make HEPCloud's Decision Engine using some GlideinWMS libraries but independent from the Frontend.
71+
The codebases, though, are still intertwined, so there are some adjustments needed to the GlideinWMS installation.
72+
73+
Create the condor password and change to decisionengine the ownership of the frontend directories: ::
74+
75+
# Create or copy the FRONTEND condor password file
76+
# If POOL is not there, do start condor (systemctl start condor)
77+
pushd /etc/condor/passwords.d/
78+
cp POOL FRONTEND
79+
cp FRONTEND /var/lib/gwms-frontend/passwords.d/
80+
popd
81+
chown -R decisionengine: /var/lib/gwms-frontend
82+
chown -R decisionengine: /etc/gwms-frontend
83+
# The permission of /var/lib/gwms-frontend/passwords.d/FRONTEND should be 0600
2184

22-
Install the default postgresql distributed on RHEL9, Postgresql 13:
2385

24-
1. Install postgresql ::
86+
Set up PostgreSQL
87+
-----------------
2588

26-
dnf install -y postgresql postgresql-server
27-
# optional, also: postgresql-devel
89+
PostgreSQL is installed by the requirements RPM, Postgresql 13:
2890

29-
2. Enable postgresql ::
91+
1. Enable postgresql ::
3092

3193
systemctl enable postgresql
3294

33-
3. Init the database ::
95+
2. Init the database ::
3496

35-
postgresql-setup --initdb -k
97+
postgresql-setup --initdb
3698

37-
4. edit ``/var/lib/pgsql/data/pg_hba.conf`` like the following::
99+
3. edit ``/var/lib/pgsql/data/pg_hba.conf`` like the following::
38100

39101
[root@fermicloud371 ~]# diff /var/lib/pgsql/data/pg_hba.conf~ /var/lib/pgsql/data/pg_hba.conf
40102
80c80
@@ -51,8 +113,15 @@ Install the default postgresql distributed on RHEL9, Postgresql 13:
51113
> host all all ::1/128 trust
52114

53115

116+
(difference of the correct file from the default one - `pg_hba.conf~`)
54117
This is setting the authentication method to `trust`
55118

119+
4. Fix the PostgreSQL installation. Not sure why, but the run directory was missing and causing the startup to fail. ::
120+
121+
# Without this the systemctl start was failing and the error was in /var/lib/pgsql/data/log/postgresql-*.log
122+
mkdir -p /var/run/postgresql
123+
chown postgres: /var/run/postgresql
124+
56125
5. start the database ::
57126

58127
systemctl start postgresql
@@ -61,170 +130,33 @@ Install the default postgresql distributed on RHEL9, Postgresql 13:
61130

62131
createdb -U postgres decisionengine
63132

64-
The schema and the connection will be created and configured during the Decision engine framework installation.
65-
66-
To use the database you have to add it to the environment::
133+
The schema and the connection will be created and configured during the Decision Engine framework initialization.
67134

68-
export PG_VERSION=13
69-
export PATH="~/.local/bin:$PATH"
70-
# you may also add these lines to ~/.bashrc
135+
RHEL also provides other PostgreSQL versions via streams. These may require changes to environment variables like PG_VERSION and PATH to use the database.
71136

72137

73138
Install Redis
74139
-------------
75140

76141
Install and start the message broker (Redis) container on your system. You can find more details on the :doc:`redis document <redis>`
77142

78-
1. Install Padman ::
143+
1. You may need to fix the firewall used ::
144+
145+
dnf rm iptables-legacy
146+
dnf install iptables-nft
147+
148+
2. Install Padman ::
79149

80150
dnf install -y podman
81151

82-
2. Run the Redis container ::
152+
3. Run the Redis container ::
83153

84154
podman run --name decisionengine-redis -p 127.0.0.1:6379:6379 -d redis:6 --loglevel warning
85155
# When prompted to select an image, pick "docker.io/library/redis:6".
86156

87157

88-
Install Decision Engine and the standard modules
89-
------------------------------------------------
90-
91-
92-
Install needed RPMs prerequisites
93-
---------------------------------
94-
95-
1. Make sure the correct repositories and priorities are set. ::
96-
97-
# CRB ("Code Ready Builder" - PowerTools ) is used for swig and other dependencies
98-
dnf install -y yum-utils
99-
dnf config-manager --set-enabled crb
100-
# EPEL is used for OSG dependencies
101-
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
102-
# OSG is used for GlideinWMS, HTCSS and others
103-
dnf install https://repo.opensciencegrid.org/osg/3.6/osg-3.6-el9-release-latest.rpm
104-
dnf repolist
105-
# Make sure all the above repos are enabled
106-
# And change the Epel repository priority to make sure that comes after the OSG repositories, which are 98 by default.
107-
# Make sure that epel has:
108-
# priority=99
109-
vi /etc/yum.repos.d/epel.repo
110-
111-
2. Install the following prerequisites. Make sure that the required packages are installed and up to date. ::
112-
113-
# RPMs
114-
# gcc, swig and make are needed for dependencies (jsonnet)
115-
dnf install -y python3 python3-devel python3-cryptography python3-pip
116-
dnf install -y gettext git make openssl-devel gcc gcc-c++ swig
117-
# Install also these for RPM building:
118-
dnf install -y python3-setuptools python3-wheel rpm-build
119-
# Update Python pip
120-
python3 -m pip install --upgrade --user pip
121-
python3 -m pip install --upgrade --user setuptools wheel setuptools-scm[toml]
122-
123-
124-
..
125-
126-
Use PIP installation below - Install via RPMs - coming soon
127-
-----------------------------------------------------------
128-
129-
You can install using the provided RPMs (recommended for production) or via PIP install (recommended for development whnen you want to clone the Git repository and change the code).
130-
This section is for the RPM installation, the next one for the PIP installation. Use one or the other.
131-
132-
1. The yum repositories are available only within Fermilab. From the outside you will have to download the RPMs from `GitHub<https://github.com/HEPCloud/decisionengine/releases>` or use the PIP installarion (below).
133-
Setup the decision engine yum repositories ::
134-
135-
# You need the development version wget -O /etc/yum.repos.d/ssi-hepcloud.repo http://ssi-rpm.fnal.gov/hep/ssi-hepcloud.repo
136-
wget -O /etc/yum.repos.d/ssi-hepcloud-dev.repo http://ssi-rpm.fnal.gov/hep/ssi-hepcloud-dev.repo
137-
# This is the same as the EL9 development repo: http://ssi-rpm.fnal.gov/hep/hepcloud-el9/ssi-hepcloud-dev.repo (http://ssi-rpm.fnal.gov/hep/hepcloud-el9/development/)
138-
139-
2. Install the decision engine and add ``--enablerepo=ssi-hepcloud-dev`` for the latest development version ::
140-
141-
dnf install decisionengine
142-
dnf install decisionengine_modules
143-
144-
3. Not all packages are available as RPM. It is necessary to install directly some Python dependencies.
145-
To avoid to pollute the system Python we will install them for the ``decisionengine`` user,
146-
the user the service is running as.
147-
Install the required Python packages (these are taken from setup.py) ::
148-
149-
su decisionengine -s /bin/bash
150-
python3 -m pip install --upgrade pip setuptools wheel --user
151-
python3 /path/to/decisionengine/setup.py develop --user
152-
python3 /path/to/decisionengine/setup.py develop --user --uninstall
153-
python3 /path/to/decisionengine_modules/setup.py develop --user
154-
python3 /path/to/decisionengine_modules/setup.py develop --user --uninstall
155-
exit
156-
157-
The commands above should be sufficient. Anyway, here is an explicit list you can use in alternative::
158-
159-
su decisionengine -s /bin/bash
160-
# from decisionengine setup.py
161-
python3 -m pip install --user jsonnet==0.17.0 tabulate toposort structlog
162-
python3 -m pip install --user wheel DBUtils sqlalchemy
163-
python3 -m pip install --user pandas==2.0.0 numpy==1.24.2
164-
python3 -m pip install --user "psycopg2-binary >= 2.9.6; platform_python_implementation == 'CPython'"
165-
python3 -m pip install --user "psycopg2cffi >= 2.9.0; platform_python_implementation == 'PyPy'"
166-
python3 -m pip install --user "cherrypy>=18.8.0" "kombu[redis]>=5.3.0b3" "prometheus-client>=0.16.0"
167-
python3 -m pip install --user "psutil>=5.8.0" "typing_extensions==4.1.1"
168-
# from decisionengine_modules setup.py
169-
python3 -m pip install --user boto3 google-api-python-client
170-
python3 -m pip install --user "google_auth<2dev,>=1.16.0" "urllib3>=1.26.2"
171-
python3 -m pip install --user gcs-oauth2-boto-plugin
172-
# Condor should be already there from the RPM, if not add: python3 -m pip install htcondor
173-
python3 -m pip install --user bill-calculator-hep
174-
175-
# The following are additional requirements for v1.6 and earlier
176-
python3 -m pip install --user boto packaging
177-
# This is not in pypi
178-
python3 -m pip install --user https://test-files.pythonhosted.org/packages/f4/a5/17a14b4ef85bc412a0ddb771771de3f562430328b0d83da6091a4131bb26/bill_calculator_hep_mapsacosta-0.0.10-py3-none-any.whl
179-
180-
exit
181-
182-
Now you can type ``decisionengine --help`` to print the help message.
183-
To do more you need first to configure Decision Engine.
184-
Skip the PIP installation and go to the configuration section.
185-
186-
..
187-
188-
189-
Install via PIP
190-
---------------
191-
192-
Skip this if you did the RPM installation. This PIP installation is recommended for development whnen you want to clone the Git repository and change the code.
193-
There are a few extra steps (dependencies installation and setups) that are automated in the RPM installation.
194-
195-
1. GlideinWMS (3.10.x) and HTCondor (aka HTCSS) are needed for Decision Engine. The ``glideinwms`` packages will pull all the other dependencies.
196-
The complete version of the GlideinWMS installation instructions is available `here<https://opensciencegrid.org/docs/other/install-gwms-frontend/>`.
197-
For a minimal installation, you can use the following command: ::
198-
199-
dnf install glideinwms-vofrontend-libs glideinwms-vofrontend-glidein glideinwms-userschedd glideinwms-usercollector
200-
dnf install glideinwms-vofrontend-core glideinwms-vofrontend-httpd
201-
202-
2. Setup the decision engine user and git repositories ::
203-
204-
useradd decisionengine
205-
sudo -u decisionengine git clone https://github.com/HEPCloud/decisionengine.git ~decisionengine/decisionengine
206-
sudo -u decisionengine git clone https://github.com/HEPCloud/decisionengine_modules.git ~decisionengine/decisionengine_modules
207-
208-
3. Install the decision engine from the git repositories ::
209-
210-
# Install the decisionengine framework and modules using setuptools
211-
su - decisionengine -s /bin/bash
212-
# Now you should be the decisionengine user in its home directory
213-
pushd decisionengine
214-
python3 setup.py develop --user
215-
popd
216-
pushd decisionengine_modules
217-
python3 setup.py develop --user
218-
popd
219-
exit
220-
221-
# Create the required system files and directories (as root)
222-
mkdir /etc/decisionengine
223-
mkdir /var/log/decisionengine/
224-
cp ~decisionengine/decisionengine/config/decision_engine.jsonnet /etc/decisionengine
225-
cp -r ~decisionengine/decisionengine/src/decisionengine/framework/tests/etc/decisionengine/config.d /etc/decisionengine
226-
chown -R decisionengine:decisionengine /etc/decisionengine
227-
chown -R decisionengine:decisionengine /var/log/decisionengine
158+
Test
159+
----
228160

229161
Now you can type ``decisionengine --help`` while logged in as decisionengine to print the help message.
230162
To do more you need first to configure Decision Engine.

0 commit comments

Comments
 (0)