Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Installation (Native Setup)

Alexander Dubrawski edited this page Nov 17, 2020 · 6 revisions

Table of content

Get the Cockpit Source Code

  1. Clone the repository: git clone https://github.com/hyrise/Cockpit.git
  2. Enter the Cockpit directory: cd Cockpit

Running Cockpit on a different machine

If you want to install the Cockpit at a different machine you need to add a .env in the frontend folder first. For example, lets say you want to run the Cockpit on the machine with the IP 123.123.123.123 then run:

  1. Enter the front end directory: cd hyrisecockpit/frontend
  2. create a .env: touch .env
  3. Edit the .env the following way:
VUE_APP_BACKEND_HOST=123.123.123.123
VUE_APP_BACKEND_LISTENING=0.0.0.0
VUE_APP_BACKEND_PORT=8000

Install script

You can install and set up the cockpit in a virtual environment by executing the install script. It will install all packages and an influx (if none is installed). Just run:

./install_dependencies.sh

Install manually

Install Influx

First, you need to install the influx database:

https://docs.influxdata.com/influxdb/v1.8/introduction/install/

Create an environment

Create a venv folder within the Cockpit folder:

python3 -m venv venv

Activate the environment

Before you can install the project, activate the corresponding environment:

. venv/bin/activate

Adjust frontend path

To be able to start the frontend via python you need to set the path to the frontend. For that run:

sed -i "s:hyrisecockpit/frontend:$PWD/hyrisecockpit/frontend:g" hyrisecockpit/run.py

The python hyrisecockpit module will be installed at the location Cockpit/venv/lib/python3.8/site-packages/hyrisecockpit. In the installation process, all python files will be copied to this location. If we run the installed cockpit (hyrisecockpit module) the copied files are used. Because the process manager is part of the hyrisecockpit python module it needs to have an absolute path to the frontend. The frontend is not part of the hyrisecockpit python module. So the process manager can't use a relative path hyrisecockpit/frontend because it runs in Cockpit/venv/lib/python3.8/site-packages/hyrisecockpit and the frontend lies in Cockpit/hyrisecockpit/frontend. That's the reason why we need to adjust the frontend relative path variable for the process manager in an absolute path variable.

Install packages

To install all packages run:

pip3 install wheel && pip3 install -r requirements.txt

Install module

To install the Cockpit run:

pip3 install .

After that deactivate the environment since all python packages are installed:

deactivate

Last but not least reset the path to the frontend:

sed -i "s:$PWD/hyrisecockpit/frontend:hyrisecockpit/frontend:g" hyrisecockpit/run.py

While installing the Module python copies all python files to the package directory. That is the reason why we need to set the frontend path to an absolute path in the hyrisecockpit/run.py file. After the module is installed we can reset the path so it is more consistent with the file inside the repository.

Install frontend

To install the frontend run:

cd hyrisecockpit/frontend \
    && npm install --no-optional 
    && npm audit fix 
    && npm run build:min

Start the cockpit

First, you need to enter the environment. For that run:

. venv/bin/activate

Now you can start the cockpit with:

cockpit

If you just want to start the backend you can run:

cockpit --backend

If you want to close the cockpit just send an Interrupt ^C and exit the environment with deactivate.

Uninstall Cockpit

If you want to uninstall the cockpit run the following command to delete the python module:

rm -r venv

To uninstall all frontend related npm packages have a look at:

https://docs.npmjs.com/uninstalling-packages-and-dependencies

Hyrise

Docker Hyrise

You can add a Hyrise that is running in docker. On how to set up the Hyrise have a look at https://github.com/hyrise/Cockpit/wiki/Docker-Setup#add-a-hyrise-instance-in-the-frontend . If you use the Hyrise instance in the docker containers on the same machine, you can add them in the fronted UI (click on "database", click on "add database", enter the host and port) with:

(hyrise_1)
host: 0.0.0.0: 5432

(hyrise_2)
host: 0.0.0.0: 6432

If the docker Hyrise instances are running on a different machine lets say it has the IP 444.444.444.444 you can add them with:

(hyrise_1)
host: 444.444.444.444: 5432

(hyrise_2)
host: 444.444.444.444: 6432

Native Hyrise

It is important to use a Hyrise that is set up correctly. For that please have a look at https://github.com/hyrise/Cockpit/wiki/Hyrise-Things .

If the Hyrise is running on the same machine you can add them in the fronted UI (click on "database", click on "add database", enter the host and port) with:

host: 0.0.0.0 port: Is the port that you set by starting the Hyrise (default is 5432)

If the Hyrise is running on a different machine lets say it has the IP 444.444.444.444 you can add a Hyrise with:

host: 444.444.444.444 port: Is the port that you set by starting the Hyrise (default is 5432)