Skip to content

Commit

Permalink
Agent in Go and Zenoh
Browse files Browse the repository at this point in the history
  • Loading branch information
philrhc authored and xcasas committed Oct 22, 2024
1 parent ca180f8 commit 9588d47
Show file tree
Hide file tree
Showing 126 changed files with 8,468 additions and 5,721 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ FodyWeavers.xsd
hs_err_pid*
replay_pid*

.vscode/
**/.vscode/

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

Expand Down
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,27 @@ This GitHub repository contains all the files and software necessary to deploy a
## Repository Structure
The repository is organized into the following directories and files:
### Directories
- **agent**: Contains all the code necessary to deploy a COLMENA Agent.
- **dcp**: Contains all the necessary code to deploy a Centralized Colmena Platform to coordinate the COLMENA Agents.
- **library**: Contains all the necessary code to test the code.
- **agent**: Contains the code of a COLMENA Agent.
- **agent-zenoh-client**: Rust interface service to Zenoh.
- **agent-zenoh-router**: Contains files to start up the zenoh router as a Docker container.

### Files
- **.gitignore**: Specifies files and directories to be ignored by Git.
- **CODE_OF_CONDUCT.md**: Outlines the expected behavior and guidelines for participants within the project's community.
- **compose.yaml**: Configuration file for the multi-container application.
- **CONTRIBUTING.md**: Overview of the repository, setup instructions, and basic usage examples.
- **LICENSE**: License information for the repository.
- **README.md**: Overview of the repository, setup instructions, and basic usage examples.
- **setting.gradle**: Configuration of gradle to build the project
- **setting.gradle**: Configuration of gradle to build the project.


## Getting Started
To get started with deploying a COLMENA agents, follow these steps:
1. Build the DCP and the agent
```bash
gradle clean assemble
```
The project can also be build using gradle's docker image:
```bash
docker run --rm -v .:/home/gradle gradle:8.9.0-jdk17 gradle clean assemble
```
2. Starting DCP
In this initial prototype, COLMENA agents require a centralized version of the Colmena platform. Before deploying the Agents, the DCP (Distributed Colmena Platform) needs to be deployed. The following command deploys the DCP on the local node on port 5555:
```bash
java -classpath <path_to_agent_repository_root>/dcp/build/libs/dcp-0.0.1-all.jar es.bsc.colmena.dcp.Application
```
1. Start Zenoh router
`docker compose -f agent-zenoh-router/compose.yaml up --abort-on-container-exit`

3. Starting the Agents
Once DCP is running, then Agents can be started. Since they do not have neighbor discovery implemented, they need an endpoint to enter the Colmena platform. Likewise, Colmena does not provide Agents with mechanisms for self-discovery to identify its capabilities. Hence, the capabilities of the Agents need to be indicated at booting time. Currently, two capabilities can be indicates CPU - for high processing capacity - and CAMERA - to capture images -.
On the other hand, Agents are not able to read any configuration file to indicate which policy to use; therefore, the policy needs to be indicated. Agents can be started in Eager or Lazy mode. In Eager mode, Agent will start all possible roles. In Lazy mode, Agent will only start roles with broken KPIs.
2. Start COLMENA agent
`DEVICE_STRATEGY=EAGER or LAZY DEVICE_HARDWARE=XYZ docker compose -f compose.yaml up --abort-on-container-exit`

The following command starts an agent capable of collecting images driven by the EAGER policy and contacting the COLMENA DCP deployed in localhost:5555.
``` bash
java -classpath <path_to_agent_repository_root>/agent/build/libs/agent-0.0.1-all.jar es.bsc.colmena.Application localhost 5555 EAGER CAMERA
```

## Contributing
Please read our [contribution guidelines](CONTRIBUTING.md) before making a pull request.
Expand Down
Loading

0 comments on commit 9588d47

Please sign in to comment.