From 2a52e71c0441ad4460a8a3999504d1fdb79cefea Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 6 Feb 2023 10:00:40 +0100 Subject: [PATCH] Update installation docs, remove maven from dockerfile (#342) Update installation docs and Dockerfile: after remove durable-rules and using pre-built wheels of jpy some installation steps are outdated. Closes: https://issues.redhat.com/browse/AAP-8928 --- Dockerfile | 2 +- docs/installation.rst | 56 ++++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 967d3b7f..97babe0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG DEVEL_COLLECTION_LIBRARY=0 WORKDIR $HOME USER 0 -RUN dnf install -y java-17-openjdk-devel maven +RUN dnf install -y java-17-openjdk-devel ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk RUN pip install -U pip \ && pip install ansible \ diff --git a/docs/installation.rst b/docs/installation.rst index 0af82852..475a5990 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -11,31 +11,35 @@ Requirements * Python >= 3.8 * Python 3 pip - * Fedora: python3-devel - * Ubuntu: python3-dev - * Java development kit >= 17 * Fedora: java-17-openjdk * Ubuntu: openjdk-17-jdk -* Maven >=3.8 Installation via pip -------------------- + 1. Ensure the `JAVA_HOME` environment variable is set if you have multiple Java installations. On Fedora-like systems it should be:: JAVA_HOME=/usr/lib/jvm/java-17-openjdk + 2. Install `ansible-rulebook` and dependencies via `pip`:: - pip install wheel ansible-rulebook ansible ansible-runner + pip install ansible-rulebook ansible ansible-runner + +.. note:: + + ansible-rulebook relies on the `jpy` Python package to communicate with the Java runtime. This package provide wheels for the most common platforms, + `but not for all `_. If you are using a platform that is not supported by `jpy` wheels, you will need to compile it by yourself. + Look at the `Compiling jpy section <#compiling-jpy>`_ for more information. -3. Install the required Ansible collections:: - ansible-galaxy collection install community.general ansible.eda +3. Install the `optional ansible collection `_ for EDA + Installation examples --------------------- @@ -44,19 +48,37 @@ On Fedora-like systems: .. code-block:: shell - dnf --assumeyes install java-17-openjdk maven python3-pip - export JDK_HOME=/usr/lib/jvm/java-17-openjdk - export JAVA_HOME=$JDK_HOME - pip3 install -U Jinja2 - pip3 install ansible ansible-rulebook ansible-runner wheel + dnf --assumeyes install java-17-openjdk python3-pip + export JAVA_HOME=/usr/lib/jvm/java-17-openjdk + pip3 install ansible ansible-rulebook ansible-runner On Ubuntu systems: .. code-block:: shell - apt-get --assume-yes install maven openjdk-17-jdk python3-pip - export JDK_HOME=/usr/lib/jvm/java-17-openjdk-amd64 - export JAVA_HOME=$JDK_HOME + apt-get --assume-yes install openjdk-17-jdk python3-pip + export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 export PATH=$PATH:~/.local/bin - pip3 install -U Jinja2 - pip3 install ansible ansible-rulebook ansible-runner wheel + pip3 install ansible ansible-rulebook ansible-runner + + +Compiling jpy +--------------------- + +To compile `jpy` from source at installation time, you will need to install the additional dependencies: + +* maven +* gcc +* python-devel package + * Fedora: python3-devel + * Ubuntu: python3-dev +* Environment variable `JAVA_HOME` set to the path of your Java installation + +Then, you can run: + +.. code-block:: shell + + pip install ansible-rulebook --no-binary jpy + + +Refer to the `jpy project `_ for more information.