Skip to content

Commit

Permalink
Add/update installation scripts, update README with versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stano45 committed Aug 22, 2024
1 parent af59f69 commit 455509b
Show file tree
Hide file tree
Showing 8 changed files with 1,094 additions and 34 deletions.
30 changes: 9 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@ This is the repository for the Google Summer of Code project [P4-Enabled Contain
- [Installation](#installation)
- [Prerequisites](#prerequisites)
- [Install Python Dependencies](#install-python-dependencies)
- [Installing PI](#installing-pi)
- [Build Custom Podman Images](#build-custom-podman-images)
- [Running examples](#running-examples)


## Installation

### Prerequisites
- [Podman](https://podman.io/docs/installation)
- [Python 3](https://www.python.org/downloads/)
- [pip](https://pip.pypa.io/en/stable/installation/)
- [P4 Compiler (p4c)](https://github.com/p4lang/p4c)
- [Python 3](https://www.python.org/downloads/) (3.10+)
- [pip3](https://pip.pypa.io/en/stable/installation/)
- [CRIU](https://criu.org/Main_Page) (v3.19)
- [crit](https://criu.org/CRIT) (v3.19)
- [P4 Compiler](https://github.com/p4lang/p4c) (v1.2.4.14)
- [PI](https://github.com/p4lang/PI)
- [Podman](https://podman.io/docs/installation) (v5.2.1)

We have provided [scripts](scripts) to install CRIU (with crit), the P4 compiler, PI, and Podman. The scripts have been tested on Ubuntu 22.04 and 24.04 and are not guaranteed to work on all machines. If you encounter any issues, please refer to the official documentation of the respective projects.

### Install Python Dependencies
```bash
Expand All @@ -28,22 +32,6 @@ source .venv/bin/activate
pip install -r requirements.txt
```

### Installing PI
This project uses the P4Runtime API to communicate with the switch. The P4Runtime API is implemented in the [P4Runtime Interface (PI)](https://github.com/p4lang/PI).

When installing PI, make sure to configure with the `--with-proto` flag to compile proto files and `--with-python_prefix=/path/to/this/repo/.venv` to install the p4 library in your virtual environment. For example:
```bash
./configure --with-proto --with-python_prefix=/absolute/path/to/p4containerflow/.venv
```
After running:
```bash
sudo make install
```
The p4 library files in your `.venv` will be owned by the root user. Make sure to change owner by running:
```bash
sudo chown -R $USER .venv
```

### Build Custom Podman Images
```bash
make images
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ grpcio==1.64.1
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==2.1.5
protobuf==5.27.2
protobuf==3.20.0
scapy==2.5.0
Werkzeug==3.0.3
5 changes: 5 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Scripts

This directory contains scripts to install CRIU, the P4 compiler, PI and Podman. The scripts have been tested on Ubuntu 22.04 and 24.04 and are not guaranteed to work on all machines. If you encounter any issues, please refer to the official documentation of the respective projects.

The `edit_files_img.py` script is used to edit the `files.img` file in a container checkpoint by rewriting the socket IP address. This is used by some of the examples to successfully restore containers with a changing IP address.
Loading

0 comments on commit 455509b

Please sign in to comment.