Merge remote-tracking branch 'origin/master' into design2015

This commit is contained in:
Steffen Schaefer committed 2015-07-07 08:09:58 +02:00
commit 9d141ff366
14 files changed
+122 -50

No files matched your search

+17 -15
View File
@@ -11,6 +11,7 @@
RETVAL=0
JAVA_START_INSTANCES="server"
SERVERS_DIR=/home/sailing/servers
GIT_REPOSITORY=/home/sailing/code
APACHE_CONFIG_DIR=/etc/httpd/conf.d
rm /var/log/sailing.out
@@ -27,30 +28,28 @@ start_servers() {
echo "Using ${MEMORY_PER_INSTANCE_IN_MB}MB as default heap size per instance."
for conf in $JAVA_START_INSTANCES; do
echo "Checking for amazon update..."
echo "MEMORY=\"${MEMORY_PER_INSTANCE_IN_MB}m\"" >>/home/sailing/servers/$conf/env.sh
su - sailing -c "cd /home/sailing/servers/$conf && $GIT_REPOSITORY/java/target/refreshInstance.sh auto-install" 2>/var/log/sailing.err >/var/log/sailing.out
echo "MEMORY=\"${MEMORY_PER_INSTANCE_IN_MB}m\"" >>$SERVERS_DIR/$conf/env.sh
su - sailing -c "cd $SERVERS_DIR/$conf && $GIT_REPOSITORY/java/target/refreshInstance.sh auto-install" 2>>/var/log/sailing.err >>/var/log/sailing.out
(
# execute env.sh in a subshell which now has the same set of variables that the server will see
source /home/sailing/servers/$conf/env.sh
# Append Apache macro invocation for /internal-server-status based on mod_status and INSTANCE_DNS to /etc/httpd/conf.d/001-events.conf
echo "Appending macro usage for /internal-server-status URL for mod_status based Apache monitoring to $APACHE_CONFIG_DIR/001-events.conf"
echo "Use Status $INSTANCE_DNS internal-server-status" >>$APACHE_CONFIG_DIR/001-events.conf
launch_httpd
source $SERVERS_DIR/$conf/env.sh
echo "Starting Java server $conf"
su - sailing -c "cd /home/sailing/servers/$conf && ./start" 2>>/var/log/sailing.err >>/var/log/sailing.out
su - sailing -c "cd $SERVERS_DIR/$conf && ./start" 2>>/var/log/sailing.err >>/var/log/sailing.out
server_name="`echo $SERVER_NAME | tr [A-Z] [a-z]`"
echo "Appending macro invocation to $APACHE_CONFIR_DIR/001-events.conf to map ${server_name}.sapsailing.com to event with ID $EVENT_ID with server running on local port $SERVER_PORT..." >>/var/log/sailing.out
echo "Use Event $server_name.sapsailing.com \"$EVENT_ID\" 127.0.0.1 $SERVER_PORT" >>$APACHE_CONFIG_DIR/001-events.conf
# terminating the subshell will forget all the variable assignments brought in by env.sh, clearing for the next server instance
)
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
done
launch_httpd
}
stop_servers() {
for conf in $JAVA_START_INSTANCES; do
echo "Stopping Java server $conf"
su - sailing -c "cd /home/sailing/servers/$conf && ./stop"
su - sailing -c "cd $SERVERS_DIR/$conf && ./stop"
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
done
@@ -58,11 +57,14 @@ stop_servers() {
# launch_httpd(server_name, port, event_id)
launch_httpd() {
echo "Will try to launch httpd so this replica can work with an ELB easily."
echo "Will try to launch httpd so this replica can work with an ELB easily." >>/var/log/sailing.out
if [ -x /etc/init.d/httpd ]; then
server_name="`echo $SERVER_NAME | tr [A-Z] [a-z]`"
echo "Use Event $server_name.sapsailing.com \"$EVENT_ID\" 127.0.0.1 $SERVER_PORT" >>$APACHE_CONFIG_DIR/001-events.conf
echo "Launching httpd to map ${server_name}.sapsailing.com to event with ID $EVENT_ID with server running on local port $SERVER_PORT..."
FIRST_SERVER=`echo $JAVA_START_INSTANCES | awk '{print $1;}'`
source $SERVERS_DIR/$FIRST_SERVER/env.sh
# Append Apache macro invocation for /internal-server-status based on mod_status and INSTANCE_DNS to $APACHE_CONFIG_DIR/001-events.conf
echo "Appending macro usage for $INSTANCE_DNS/internal-server-status URL for mod_status based Apache monitoring to $APACHE_CONFIG_DIR/001-events.conf" >>/var/log/sailing.out
echo "Use Status $INSTANCE_DNS internal-server-status" >>$APACHE_CONFIG_DIR/001-events.conf
echo "Launching httpd..." >>/var/log/sailing.out
service httpd start
else
echo Can't launch httpd; start script doesn't seem to be installed at /etc/init.d/httpd
+17
View File
@@ -0,0 +1,17 @@
# Script to be linked from /etc/profile.d
# Appends to PATH, sets DISPLAY for VNC running on :2, exports JAVA_HOME and Amazon EC2 variables
ulimit -n 30000
ulimit -u 40000
export EC2_HOME=/opt/amazon/ec2-api-tools-1.6.8.0
export EC2_URL=https://ec2.eu-west-1.amazonaws.com
export JAVA_HOME=/opt/jdk1.8.0_45
export JAVA_1_7_HOME=/opt/jdk1.7.0_75
export PATH=$PATH:$JAVA_HOME/bin:/opt/amazon/ec2-api-tools-1.6.8.0/bin:/opt/amazon/bin
export DISPLAY=:2.0
alias sa='eval `ssh-agent`; ssh-add ~/.ssh/id_dsa'
alias ll="ls -lh --color"
@@ -18,6 +18,8 @@ import com.sap.sailing.domain.common.tracking.GPSFixMoving;
import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.RaceListener;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.WindStore;
import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
@@ -30,6 +32,7 @@ public class Simulator {
private DynamicTrackedRace trackedRace;
private final WindStore windStore;
private boolean stopped;
private long advanceInMillis = -1;
private Timer timer = new Timer("Timer for TracTrac Simulator");
@@ -46,8 +49,20 @@ public class Simulator {
return EmptyWindStore.INSTANCE;
}
public synchronized void setTrackedRace(DynamicTrackedRace trackedRace) {
public synchronized void setTrackedRace(final DynamicTrackedRace trackedRace) {
this.trackedRace = trackedRace;
trackedRace.getTrackedRegatta().addRaceListener(new RaceListener() {
@Override
public void raceAdded(TrackedRace trackedRace) {
}
@Override
public void raceRemoved(TrackedRace trackedRace) {
if (trackedRace == Simulator.this.trackedRace) {
stop(); // stop simulator when tracked race is removed from its regatta
}
}
});
startWindPlayer();
}
@@ -76,11 +91,15 @@ public class Simulator {
windTrack.lockForRead();
try {
for (Wind wind : windTrack.getRawFixes()) {
if (stopped) {
break;
}
trackedRace.recordWind(delayWind(wind), windSourceAndTrack.getKey());
}
} finally {
windTrack.unlockAfterRead();
}
logger.info("Wind Track Simulator for race "+trackedRace.getRace().getName()+" finished. stopped="+stopped);
}
}.start();
}
@@ -97,15 +116,11 @@ public class Simulator {
*/
private synchronized long getAdvanceInMillis() {
while (!isAdvanceInMillisSet()) {
if (trackedRace.getStartOfRace() != null) {
setAdvanceInMillis(System.currentTimeMillis() - trackedRace.getStartOfRace().asMillis());
} else {
try {
wait(2000); // wait for two seconds, then re-evaluate whether there is a start time
} catch (InterruptedException e) {
logger.throwing(Simulator.class.getName(), "getAdvanceInMillis", e);
// ignore; try again
}
try {
wait(2000); // wait for two seconds, then re-evaluate whether there is a start time
} catch (InterruptedException e) {
logger.throwing(Simulator.class.getName(), "getAdvanceInMillis", e);
// ignore; try again
}
}
return advanceInMillis;
@@ -245,4 +260,10 @@ public class Simulator {
}, transformedTimepoint.asDate());
}
}
public void stop() {
logger.info("Stopping simulator for race "+trackedRace.getRace().getName());
timer.cancel();
stopped = true;
}
}
@@ -215,6 +215,8 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
private final TrackedRegattaRegistry trackedRegattaRegistry;
private final Simulator simulator;
/**
* Creates a race tracked for the specified URL/URIs and starts receiving all available existing and future push
* data from there. Receiving continues until {@link #stop(boolean)} is called.
@@ -246,7 +248,6 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
* available but loses track of the wind, e.g., during server restarts.
* @param trackedRegattaRegistry
* used to create the {@link TrackedRegatta} for the domain event
* @param raceLogResolver TODO
*/
protected TracTracRaceTrackerImpl(DomainFactory domainFactory, URL paramURL, URI liveURI, URI storedURI,
URI courseDesignUpdateURI, TimePoint startOfTracking, TimePoint endOfTracking, long delayToLiveInMillis,
@@ -278,7 +279,6 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
* tracker is already known up-front, particularly if it has a specific configuration to use. Other constructors
* may create a default {@link Regatta} with only a single default {@link Series} and {@link Fleet} which may not
* always be what you want.
* @param raceLogResolver TODO
*/
protected TracTracRaceTrackerImpl(Regatta regatta, DomainFactory domainFactory, URL paramURL, URI liveURI,
URI storedURI, URI courseDesignUpdateURI, TimePoint startOfTracking, TimePoint endOfTracking,
@@ -303,7 +303,6 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
* first mark passing for the first waypoint will be set to "now." It will delay the forwarding of all
* events received such that they seem to be sent in "real-time." So, more or less the time points
* attached to the events sent to the receivers will again approximate the wall time.
* @param raceLogResolver TODO
*/
private TracTracRaceTrackerImpl(IRace tractracRace, final Regatta regatta, DomainFactory domainFactory,
URL paramURL, URI liveURI, URI storedURI, URI tracTracUpdateURI, TimePoint startOfTracking,
@@ -322,7 +321,6 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
this.gpsFixStore = gpsFixStore;
this.domainFactory = domainFactory;
this.lastProgressPerID = new HashMap<Util.Triple<URL, URI, URI>, Util.Pair<Integer, Float>>();
final Simulator simulator;
if (simulateWithStartTimeNow) {
simulator = new Simulator(windStore);
// don't write the transformed wind fixes into the DB again... see also bug 1974
@@ -528,6 +526,9 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
lastStatus = new TrackedRaceStatusImpl(TrackedRaceStatusEnum.FINISHED, /* will be ignored */1.0);
updateStatusOfTrackedRaces();
}
if (stopReceiversPreemtively && simulator != null) {
simulator.stop();
}
}
}
@@ -1317,4 +1317,5 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String now();
String minutesAgo(String minutes);
String hoursAgo(String hours);
String selectCompetitor();
}
@@ -1284,4 +1284,5 @@ sailorInfo=Sailor Info
sailorInfoLongText=Official Results, Protests,\nNotice Board, Sailor weather:
now=Now
minutesAgo={0} min ago
hoursAgo={0} h ago
hoursAgo={0} h ago
selectCompetitor=Please select one competitor
@@ -1274,4 +1274,5 @@ sailorInfo=Segler Infos
sailorInfoLongText=Offizielle Ergebnisse, Proteste,\nNotice Board, Segler-Wetter:
now=Jetzt
minutesAgo=vor {0} min
hoursAgo=vor {0} h
hoursAgo=vor {0} h
selectCompetitor=Bitte einen Teilnehmer auswählen
@@ -1222,4 +1222,5 @@ sailorInfo=Моряки информация
sailorInfoLongText=Official Results, Protests,\nNotice Board, Sailor weather:
now=в настоящее время
minutesAgo={0} минут назад
hoursAgo={0} h часов назад
hoursAgo={0} h часов назад
selectCompetitor=Please select one competitor
@@ -1272,3 +1272,4 @@ raceCalculatedTimeAtEstimatedArrivalAtCompetitorFarthestAheadInSeconds=Calc.Time
raceCalculatedTimeAtEstimatedArrivalAtCompetitorFarthestAheadInSecondsTooltip=Calculated time at estimated arrival at the competitor that is currently farthest ahead in the race;\nestimation based on average VMG in current leg and equal (calculated) performance to fastest boat in all subsequent legs
sailorInfo=水手信息
sailorInfoLongText=Find here Notice Board,\nProtests, Sailor weather:
selectCompetitor=Please select one competitor
@@ -19,6 +19,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.ListDataProvider;
@@ -88,6 +89,7 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
private final Button removeFixedMarkPassingsButton;
private final Button suppressPassingsButton;
private final Button removeSuppressedPassingButton;
private Label selectCompetitorLabel = new Label();
public EditMarkPassingsPanel(final SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
final RegattaAndRaceIdentifier raceIdentifier, final StringMessages stringMessages,
@@ -265,6 +267,7 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
});
}
});
selectCompetitorLabel.setText(stringMessages.selectCompetitor());
refreshWaypoints();
HorizontalPanel tableAndButtons = new HorizontalPanel();
add(tableAndButtons, 0, 0);
@@ -277,6 +280,7 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
buttonPanel.add(removeFixedMarkPassingsButton);
buttonPanel.add(suppressPassingsButton);
buttonPanel.add(removeSuppressedPassingButton);
buttonPanel.add(selectCompetitorLabel);
enableButtons();
}
@@ -291,12 +295,14 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
}
private void processCompetitorSelectionChange() {
waypointSelectionModel.clear();
if (Util.size(competitorSelectionModel.getSelectedCompetitors()) == 1) {
refillList();
} else {
disableEditing();
}
waypointSelectionModel.clear();
if (isVisible() && Util.size(competitorSelectionModel.getSelectedCompetitors()) == 1) {
selectCompetitorLabel.setText("");
refillList();
} else {
disableEditing();
selectCompetitorLabel.setText(stringMessages.selectCompetitor());
}
}
private void disableEditing() {
@@ -5527,12 +5527,6 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
}
}
public void setStartOfTracking(String leaderboardName, RaceColumnDTO raceColumn, FleetDTO fleet, TimePoint startOfTracking) {
RaceLog raceLog = getService().getRaceLog(leaderboardName, raceColumn.getName(), fleet.getName());
}
@Override
public void updateSuppressedMarkPassings(String leaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet,
Integer newZeroBasedIndexOfSuppressedMarkPassing, CompetitorDTO competitorDTO) {
@@ -19,7 +19,7 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console -clean"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djetty.port=8889 -Dreplication.exchangeName=sapsailinganalytics-replica -Declipse.ignoreApp=true -Dosgi.noShutdown=true&#13;&#10;-Dexpedition.udp.port=2011 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -XX:+UseMembar -Dmongo.dbName=replica -Dreplicate.on.start=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl -Dreplicate.master.queue.host=127.0.0.1 -Dreplicate.master.queue.port=5672 -Dreplicate.master.servlet.port=8888 -Dreplicate.master.servlet.host=127.0.0.1"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djetty.port=8889 -Dreplication.exchangeName=sapsailinganalytics-replica -Declipse.ignoreApp=true -Dosgi.noShutdown=true&#13;&#10;-Dexpedition.udp.port=2011 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -XX:+UseMembar -Dmongo.dbName=replica -Dreplicate.on.start=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl -Dreplicate.master.queue.host=127.0.0.1 -Dreplicate.master.queue.port=5672 -Dreplicate.master.servlet.port=8888 -Dreplicate.master.servlet.host=127.0.0.1 -Dreplicate.master.exchange.name=sapsailinganalytics"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
-5
View File
@@ -252,11 +252,6 @@ if [[ $OPERATION == "auto-install" ]]; then
# make sure to reload data
source `pwd`/env.sh
# Append Apache macro invocation for /internal-server-status based on mod_status and INSTANCE_DNS to /etc/httpd/conf.d/001-events.conf
APACHE_CONFIG_DIR=/etc/httpd/conf.d
echo "Appending macro usage for /internal-server-status URL for mod_status based Apache monitoring to $APACHE_CONFIG_DIR/001-events.conf"
echo "Use Status $INSTANCE_DNS internal-server-status" >>$APACHE_CONFIG_DIR/001-events.conf
if [[ $INSTALL_FROM_RELEASE == "" ]] && [[ $BUILD_BEFORE_START != "True" ]]; then
echo "I could not find any option telling me to download a release or to build! Possible cause: Your environment contains empty values for these variables!"
exit 1
+31
View File
@@ -0,0 +1,31 @@
#Smartphone Tracking
With the development of [RaceLogTracking](racelog-tracking) and the [Tracking App](tracking-app) it is now possible to track races using only smartphones. This can be set up following the following steps.
1. Create Event, Regatta, Leaderboard,... as always.
Note: Make sure to have a LeaderboardGroup and have it attached to the event.
2. Go to the Connectors/RaceLog Tracking tab in the AdminConsole and click the "Denote For RaceLog Tracking" symbol in the Actions bar (Green arrow pointing right).
3. Register (or create) the competitors for the leaderboard using the symbol also in the Actions bar (Face).
Note: It is also possible denote for RaceLog Tracking or register competitors to each race individually, but since this is usually the same for an entire event it is easier to do it for the whole leaderboard.
4. Click the "Define Course Layout" symbol (Two flags/marks) on the Actions tab of the first race of the leaderboard. Create a course by defining first marks and than waypoints. Use the copy symbol (Two pieces of paper) to copy the course to other races.
Note: In the future it should be possible to do this for the entire leaderboard too, as the course does not change for many events.
5.(optional) If not using the Buoy-Positioning App, it is possible to set the mark locations in the course layout panel, using the "Set Mark Location" symbol on the right of the mark list.
Note: If using the Race Committee App, make sure to only use the ByMarks Course Designer, as ByName will overwrite a manuelly created course with an empty one.
6. Map the smartphones the the competitors using the "Map Devices to Competitors and Mark" tab of the Leaderboard Actions bar (or for each race, but going over the leaderboard is usually easier, as above). Select each Competitor and scan the QR-Code with the Tracking-App. Do not forget to press (or remind the sailors to press) start tracking before the races start.
7. To use the Buoy Positioning App click the "Invite Buoy Tenders" symbol in the Leaderboard Actions tab and send a QR-Code by email to be scanned using the App.
- Um Tracking-Intervalle zu inspizieren, im Tab RaceLog Tracking unten links bei den einzelnen Rennen aus der Action Bar auf "Map Devices to Competitors and Marks". Dort siehst Du die Zuordnungstabelle und kannst zum einen Zuordnungen ganz entfernen, neue Zuordnungen manuell anlegen (da muss man dann allerdings mit der DeviceID 'rummachen; eher unpraktisch, aber fuer Notfaelle vielleicht irgendwann mal praktisch) und noch offene Tracking-Intervalle abschliessen. By default siehst Du da nur die Competitor-Zuordnungen; mit der Checkbox "Show Mappings for pinged Marks" kannst Du auch die Tonnen sehen