Installation¶
Quickstart¶
Install requirements:
# For OpenSUSE:
sudo zypper in python3-pip python3-tox
sudo zypper in $(tox -qq -e bindep -- -b)
sudo systemctl start docker
sudo usermod -aG docker $USER
# For Ubuntu:
sudo apt install python3-pip tox
sudo apt install $(tox -qq -e bindep -- -b)
sudo systemctl start docker
sudo usermod -aG docker $USER
# For Fedora:
sudo dnf install python3-pip python3-tox
sudo dnf install $(tox -qq -e bindep -- -b)
sudo systemctl start docker
sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker
newgrp docker
Requiremnets¶
Requirements are tracked with bindep and pip’s requiements.txt.
First we need python-tox to be able to manage our virtual environments. Version 3.15.2 or greater is recommended as it fixes an issue with cleaning up resources when being manually terminated. This is best installed from pip, but could alternatively be installed from your system packages.
# For OpenSUSE:
sudo zypper in python3-pip python3-tox
# For Ubuntu:
sudo apt install python3-pip tox
# For Fedora
sudo dnf install python3-pip python3-tox
# If your distro does not have tox >= 3.15.2, then you can alternatively
# install or upgrade it from pypi:
sudo zypper in python3-pip
# or
sudo apt install python3-pip
# or
sudo dnf install python3-pip
sudo pip install -U tox
Next we run bindep from inside a tox environment to get the list of missing system packages. By specifying the ROOKCHECK_HARDWARE_PROVIDER and ROOKCHECK_DISTRO we are going to use we can ensure the requirements for our infrastructure are met (see Configuration for more information):
ROOKCHECK_HARDWARE_PROVIDER=libvirt
ROOKCHECK_DISTRO=openSUSE_k8s
# Alternatively, source these from .env if you have already set up your
# configuration.
tox -e bindep ${ROOKCHECK_HARDWARE_PROVIDER} ${ROOKCHECK_DISTRO}
Then we can take the list and install them.
# For OpenSUSE:
sudo zypper in <output from bindep command>
# For Ubuntu:
sudo apt install <output from bindep command>
# For Fedora:
sudo dnf install <output from bindep command>
Or as one command the above can be:
# For OpenSUSE:
sudo zypper in $(tox -qq -e bindep -- -b ${ROOKCHECK_HARDWARE_PROVIDER,,} ${ROOKCHECK_DISTRO,,})
# For Ubuntu:
sudo apt install $(tox -qq -e bindep -- -b ${ROOKCHECK_HARDWARE_PROVIDER,,} ${ROOKCHECK_DISTRO,,})
# For Fedora:
sudo dnf install $(tox -qq -e bindep -- -b ${ROOKCHECK_HARDWARE_PROVIDER,,} ${ROOKCHECK_DISTRO,,})
One of the system requirements to build rook is docker. Make sure the docker daemon is running:
sudo systemctl start docker
You may also need to make sure your user is in the docker group:
sudo usermod -aG docker $USER
# For fedora:
sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker
newgrp docker
Verify that you can run docker:
docker run hello-world
If that fails then see your systems instructions for setting up docker.