Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance project description #97

Merged
merged 4 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions README.developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Hirte

## Development

### Environment Setup

In order to develop the project you need to install following dependencies.

#### Prerequisities

To build the project on CentOS Stream 9 you need to enable CodeReady Build repository:
```bash
sudo dnf install dnf-plugin-config-manager
sudo dnf config-manager --set-enabled crb
```

#### Dependencies installation

```bash
sudo dnf install clang-tools-extra gcc make meson systemd-devel
```

### Code Style

[clang-format](https://clang.llvm.org/docs/ClangFormat.html) is used to enforce a unified code style. All source files can be formatted via:
```bash
make fmt
```

For the most part, this project follows systemd coding style: [systemd-coding-style](https://github.com/systemd/systemd/blob/main/docs/CODING_STYLE.md).
Also, this project borrows some of the coding conventions from systemd. For example, function names pertaining to D-Bus services look like <code>bus_service_set_property()</code>.

A formatting check of existing files can be executed by:
```bash
make check-fmt
```

### Linting

[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) is used for static analysis. All source files can be checked via:
```bash
make lint
```

Some errors detected by `clang-tidy` can be fixed automatically via:
```bash
make lint-fix
```

### Build

The project is using [meson](https://mesonbuild.com/) build system.

The binaries can be built via
```bash
meson setup builddir
meson compile -C builddir
```

After successfully compiling the binaries, they can be installed into a destination directory (by default `/usr/local/bin`) using:
```bash
meson install -C builddir
```

To install it into `builddir/bin` use:
```bash
meson install -C builddir --destdir bin
```

After building, three binaries are available:
- __hirte__: the orchestrator which is run on the main machine, sending commands to the agents and monitoring the progress
- __hirte-agent__: the node agent unit which connects with the orchestrator and executes commands on the node machine
- __hirtectl__: a helper (CLI) program to send an commands to the orchestrator

### Unit tests

Unit tests can be executed using following commands
```bash
meson setup builddir
meson compile -C builddir
meson test -C builddir
```

### Running

At the moment the hirtectl binary do only print a simple greeting and exit.

#### hirte

Hirte, the orchestrator can be run via:
```bash
hirte -c ./doc/example.ini
```
It starts a tcp socket and accepts connections, but does not do much more at this point.
This can be tested manually via
```bash
nc <host> <port>
```

#### hirte-node

Nodes can be run via:
```bash
./bin/hirte-agent -n <agent name> -H <host> -P <port>
```
It creates a new dbus which tries to connect to the specified host. The host will print out a message if the request was accepted. It does not do much more at this point.

## Documentation

For further documentation please refer to the [doc](./doc/) directory.

The target architecture for this project is described in [doc/arch](./doc/arch/)
122 changes: 20 additions & 102 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,116 +1,34 @@
<p align="center">
<h2 align="center">Hirte</h3>
</p>
# Hirte

---
Hirte is a service orchestrator tool intended for multi-node devices (e.g.: edge devices) clusters
with a predefined number of nodes and with a focus on highly regulated environment such as those requiring functional
safety (for example in cars).

## Development
Hirte is relying on [systemd](https://github.com/systemd/systemd) and its D-Bus API, which
it extends for multi-node use case.

### Environment Setup
Hirte can also be used to orchestrate containers using [podman](https://github.com/containers/podman/) and its ability
to generate systemd service configuration to run a container.

In order to develop the project you need to install following dependencies.
## How to contribute

#### Prerequisities
### Submitting patches

To build the project on CentOS Stream 9 you need to enable CodeReady Build repository:
```bash
sudo dnf install -y dnf-plugin-config-manager
sudo dnf config-manager -y --set-enabled crb
```
Patches are welcome!

#### Dependencies installation
Please submit patches to [github.com:containers/hirte](https://github.com/containers/hirte).
More infomation about the development can be found in [README.developer](https://github.com/containers/hirte/README.developer.md).

```bash
sudo dnf install -y clang-tools-extra gcc make meson systemd-devel
```
If you are not familiar with the development process you can read about it in
[Get started with GitHub](https://docs.github.com/en/get-started).

### Code Style

[clang-format](https://clang.llvm.org/docs/ClangFormat.html) is used to enforce a unified code style. All source files can be formatted via:
```bash
make fmt
```
### Found a bug or documentation issue?
To submit a bug or suggest an enhancement for hirte please use
[GitHub issues](https://github.com/containers/hirte/issues).

For the most part, this project follows systemd coding style: [systemd-coding-style](https://github.com/systemd/systemd/blob/main/docs/CODING_STYLE.md).
Also, this project borrows some of the coding conventions from systemd. For example, function names pertaining to D-Bus services look like <code>bus_service_set_property()</code>.

A formatting check of existing files can be executed by:
```bash
make check-fmt
```
## Still need help?
If you have any other questions, please join [CentOS Automotive SIG mailing list](https://lists.centos.org/mailman/listinfo/centos-automotive-sig/) and ask there.

### Linting

[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) is used for static analysis. All source files can be checked via:
```bash
make lint
```

Some errors detected by `clang-tidy` can be fixed automatically via:
```bash
make lint-fix
```

### Build

The project is using [meson](https://mesonbuild.com/) build system.

The binaries can be built via
```bash
meson setup builddir
meson compile -C builddir
```

After successfully compiling the binaries, they can be installed into a destination directory (by default `/usr/local/bin`) using:
```bash
meson install
```

To install it into `builddir/bin` use:
```bash
meson install -C builddir --destdir bin
```

After building, three binaries are available:
- __hirte__: manager, the central unit which is run on the main machine, sending commands to the nodes and monitoring the progress
- __hirte-agent__: the executing unit which connects with the manager and executes commands on the node machine
- __hirtectl__: a helper program to send an commands to the manager

### Unit tests

Unit tests can be executed using following commands
```bash
meson setup builddir
meson compile -C builddir
meson test -C builddir
```

### Running

At the moment the hirtectl binary do only print a simple greeting and exit.

#### hirte

Hirte, the orchestrator can be run via:
```bash
./bin/hirte -P <port>
```
It starts a tcp socket and accepts connections, but does not do much more at this point.
This can be tested manually via
```bash
nc <host> <port>
```

#### hirte-node

Nodes can be run via:
```bash
./bin/hirte-agent -H <host> -P <port>
```
It creates a new dbus which tries to connect to the specified host. The host will print out a message if the request was accepted. It does not do much more at this point.

## Documentation

For further documentation please refer to the [doc](./doc/) directory.

The target architecture for this project is described in [doc/arch](./doc/arch/)