Skip to content

Latest commit

 

History

History

cloud

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Elastic-Node v5

Run Container Image

A Container should be run with:

docker run \
    --rm \ #(1)
    --network=runtime-network \ #(2)
    --publish 8081:80 \ #(3)
    --name ballchallenge \ #(4)
    --env PUBLIC_IP=$(hostname -I) \ #(5)
    --env BROKER_PORT=1883 \ #(5)
    --env BROKER_IP=127.0.0.1 \ #(5)
    --env CAMERA_PORT=8888 \ #(5)
    --env CAMERA_IP=127.0.0.1 \ #(5)
    ghcr.io/es-ude/elastic-ai.cloud.applications.ball_challenge:<tag>
  1. Remove the container after shutdown

  2. Required to communicate with the docker container running the MQTT broker

  3. Port mapping for the webserver port, which allows the webinterface to be accessible from your browser (host:container)

  4. Specify the name of the container

  5. Set Variables for the app

💡
To ease your usage of the container it is recommended to provide an environment file instead of add each variable as a parameter.
ℹ️
An example compose file is provided under compose.yml.

Development

Setup

For compiling the project, no additional tools are required.

We recommended pre-commit to check that the commit messages align with the conventional commit message standard.

Tests

Unit tests and integration tests can be executed independently. Both use jacoco to finalize the tests with a report that shows the test results and the code coverage. The reports can be found in the location build/reports/ relative to the corresponding build file.

Command Task

./gradlew :app:test

Run all unit tests

./gradlew :app:integrationTest

Run all Integration test

Local Execution

This repository provides the BallChallenge application. A specific implementation for the Ball Challenge. To start the application locally via Gradle run:

bootRun
PUBLIC_IP=$(hostname -I) \
CAMERA_IP=127.0.0.1 CAMERA_PORT=8888  \
./gradlew :app:bootRun
ℹ️
Environment Variables

Variables for the application are passed via Environment variables. This can be accomplished by either passing them to the gradle call like shown before (bootRun). Or by using a .envrc file in combination with a tool like direnv to automatically load them.

Profiles

For switching application profiles (lab, development, deploy) you can pass the selected one with

SPRING_PROFILES_ACTIVE=<profile> ... ./gradlew ...

Build Container Image

A container image can be created with:

build image
docker build -f Dockerfile -t ghcr.io/es-ude/ballchallgne:develop

This container can then be used in a docker-compose file or started manually as described in Run Container Image