Skip to content
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
10 changes: 10 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ RUN apt update -q=2 && \
VOLUME /opt/conf

CMD ["/entrypoint.sh"]

#
# Coordinator statsd
#
FROM labgrid-base AS labgrid-coordinator-statsd
ARG VERSION

RUN pip3 install "statsd>=4.0.1"

Comment thread
krevsbech marked this conversation as resolved.
ENTRYPOINT ["/opt/labgrid/contrib/coordinator-statsd.py"]
21 changes: 18 additions & 3 deletions dockerfiles/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ for the 3 different components of a Labgrid distributed infrastructure.
- **labgrid-coordinator**
An image with the Labgrid coordinator.
a Labgrid coordinator instance.
- **labgrid-coordinator-statsd**
An image with a statsd reporter for the Labgrid coordinator.
- **labgrid-client**
An image with the Labgrid client tools and pytest integration.
- **labgrid-exporter**
Expand All @@ -27,7 +29,7 @@ Example showing how to build labgrid-client image:
Using `BuildKit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_
is recommended to reduce build times.

You can also choose to build all 3 images with the included script. The script
You can also choose to build all images with the included script. The script
will automatically use `docker buildx
<https://docs.docker.com/engine/reference/commandline/buildx/>`` if available.

Expand All @@ -39,7 +41,6 @@ will automatically use `docker buildx
The script supports ``podman`` as well.

.. code-block:: bash

$ export DOCKER=podman
$ ./dockerfiles/build.sh

Expand Down Expand Up @@ -79,6 +80,20 @@ so you can restart the service without losing state.
docker.io/labgrid/coordinator


labgrid-coordinator-statsd usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The labgrid-coordinator-statsd image can be used to run a statsd reporter for the coordinator.

The address of the statsd server and other options can be configured using parameters as passed to the ``contrib/coordinator-statsd.py`` script.
For example, to run the statsd reporter with a coordinator at 192.168.1.42:20408:

.. code-block:: bash

$ docker run -e LG_COORDINATOR=192.168.1.42:20408 docker.io/labgrid/coordinator-statsd \
--statsd-server=192.168.1.50

Comment thread
krevsbech marked this conversation as resolved.

labgrid-client usage
~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -141,7 +156,7 @@ client:
.. code-block:: bash

$ cd dockerfiles/staging
$ CURRENT_UID=$(id -u):$(id -g) docker compose up -d coordinator exporter dut
$ CURRENT_UID=$(id -u):$(id -g) docker compose up -d coordinator coordinator-statsd exporter dut

To run the smoke test just run the client:

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ perform_regular_build() {

log_info "building for native platform only."

for t in client exporter coordinator; do
for t in client exporter coordinator coordinator-statsd; do
"${docker_cmd}" build --build-arg VERSION="${version}" \
--target labgrid-${t} -t "${IMAGE_PREFIX}${t}:${IMAGE_TAG}" -f "${script_dir}/Dockerfile" \
"${extra_args[@]}" .
Expand All @@ -73,7 +73,7 @@ perform_docker_buildx_build() {
version="${3}"
extra_args=("${@:4}")

for t in client exporter coordinator; do
for t in client exporter coordinator coordinator-statsd; do
"${docker_cmd}" buildx build --build-arg VERSION="${version}" \
--target labgrid-${t} -t "${IMAGE_PREFIX}${t}:${IMAGE_TAG}" -f "${script_dir}/Dockerfile" \
"${extra_args[@]}" .
Expand Down
5 changes: 5 additions & 0 deletions dockerfiles/staging/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ services:
network_mode: "host"
command: bash -c "cp /home/root/coordinator/places_example.yaml /opt/coordinator/places.yaml &&
/usr/local/bin/labgrid-coordinator"
coordinator-statsd:
image: "${IMAGE_PREFIX:-docker.io/labgrid/}coordinator-statsd"
network_mode: "host"
depends_on:
- coordinator
client:
image: "${IMAGE_PREFIX:-docker.io/labgrid/}client"
volumes:
Expand Down
Loading