-
Notifications
You must be signed in to change notification settings - Fork 0
Setup: migrate hosting services #1
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
macmacal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### 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} | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
macmacal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
macmacal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.