2024-04-08 12:10:02 +00:00
2024-04-17 16:32:27 +02:00
2024-04-16 12:34:13 +00:00

SAP Sailing Analytics

Description

This is the software running the SAP Sailing Analytics platform as seen on sapsailing.com

Sailing provides the perfect platform for SAP to showcase solutions and help the sport run like never before. SAPs involvement in the sport has transformed the sailing experience by providing tools, which:

  • Help sailors analyze performance and optimize strategy
  • Bring fans closer to the action
  • Provide the media with information and insights to deliver a greater informed commentary

SAP has a longstanding involvement with sailing and has established a portfolio spanning across teams and regattas.

Requirements

The software can be run on any Linux or Windows machine with bash installed; it has also been compiled successfully for the ARM platform and was deployed to a Raspberry Pi computer. As a database, MongoDB is required, tested with releases 4.4, 5.0, and 6.0. For use in a replicated scenario (scale-out, high availability), RabbitMQ is required. Docker Compose can be used to tie these three components together, as Docker images are produced on a regular basis.

Compute node and database sizing depends on several aspects of your workloads, such as whether live or replay data is to be served, how many different classes with separate leaderboard are racing concurrently, how many competitors are racing in each class, or how many concurrent viewers produce how many requests and which type (e.g., analytical, data mining, or watching a live race).

To quantify this at least approximately, here are a few examples for typical node sizes that can handle such types of events reasonably well:

  • National sailing league event; six boats, 18 competitors, a single live leaderboard: 8GB of RAM and 4-8 CPUs
  • Large multi-class event with 15 classes with their separate leaderboards, concurrently racing on six course areas: 16GB of RAM, 16 CPUs
  • Archive of 30,000 races with a few thousand visitors per day with varying analytical and replay workloads: 64GB RAM, 2TB NVMe swap, 8 CPUs

A single node typically handles up to 500 concurrent viewers for live events. You will want to scale out accordingly, using the replication pattern offered by the solution which uses RabbitMQ for transaction log shipping.

Contributing

To start contributing, read the onboarding document at the following URL: https://wiki.sapsailing.com/wiki/howto/onboarding. The project welcomes contributions in the form of pull requests, for example, enhancements of the Data Mining functionality, including any sailing-specific metric or dimension you may think of and that you find is still missing so far; or additional features for the race viewer; or a map visualization that does not require a Google Map but uses Open Street Map / Open Layers; landscape automation; improved start sequence analytics; major UI improvements for the administrative layer ("AdminConsole"), etc.

The issue tracker at https://bugzilla.sapsailing.com is currently used for any sort of issue and enhancement request tracking. Help to migrate this smoothly to Github Issues would be much appreciated, ideally keeping issue numbers stable due to many references to those Bugzilla bug numbers, be it in the source code, the Wiki, or the build infrastructure.

Code of Conduct

We follow this code of conduct. Long story short: be nice :-).

Licensing

This project is published under the Apache 2.0 open source license. See also the LICENSE file in the root folder of this repository.

See here for a list of components used by the project, as well as their licenses, also to be found in the file java/com.sap.sailing.gwt.ui/imprint.json.

Building and Running

To build, invoke

    configuration/buildAndUpdateProduct.sh build

If the build was successful you can install the product locally by invoking

    configuration/buildAndUpdateProduct.sh install [ -s <server-name> ]

The default server name is taken to be your current branch name, e.g., master. The install goes to ${HOME}/servers/{server-name}. You will find a start script there which you can use to launch the product.

Downloading, Installing and Running an Official Release

You need to have Java 8 installed. Get one from here. Either ensure that this JVM's java executable in on the PATH or set JAVA_HOME appropriately.

At https://releases.sapsailing.com you find official product builds. To fetch and install one of them, make an empty directory, change into it and run the refreshInstance.sh command, e.g., like this:

    mkdir sailinganalytics
    cd sailinganalytics
    echo "MONGODB_URI=mongodb://localhost/winddb" | ${GIT_ROOT}/java/target/refreshInstance.sh auto-install-from-stdin

This will download and install the latest release and configure it such that it will connect to a MongoDB server running locally (localhost) and listening on the default port 27017, using the database called winddb.

In addition to the necessary MONGODB_URI variable you may need to inject a few secrets into your runtime environment:

  • MANAGE2SAIL_ACCESS_TOKEN access token for result and regatta structure import from the Manage2Sail regatta management system
  • IGTIMI_CLIENT_ID / IGTIMI_CLIENT_SECRET credentials for igtimi.com in case you have one or more WindBot devices that you would like to integrate with
  • GOOGLE_MAPS_AUTHENTICATION_PARAMS as in "key=..." or "client=...", required to display the Google Map in the race viewer. Obtain a Google Maps key from the Google Cloud Developer console, e.g., here.

In the configuration/mail.properties file make the necessary adjustments in case you would like to enable the application to send out e-mails, e.g., for user notifications or invitations.

Launch the server from the directory to which you just installed it:

    ./start

See the server logs like this:

    tail -f logs/sailing0.log.0

Connect to your server at http://localhost:8888 and find its administration console at http://localhost:8888/gwt/AdminConsole.html. The first-time default login user is admin with default password admin (please change).

Docker

To build a docker image, try docker/makeImageForLatestRelease. The upload to the default (private) Dockerhub repository will usually fail unless you are a collaborator for that repository, but you should see a local image tagged docker.sapsailing.com/sapsailing:... result from the build. To run that docker image, try something like

    docker run -d -e "MEMORY=4g" -e "MONGODB_URI=mongodb://my.mongohost.org?replicaSet=rs0&retryWrites=true" -P <yourimage>

As explained above for the non-Docker scenario, add any variable assignments for secrets you need to pass to the runtime by adding more -e arguments.

Do a "docker ps" to figure out the port exposing the web application:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 79f6faf19b6a docker.sapsailing.com/sapsailing:latest "/home/sailing/serve…" 33 seconds ago Up 32 seconds 0.0.0.0:32782->6666/tcp, 0.0.0.0:32781->7091/tcp, 0.0.0.0:32780->8000/tcp, 0.0.0.0:32779->8888/tcp, 0.0.0.0:32778->14888/tcp modest_dhawan

In this example, find your web application at http://localhost:32779 which is where the port 8888 exposed by the application is exposed at on your host. In the example with telnet port 14888 mapped to localhost:32788 do a

    telnet localhost 32778

to connect to the server's OSGi console.

Docker Compose

If you have built or obtained the docker.sapsailing.com/sapsailing:latest image, try this:

    cd docker
    docker-compose up

Based on the docker/docker-compose.yml definition you should end up with three running Docker containers:

  • a MongoDB server, listening on default port 27017
  • a RabbitMQ server, listening on default port
  • a Sailing Analytics server, listening for HTTP requests on port 8888 and for telnet connections to the OSGi console on port 14888

Try a request to http://127.0.0.1:8888/index.html or http://127.0.0.1:8888/gwt/status to see if things worked.

Configuration Options, Environment Variables

The server process can be configured in various ways. The corresponding environment variables you may use during installation with refreshInstance.sh and for setting up your Docker environment can be found in the following files:

S
Description
The Sailing Analytics, formerly known as the "SAP Sailing Analytics," are a solution for portraying and analyzing sailing regattas, support training scenarios, and power the vast archive at
Readme Apache-2.0
2 GiB
Languages
Java 75.7%
JavaScript 15%
HTML 2.6%
Objective-C 2.1%
Slash 1.8%
Other 2.6%