perfspec-learning/install.md
Jesús Pérez Lorenzo 7ddae10847 chore: fix typos
2025-01-27 20:56:50 +00:00

3.4 KiB

Table of Contents

PerfSPEC Learning Phase INSTALLATION

By follwing thesed steps you can easy run PerfSPEC notebooks

Python

Caution

Due to TensorFlow requiremens Python 3.12 is the latest compatible

For Linux

I end up by downloading Python soruce and compile

For MacOS

Use Homebrew

brew install python@3.12 python3-pip

Warning

After install Python with pip and virtualenv
Install TensorFlow requiremens

pip install tensorflow

Package manager

Use uv

An extremely fast Python package and project manager, written in Rust.

MacOS and Linux

sudo curl -LsSf https://astral.sh/uv/install.sh | sh

To add $HOME/.local/bin to your PATH, either restart your shell or run:

source $HOME/.local/bin/env (sh, bash, zsh)
source $HOME/.local/bin/env.fish (fish)

Notebook tool

Rather than use Jupyter this project use Marimo for a lot of good reasons !

Marimo

python -m venv marimo-env
source marimo-env/bin/activate
uv pip install marimo

Check with marimo tutorial intro --no-token

A web server should be run at http://localhost:2718 with a token if not use --no-token option for a non secure session

Marimo configuration is in $HOME/.config/marimo.toml

PerfSPEC Learning Phase

1 - git clone this repository

git clone https://repo.jesusperez.pro/jesus/perfSPEC-learning.git
cd perfspec-learning

2 - Make structures

For data use data_sample.tar.xc

tar xvJf data_sample.tar.xz 

For trained models use models_sample.tar.xz

tar xvJf models_sample.tar.xz 

Raw log file raw-audit-logs.log.xz is included in data directory

3 - Run notebook tool like this

Inside perfspec-learning path

cd  learning/python 
uvx marimo edit   --no-token   --watch

Connect with a browser to http://localhost:2718

Start with run_perfspec.py

Important

A red box will appear at top left corner prompting to install required packages for the loaded notebook, in console where localhost:2718 appers listening uv will do the magic by installing them using pip

Note each notebook can import some extra packages like train_perfspec.py

In any case some notebook import content from others.

Tip

When all notebooks have being loaded it will be posible also to use them as a Python script by run it in a terminal o console like this:

python model_perfspec.py -- --help 

There is also an static html mode to be used, more info: script mode

Some Python packages could be not detected and will require manual installation via command-line, simply for example, use:

uv pip install scikit-learn
uv pip install prettytable