docker/Dockerfile_windestimation
... ...
@@ -12,4 +12,4 @@ RUN wget -O /tmp/rds.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-
12 12
&& /opt/sapjvm_8/bin/keytool -importcert -alias AWSRDS -file /tmp/rds.pem -keystore /opt/sapjvm_8/jre/lib/security/cacerts -noprompt -storepass changeit \
13 13
&& rm /tmp/rds.pem
14 14
RUN wget -O /home/sailing/WindEstimationModelsTraining.jar https://static.sapsailing.com/WindEstimationModelsTraining.jar
15
-CMD exec java "${MEMORY}" -Dmongo.uri="${MONGODB_URI}" -jar WindEstimationModelsTraining.jar "${BEARER_TOKEN}"
15
+CMD exec java "${MEMORY}" -Dmongo.uri="${MONGODB_URI}" -jar WindEstimationModelsTraining.jar "${BEARER_TOKEN}" ${TRAINING_DATA_PERCENT}
java/com.sap.sailing.windestimation.lab/src/com/sap/sailing/windestimation/model/SimpleModelsTrainingPart1.java
... ...
@@ -57,12 +57,13 @@ public class SimpleModelsTrainingPart1 {
57 57
* permission on the {@code TRACKED_RACE}s for wind data access. Only regattas/races are considered that
58 58
* the user authenticated by this token can {@code READ}. {@code args[1]} may contain a percentage of the
59 59
* maneuvers to use for training which defaults to 80; {@code args[2]} may contain a percentage of the
60
- * maneuvers to use for testing which defaults to 20. If {@code args[3]} is also provided, it is taken to
61
- * be the file system path for storing the models that result from the training process; with this, the
62
- * models are not stored in MongoDB which otherwise would be the default. If {@code args[4]} is provided and
63
- * is something that {@link Boolean#valueOf(String)} evaluates to {@code true} then visuals are presented
64
- * (requiring a display to be available to the Java process which may, e.g., not be the case for a docker
65
- * container) that show the results of outlier removal for the wind regressions.
60
+ * maneuvers to use for testing which defaults to {@code 100-percentForTraining}. If {@code args[3]} is
61
+ * also provided, it is taken to be the file system path for storing the models that result from the
62
+ * training process; with this, the models are not stored in MongoDB which otherwise would be the
63
+ * default. If {@code args[4]} is provided and is something that {@link Boolean#valueOf(String)}
64
+ * evaluates to {@code true} then visuals are presented (requiring a display to be available to the Java
65
+ * process which may, e.g., not be the case for a docker container) that show the results of outlier
66
+ * removal for the wind regressions.
66 67
*/
67 68
public static void main(String[] args) throws Exception {
68 69
final String bearerToken = args[0];
... ...
@@ -76,7 +77,7 @@ public class SimpleModelsTrainingPart1 {
76 77
if (args.length > 2) {
77 78
percentForTesting = Integer.valueOf(args[2]);
78 79
} else {
79
- percentForTesting = 20;
80
+ percentForTesting = 100-percentForTraining;
80 81
}
81 82
final ManeuverForEstimationPersistenceManager maneuverForEstimationPersistenceManager = new ManeuverForEstimationPersistenceManager();
82 83
final ModelStore modelStore;
java/com.sap.sailing.windestimation.lab/src/com/sap/sailing/windestimation/model/classifier/maneuver/PersistedManeuverClassifiersScorePrinter.java
... ...
@@ -64,8 +64,9 @@ public class PersistedManeuverClassifiersScorePrinter {
64 64
if (classifierModel != null) {
65 65
allClassifierModels.add(classifierModel);
66 66
}
67
- } catch(ModelNotFoundException e) {
68
- //ignore
67
+ } catch (ModelNotFoundException e) {
68
+ logger.info("Model not found: "+e.getMessage()+"; ignoring...");
69
+ // ignore
69 70
} catch (ModelPersistenceException e) {
70 71
logger.log(Level.SEVERE, "Exception while loading model", e);
71 72
}
... ...
@@ -84,5 +85,4 @@ public class PersistedManeuverClassifiersScorePrinter {
84 85
outputStr = outputStr.replaceAll(Pattern.quote(" \t| "), ";");
85 86
Files.write(Paths.get("maneuverClassifierScores.csv"), outputStr.getBytes());
86 87
}
87
-
88 88
}
wiki/howto/windestimation.md
... ...
@@ -77,6 +77,7 @@ For your account that is equipped with the ``TRACKED_RACE:EXPORT`` permission yo
77 77
docker.sapsailing.com/windestimationtraining:latest
78 78
```
79 79
If successful (and you may want to remove the ``--rm`` option otherwise to allow you to inspect logs after unsuccessful execution) you will find the output under ``/tmp/windEstimationModels.dat`` which you can upload as usual, e.g., as in
80
+
80 81
```
81 82
curl -X POST -H "Content-Type: application/octet-stream" --data-binary @windEstimationModels.dat \
82 83
-H "Authorization: Bearer 987235098w0t98yw409857098745=" \
... ...
@@ -127,7 +128,7 @@ The next step is to establish a connection for the Docker registry from which Do
127 128
128 129
The credentials you provide are encoded in ``~/.docker/config.json``. You can then use the script ``configureDockerRegistry.sh`` to establish the image pull secret. Either provide the name of your docker registry (e.g., ``docker.sapsailing.com`` as the single argument to the script or call without argument to have the script prompt you for it. The script will then read your ``~/.docker/config.json`` and extract the corresponding authorization information to pass it on as the AI Core registry secret.
129 130
130
-Then, you can create the GIT connection. Use script ``createGitConfig.sh``, either with three arguments (GIT URL, user email, personal access token (PAT)), or have the script prompt for these. I have created a Git repository with the necessary workflow definition under ``https://github.tools.sap/D043530/aicore-sailing``.
131
+Then, you can create the GIT connection. Use script ``createGitConfig.sh``, either with three arguments (GIT URL, user email, personal access token (PAT)), or have the script prompt for these. I have created a Git repository with the necessary workflow definition under ``https://github.tools.sap/D043530/aicore-sailing``. In the ``workflows`` folder there is a ``workflow-template.yaml`` file which contains the specification of an Argo workflow template. It runs the ``docker.sapsailing.com/windestimation:latest``.
131 132
132 133
### Traditional
133 134