Building Keystone - linux-on-ibm-z/docs GitHub Wiki
Building Keystone
Below versions of Keystone are available in respective distributions at the time of creation of these build instructions:
- Ubuntu 22.04 has
21.0.1 - Ubuntu 24.04 has
25.0.0
The instructions provided below specify the steps to build Keystone version 30.0.0 on Linux on IBM Z for following distributions:
- RHEL (8.10, 9.6, 9.8, 10.0, 10.2)
- SLES (15 SP7, 16)
- Ubuntu (22.04, 24.04)
General notes:
- When following the steps below please use a standard permission user unless otherwise specified
1. Build using script
If you want to build and install Keystone using manual steps, go to step 2.
Use the following commands to build Keystone using the build script. Please make sure you have wget installed.
wget https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Keystone/30.0.0/build_keystone.sh
# Run bash build_keystone.sh -h to see all available options
bash build_keystone.sh
2. Install the dependencies
export PACKAGE_NAME="keystone"
export PACKAGE_VERSION="30.0.0"
export PYTHON_VERSION="3.13.3"
export OPENSSL_VERSION="3.4.1"
export DEPS_PREFIX=/opt/keystone-deps
export SOURCE_ROOT="$(pwd)"
export PATH="$HOME/.local/bin:$PATH"
-
RHEL 8.10
sudo dnf install -y python3.12 python3.12-pip python3.12-devel gcc gcc-c++ make rust cargo openssl-devel libffi-devel cmake git wget gawk zlib-devel perl-IPC-Cmd perl-bignum -
RHEL (9.6, 9.8, 10.0, 10.2)
sudo dnf install -y python3.12 python3.12-pip python3.12-devel gcc gcc-c++ make rust cargo openssl-devel libffi-devel -
SLES
sudo zypper -n in python313 python313-devel python313-pip gcc gcc-c++ make cmake git wget gawk libopenssl-devel libffi-devel rust cargo -
Ubuntu
sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gcc make wget curl libssl-dev libffi-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev liblzma-dev cargo pkg-config git cmake gawk sudo apt-get remove -y --ignore-missing python3-bcrypt
3. Configure Libexpat (For RHEL 8.10 and SLES)
-
Clone, Build and Install
SRC_DIR="${SRC_DIR:-$HOME/src}" REPO_DIR="$SRC_DIR/libexpat" BUILD_DIR="$REPO_DIR/expat/build" mkdir -p "$SRC_DIR" && cd "$SRC_DIR" git clone https://github.com/libexpat/libexpat.git "$REPO_DIR" rm -rf "$BUILD_DIR" && mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DEXPAT_BUILD_TESTS=OFF \ -DEXPAT_BUILD_EXAMPLES=OFF make -j"$(nproc)" sudo make install echo "/usr/local/lib64" | sudo tee /etc/ld.so.conf.d/00-local-expat.conf >/dev/null sudo /sbin/ldconfig || sudo /usr/sbin/ldconfig
4. Configure OpenSSL 3 (For RHEL 8.10)
-
Clone, Build and Install into a private prefix
wget -q "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" tar -xzf "openssl-${OPENSSL_VERSION}.tar.gz" cd "openssl-${OPENSSL_VERSION}" ./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX/ssl" \ --libdir=lib -Wl,-rpath,"$DEPS_PREFIX/lib" make -j"$(nproc)" sudo make install_sw install_ssldirs sudo ln -sf /etc/pki/tls/certs/ca-bundle.crt "$DEPS_PREFIX/ssl/cert.pem" cd "$SOURCE_ROOT"
5. Configure Python 3.13 (For Ubuntu)
-
Build and Install into a private prefix
cd "$SOURCE_ROOT" wget -q "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" tar -xzf "Python-${PYTHON_VERSION}.tgz" cd "Python-${PYTHON_VERSION}" ./configure --prefix=/opt/python3.13 --with-ensurepip=install make -j"$(nproc)" sudo make install cd "$SOURCE_ROOT"
6. Install additional python packages
-
RHEL 8.10
export OPENSSL_DIR="$DEPS_PREFIX" export PKG_CONFIG_PATH="$DEPS_PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" export RUSTFLAGS="-C link-arg=-Wl,-rpath,$DEPS_PREFIX/lib" python3.12 -m pip install -U pip setuptools wheel python3.12 -m pip install keystone==${PACKAGE_VERSION} uwsgi python-openstackclient -
RHEL (9.6, 9.8, 10.0, 10.2)
python3.12 -m pip install -U pip setuptools wheel python3.12 -m pip install keystone==${PACKAGE_VERSION} uwsgi python-openstackclient -
SLES
python3.13 -m pip install -U pip setuptools wheel python3.13 -m pip install keystone==${PACKAGE_VERSION} uwsgi python-openstackclient -
Ubuntu
sudo mkdir -p /opt/openstack sudo chown -R "$(whoami):$(id -gn)" /opt/openstack #Activate the python env /opt/python3.13/bin/python3 -m venv /opt/openstack/venv source /opt/openstack/venv/bin/activate pip install -U pip setuptools wheel pip install "cryptography<44.0.0" "bcrypt>=3.1.3" keystone==${PACKAGE_VERSION} python-openstackclient uwsgi deactivate echo "export PATH=/opt/openstack/venv/bin:\$PATH" | sudo tee /etc/profile.d/openstack-venv.sh >/dev/null export PATH="/opt/openstack/venv/bin:$PATH"
7. Verify Keystone installation(Optional)
keystone-manage --version