c45ce79bf19d44f4e6dc9cf840c6a0464706d0ac
java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/DistanceTest.java
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +package com.sap.sailing.domain.test; |
|
| 2 | + |
|
| 3 | +import static org.junit.Assert.assertTrue; |
|
| 4 | + |
|
| 5 | +import org.junit.Test; |
|
| 6 | + |
|
| 7 | +import com.sap.sailing.domain.common.BoatClassMasterdata; |
|
| 8 | +import com.sap.sailing.domain.common.Position; |
|
| 9 | +import com.sap.sailing.domain.common.impl.DegreePosition; |
|
| 10 | +import com.sap.sse.common.Distance; |
|
| 11 | + |
|
| 12 | +public class DistanceTest { |
|
| 13 | + @Test |
|
| 14 | + public void testDistances() { |
|
| 15 | + final Distance laserHullLength = BoatClassMasterdata.LASER_INT.getHullLength(); |
|
| 16 | + final Distance laserHullBeam = BoatClassMasterdata.LASER_INT.getHullBeam(); |
|
| 17 | + final Position pos = new DegreePosition(35.29989440459763, 139.4847256889834); |
|
| 18 | + final Position x = new DegreePosition(35.299894404588855, 139.4847718595392); |
|
| 19 | + final Position y = new DegreePosition(35.29990690516795, 139.48472568898336); |
|
| 20 | + assertTrue(x.getDistance(pos).scale(-1).add(laserHullLength).getMeters() < 0.1); |
|
| 21 | + assertTrue(y.getDistance(pos).scale(-1).add(laserHullBeam).getMeters() < 0.1); |
|
| 22 | + } |
|
| 23 | +} |
java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/shared/racemap/CanvasOverlayV3.java
| ... | ... | @@ -381,9 +381,8 @@ public abstract class CanvasOverlayV3 { |
| 381 | 381 | LatLng posWithDistanceX = coordinateSystem.toLatLng(translateRhumbX); |
| 382 | 382 | LatLng posWithDistanceY = coordinateSystem.toLatLng(translateRhumbY); |
| 383 | 383 | Point pointCenter = projection.fromLatLngToDivPixel(coordinateSystem.toLatLng(pos)); |
| 384 | - Point pointX = projection.fromLatLngToDivPixel(posWithDistanceX); |
|
| 385 | - Point pointY = projection.fromLatLngToDivPixel(posWithDistanceY); |
|
| 386 | - |
|
| 384 | + Point pointX = projection.fromLatLngToDivPixel(posWithDistanceX); |
|
| 385 | + Point pointY = projection.fromLatLngToDivPixel(posWithDistanceY); |
|
| 387 | 386 | return Size.newInstance(Math.abs(pointX.getX() - pointCenter.getX()), Math.abs(pointY.getY() - pointCenter.getY())); |
| 388 | 387 | } |
| 389 | 388 |
wiki/info/landscape/olympic-setup.md
| ... | ... | @@ -76,6 +76,8 @@ DNS is available on site on the gateway host ``10.1.0.6``. This is essential for |
| 76 | 76 | |
| 77 | 77 | The domain name has been set to ``sapsailing.com`` so that the fully-qualified host names are ``sap-p1-1.sapsailing.com`` and ``sap-p1-2.sapsailing.com`` respectively. Using this domain name is helpful later when it comes to the shared security realm established with the central ``security-service.sapsailing.com`` replica set. |
| 78 | 78 | |
| 79 | +The hostname ``www.sapsailing.com`` is required by master instances when connected to the Internet in order to download polar data and wind estimation data from the archive server. Since direct access to ``www.sapsailing.com`` is blocked, we run this through the SSH tunnel to our jump host; in order to have matching certificates and appropriate hostname-based routing in the cloud for requests to ``www.sapsailing.com`` we alias this hostname in ``/etc/hosts`` to ``127.0.0.1`` (localhost). |
|
| 80 | + |
|
| 79 | 81 | ### IP Addresses and VPN |
| 80 | 82 | |
| 81 | 83 | Here are the IP addresses as indicated by SwissTiming: |
| ... | ... | @@ -149,11 +151,13 @@ On both laptops there is a script ``/usr/local/bin/tunnels`` which establishes S |
| 149 | 151 | |
| 150 | 152 | During regular operations we assume that we have an Internet connection that allows us to reach our jump host ``tokyo-ssh.sapsailing.com`` through SSH, establishing various port forwards. We also expect TracTrac to have their primary server available. Furthermore, we assume both our laptops to be in service. ``sap-p1-1`` then runs the master server instance, ``sap-p1-2`` runs a local replica. The master on ``sap-p1-1`` replicates the central security service at ``security-service.sapsailing.com`` using the RabbitMQ installation on ``rabbit.internal.sapsailing.com`` in the AWS region eu-west-1. The port forwarding through tokyo-ssh.sapsailing.com (in ap-northeast-1) to the internal RabbitMQ address (in eu-west-1) works through VPC peering. The RabbitMQ instance used for outbound replication, both, into the cloud and for the on-site replica, is rabbit-ap-northeast-1.sapsailing.com. The replica on ``sap-p1-2`` obtains its replication stream from there, and for the HTTP connection for "reverse replication" it uses a direct connection to ``sap-p1-1``. The outside world, in particular all "S-ded-tokyo2020-m" master security groups in all regions supported, access the on-site master through a reverse port forward on our jump host ``tokyo-ssh.sapsailing.com:8888`` which under regular operations points to ``sap-p1-1:8888`` where the master process runs. |
| 151 | 153 | |
| 154 | +On both laptops we establish a port forward from ``localhost:22443`` to ``sapsailing.com:443``. Together with the alias in ``/etc/hosts`` that aliases ``www.sapsailing.com`` to ``localhost``, requests to ``www.sapsailing.com:22443`` will end up on the archive server. |
|
| 155 | + |
|
| 152 | 156 | On both laptops, we maintain SSH connections to ``localhost`` with port forwards to the current TracTrac production server for HTTP, live data, and stored data. In the test we did on 2021-05-25, those port numbers were 9081, 14001, and 14011, respectively, for the primary server, and 9082, 14002, and 14012, respectively, for the secondary server. In addition to these port forwards, an entry in ``/etc/hosts`` is required for the hostname that TracTrac will use on site for their server(s), pointing to ``127.0.0.1`` to let the Sailing Analytics process connect to localhost with the port forwards. Tests have shown that if the port forwards are changed during live operations, e.g., to point to the secondary instead of the primary TracTrac server, the TracAPI continues smoothly which is a great way of handling such a fail-over process without having to re-start our master server necessarily or reconnect to all live races. |
| 153 | 157 | |
| 154 | 158 | Furthermore, for administrative SSH access from outside, we establish reverse port forwards from our jump host ``tokyo-ssh.sapsailing.com`` to the SSH ports on ``sap-p1-1`` (on port 18122) and ``sap-p1-2`` (on port 18222). |
| 155 | 159 | |
| 156 | -Both laptops have a forward from localhost:22222 to sapsailing.com:22 through tokyo-ssh, in order to be able to have a git remote ``ssh`` with the url ``ssh://trac@localhost:22222/home/trac/git``. |
|
| 160 | +Both laptops have a forward from ``localhost:22222`` to ``sapsailing.com:22`` through ``tokyo-ssh.sapsailing.com``, in order to be able to have a git remote ``ssh`` with the url ``ssh://trac@localhost:22222/home/trac/git``. |
|
| 157 | 161 | |
| 158 | 162 | The port forwards vary for exceptional situations, such as when the Internet connection is not available, or when ``sap-p1-1`` that regularly runs the master process fails and we need to make ``sap-p1-2`` the new master. See below for the details of the configurations for those scenarios. |
| 159 | 163 |