Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
16 changes: 16 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

name: "Issue template"
about: "Minimal info about an issue"
title: ""
ref: "devel"

---

## Description


<!--- ## Screenshots (if appropriate): -->

## References
<!--- Create a list of references, (in a bullet style) -->
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description


## Motivation and context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


<!--- ## Screenshots (if appropriate): -->

## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] All TODOs in the code have been resolved or linked to a proper issue.
- [ ] Code has been (auto)formatted.
- [ ] Documentation (e.g., README, CHANGELOG, Wiki) has been updated.
- [ ] All automated checks have passed.

---
Clickup task: [hash](link)
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Pre-Commit

on:
push:

jobs:
pre-commit:
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
with:
ros_distro: humble
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.9.0
hooks:
- id: pre-commit-update

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: [-L, passt, -w]
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# robolab_mlops
# robolab_mlops

Collection of all services used in Robotics Laboratory (mainly for the [Aegis robot](https://github.com/AGH-CEAI/aegis_ros)).

## List of services with their default ports

* [containers_registry](http://localhost:5000)
* [portainer](http://localhost:8999)
* [ppa_packages](http://localhost:80/debian)

## Start all services

```bash
# In the main directory
docker compose up -d
```

## Shutdown all services

```bash
# In the main directory
docker compose down
```

---

### Private Packages Repo (PPA)

How to Set up private repo [here](./ppa_packages/README.md).

**Adding private repo**
```bash
echo "deb [trusted=yes] http://192.168.0.100/debian ./" | tee -a /etc/apt/sources.list > /dev/null
```
### Containers registry

[Instructions how to use self-hosted container registry.](./containers_registry/README.md)

#### Building & pushing a particular release tag
```bash
export REGISTRY_HOSTNAME=geonosis:5000
export AEGIS_ROS_VERSION=<TAG>
export AEGIS_CONTAINER_VERSION=<TAG>

# if the building is happening on the same machine as PPA server, add argument:
# --add-host $(hostname):$(hostname -I | awk '{print $1}')
podman build . -t ceai/aegis_dev:${AEGIS_CONTAINER_VERSION} --build-arg AEGIS_ROS_TAG=${AEGIS_ROS_VERSION}
podman tag ceai/aegis_dev:${AEGIS_CONTAINER_VERSION} ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}
podman image inspect --format='{{json .Config.Labels}}' ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}

podman push ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}
```

#### Pulling & entering a particular release tag
```bash
export REGISTRY_HOSTNAME=geonosis:5000
export AEGIS_CONTAINER_VERSION=<TAG>

podman pull ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}
podman image inspect --format='{{json .Config.Labels}}' ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}

toolbox create --image ${REGISTRY_HOSTNAME}/ceai/aegis:${AEGIS_CONTAINER_VERSION}
toolbox enter aegis-${AEGIS_CONTAINER_VERSION}
```
5 changes: 5 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: robolab-ops
include:
- containers_registry/compose.yml
- portainer/compose.yml
- ppa_packages/compose.yml
60 changes: 60 additions & 0 deletions containers_registry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Containers registry

This service allows to self-host container registry for Podman/Docker.

Based on [this](https://infotechys.com/host-your-own-podman-registry/) tutorial.


## Prepare the host
```bash
export REGISTRY_PATH=/var/lib/registry
sudo mkdir -p $REGISTRY_PATH
```

## Run the service
```bash
podman-compose up -d
# or
docker compose up -d
```

## Setup the clients
The easiest way is to provide the registry address manually:
```bash
sudo vim /etc/containers/registries.conf
```

Assuming that `HOSTNAME` is your host IP address:
```
[[registry]]
location = "HOSTNAME:5000"
insecure = true
```

> [!WARNING]
> This configuration is NOT SAFE. Consider setting up proper SSL certificates before running on your machine.

Restart the contenerization engine:
```bash
sudo systemctl restart podman
# or
sudo systemctl restart docker
```

## Use it

### Push
```bash
podman images
podman tag localhost/example:latest HOSTNAME:5000/example:latest
podman push HOSTNAME:5000/example:latest
```

### Pull
```bash
podman pull HOSTNAME:5000/example:latest
podman images
```

---
[Back to main README](../README.md)
10 changes: 10 additions & 0 deletions containers_registry/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
containers_registry:
image: docker.io/library/registry:2
# container_name: containers_registry
privileged: true
restart: always
ports:
- "5000:5000"
volumes:
- /srv/data/hosting/volumes/containers_registry:/var/lib/registry
13 changes: 13 additions & 0 deletions portainer/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
portainer:
image: portainer/portainer-ce:latest
restart: always
ports:
# - "8000:8000" # Secure TLS port for remote control
- "9443:9443"
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
volumes:
portainer_data:
10 changes: 10 additions & 0 deletions ppa_packages/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:24.04

RUN apt-get update \
&& apt-get install -y \
apache2 \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

CMD ["apachectl", "-D", "FOREGROUND"]
41 changes: 41 additions & 0 deletions ppa_packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Private Packages Repo (PPA)

This module enables storing private *.deb packages used for automated container built.

More [here](https://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository).

## Preparing packages

**Copy packages:**

Copy all `*.deb` packages into the `./packages` directory.

**Generate package list:**

* After moving all packages to the `./packages` directory, you need to generate the **package list**.
* On a Debian-based system (e.g., Ubuntu), run the following command inside the `./packages` directory.
* There is **no need** to run this inside the container.
```bash
dpkg-scanpackages . | gzip -c9 > Packages.gz
```
or
```bash
sudo sh -c 'dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz'
```

* Done! The PPA server is now ready to serve packages.

## Running Server

**Docker Compose**:
```bash
docker compose up -d
```
You can check the PPA in your webbrowser: `http://HOST/debian/`.

### Adding new packages

Follow `Preparing packages` step and the list of packages will automatically update.

---
[Back to main README](../README.md)
10 changes: 10 additions & 0 deletions ppa_packages/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
ppa_packages:
build:
context: .
dockerfile: "${DOCKERFILE:-Dockerfile}"
ports:
- 80:80
restart: always
volumes:
- /srv/data/hosting/volumes/ppa_packages:/var/www/html/debian