-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathuser_manual.tex
More file actions
executable file
·3262 lines (2787 loc) · 181 KB
/
user_manual.tex
File metadata and controls
executable file
·3262 lines (2787 loc) · 181 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%
%%% This user manual deliverable is based on monroe-deliverable.sty version 1.0
%%%
\documentclass[a4paper,10pt]{article}
\usepackage{monroe-deliverable}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\usepackage{appendix}
\usepackage{longtable}
\usepackage{mdwlist} % Defines itemize*, enumerate* y description*, which have less vertical spacing.
\usepackage{placeins} % To place float barriers. Use \FloatBarrier to flush them all.
\newcommand{\VerbatimFont}{\footnotesize}
\newcommand{\TableFont}{\footnotesize}
\overfullrule=35pt % Remove this in the final version!!!
%%% ALL figures MUST be inside the ``figures'' folder
%%% ``standard'' figures (like logos) are in the common ``templates/figures'' folder
\graphicspath{{figures/}{../templates/figures/}}
\DeclareGraphicsExtensions{.pdf,.jpg,.jpeg,.png}
\usepackage[binary-units]{siunitx}
\sisetup{detect-weight} % To detect bold fonts.
\def\defaultDigitGrouping{5}%So that it will always group, even with only 4 digits.
\sisetup{group-minimum-digits=\defaultDigitGrouping}
%%% 1st parameter is the acronym, 2nd is the full name
\setproject{MONROE}{Measuring Mobile Broadband Networks in Europe}
\setprojectnumber{644399}
\setECcall{H2020-ICT-11-2014}
%%% 1st parameter is the WP number, 2nd is the full name
\setworkpackage{5.2}{User Support}
%%% 1st mandatory parameter is the deliverable number, 2nd mandatory is the full name
%%% the optional parameter (between []) is a short name for headers, if needed
%%% use line breaks (\\) for the full name as needed to ensure proper formatting
\setdeliverable[MONROE Platform User manual]{User manual}{MONROE Platform User Manual}
%%% use \setprivatedeliverable for a confidential one
%\setprivatedeliverable
\setpublicdeliverable
%%% if this command is not used, then the default is: R (Report)
%%%
%%% 1st parameter is the deliverable type code, 2nd is the desired name for this type;
%%% codes are as defined in table 3.1c of the proposal template:
%%%
%%% r = R: Document, report (excluding the periodic and final reports)
%%% dem = DEM: Demonstrator, pilot, prototype, plan designs
%%% dec = DEC: Websites, patents filing, press & media actions, videos, etc.
%%% other = OTHER: Software, technical diagram, etc.
\setdeliverabletype{r}{Report}
%%% 1st parameter is the revision number, 2nd is the date
\setrevision{1.0}{\today}
%%% 1st parameter is the path to the file with the project logo, 2nd is the scale factor
\setprojectlogo{monroe_alliance_main}{1.7}
%%% 1st parameter is the path to the file with the H2020 / EU logo, 2nd is the scale factor
\setEClogo{EC-H2020}{0.3}
%%% use line breaks (\newline, NOT \\) as needed to ensure proper formatting of the author list
%%% the optional parameter (between []) is an alternative to "Contributor(s)", if desired
\setdeliverableauthors{Miguel Pe\'{o}n-Quir\'{o}s, Thomas Hirsch, Ali Safari Khatouni, Mohamed Moulay}
%%% use line breaks (\newline, NOT \\) as needed to ensure proper formatting of the editor list
%%% can be omitted if desired
\setdeliverableeditors{Miguel Pe\'{o}n-Quir\'{o}s, \"Ozg\"u Alay, Vincenzo Mancuso}
%-------------------------------------------------------------%
%------------- Custom commands and environments ------------%
%-------------------------------------------------------------%
%%% add your own macro (& color) to have your own inline color comments
%%% other (readable) colors: orange, blue, teal, violet, purple, brown, olive, magenta, cyan
\newcommand{\OA}[1]{\textcolor{red}{{\sf OA: #1}}}
\newcommand{\MPQ}[1]{\textcolor{blue}{{\sf MPQ: #1}}}
\newcommand{\todo}[1]{\textcolor{red}{TODO: #1}\PackageWarning{TODO:}{#1!}}
\newcommand{\monroe}{MONROE}
% Style for identifiers such as "main()" or file names:
\newcommand{\identifier}[1]{{\texttt{\small{#1}}}}
\definecolor{PalePink}{rgb}{1, 0.8, 1}
\definecolor{BrightYellow}{rgb}{1, 1, 0}
\definecolor{LightGreen}{rgb}{0.8, 1, 0.733}
\definecolor{LightYellow}{rgb}{1, 1, 0.733}
%------------------------------------------------------------%
%------------- the actual document begins HERE ------------%
%------------------------------------------------------------%
\begin{document}
%%% cover page
\makecoverpage
\thispagestyle{empty}
\newpage
%%% second cover page
\deliverableabstract{This document describes the processes that \monroe{} experimenters need to follow to create, run, monitor and collect results from their experiments.}
%%% if keywords are not given, they are automatically not added to the second cover page
%\deliverablekeywords{}
\makesecondcoverpage
\vspace*{\fill}
\begin{center}
%%% list of partners and their acronyms added by hand here
\begin{tabular*}{12cm}{p{9.5cm}@{\hspace{0pt}}c}
\toprule
\textbf{Participant organisation name} & \textbf{Short name} \\
\midrule
SIMULA RESEARCH LABORATORY AS \emph{(Coordinator)} & SRL \\
CELERWAY COMMUNICATION AS & Celerway \\
TELENOR ASA & Telenor \\
NETTET SVERIGE AB & NET1 \\
NEXTWORKS & NXW \\
FUNDACION IMDEA NETWORKS & IMDEA \\
KARLSTADS UNIVERSITET & KaU \\
POLITECNICO DI TORINO & POLITO \\
\bottomrule
\end{tabular*}
\end{center}
\vspace*{\fill}
\newpage
%%% ToC, may be removed for very short documents
\tableofcontents
\newpage
%------------------------------------------------------------%
%\section*{Executive summary}
%
%\OA{this section may be present in very long documents, else remove}
%
%\newpage
%------------------------------------------------------------%
%------------------------------------------------------------%
%------------------------------------------------------------%
\section{Introduction}
\label{sec:intro}
The purpose of this document is to guide \monroe{} experimenters through the process of creating, running and monitoring their experiments, and the subsequent collection of results.
It first explains how the experiments must be prepared inside Docker containers, the testing process they must undergo before they can be deployed into \monroe{}'s nodes, and how they must be uploaded to a repository for deployment into the nodes.
Then, it explains the basics of the web interface that allows provision of resources and the scheduling of experiment executions.
Finally, it shows how the experiment results can be retrieved either directly from the experiment itself or from the repository provided by \monroe{}.
\subsection{\monroe{} nodes hardware}
The \monroe{} platform has gone through a complete process of analysis and redesign to adapt to the new hardware available in the market and overcome some of the issues encountered in the first design.
The following paragraphs explain the main characteristics of the current design.
\subsubsection{System design}
The current \monroe{} design presents a heterogeneous set of nodes grouped in pairs:
\begin{itemize*}
\item ``Head,'' with two Sierra Wireless LTE Cat6 modems.
\item ``Tail,'' with one Sierra Wireless LTE Cat6 modem and one WiFi adaptor.
\end{itemize*}
Figure~\ref{fig:secondNodeDesign} shows the current node design.
Both types of nodes are based on a PC Engines APU2D4 motherboard with the following characteristics:
\begin{itemize*}
\item \SI{1}{\giga\hertz} 64-bit quad core AMD Geode APU.
\item \SI{4}{\gibi\byte} RAM.
\item \SI{16}{\gibi\byte} SDD.
\item Three miniPCIe slots, two of which support a 3G/4G modem.
\end{itemize*}
\begin{figure}[tp]
\centering
\includegraphics[width=0.75\textwidth]{SystemPicture2.jpg}
\caption{System design. Left: Tail node with one LTE Cat6 modem and one WiFi adaptor. Right: Head node with two LTE Cat6 modems.}
\label{fig:secondNodeDesign}
\end{figure}
The current node design does not support a dedicated management MBB interface.
Thus, additional measures have been taken to minimize the interference of background traffic with user experiments.
In particular, most maintenance operations (except optionally the transfer of user results) are paused during experiment execution.
Also, a fix hour is reserved for maintenance in all nodes every day.
\subsection{Overview of the node configuration}
\monroe{} nodes have been designed to have minimal impact on the experiments that run on them.
Therefore, only one experiment can run at a given time in a node.
Although the experiments are executed inside a Docker container, they have no quotas on CPU or memory usage, subject only to available node resources.
Container image size and temporary storage in the node may be restricted, though.
Every \monroe{} node runs, in addition to user experiments, the following background processes:
\begin{itemize}
\item The experiment scheduler, which arbitrates the execution of user experiments in the node.
The scheduler runs permanently in the background and contacts periodically the scheduling server, sending ``heartbeats'' and checking for new schedules for the node.
When an experiment is not running, the scheduler may start the deployment of the containers for one or several experiments scheduled to be run in the immediate future, so that they are prepared on advance.
The scheduler checks the duration of the slot assigned to an experiment; if the experiment does not finish on time, it stops the whole container.
\item Synchronization (rsync) services to copy data files to the \monroe{} repository.
This service copies user experiment results, the data collected by passive experiments and assorted metadata measurements.
It runs continuously, transferring files to the server as they appear in the corresponding folders.
This service uses the management interface, which is different from the interfaces available for the experiments.
However, the management interface may share in some cases the same subscriber contract with one of the experiment interfaces; operators might restrict the total bandwidth available for all the SIMs linked to the same contract.
Additionally, two modems (management plus experiment) using the same operator antenna may somehow affect the bandwidth available for the experiment.
Therefore, experimenters should be aware of the small amount of data that can be transferred by this service in parallel to their experiments.
\item Several systems run continuously in the background gathering information on the status of diverse components.
Examples include a service to read the signal strength and network configuration of each of the experiment modems, the GPS data and various node parameters such as CPU load, memory usage or CPU temperature.
These services run continuously in the background with a frequency that varies from one second up to several minutes.
Although their impact on user experiments should be minimal, their existence must be known by the experimenters.
\item In addition to the services that gather metadata, \monroe{} nodes keep several containers active all the time.
These containers run experiments that are deemed basic for the \monroe{} platform and include:
\begin{itemize}
\item A ping experiment.
Container number \num{1} executes continuously an ICMP ping operation to a fixed external server (currently, Google's DNS at 8.8.8.8).
The RTT values are collected and transferred to the servers.
The ping experiment runs continuously with a frequency of one second, for every interface.
\item A container that runs Tstat, the passive mPlane monitoring probe that collects, for each interface, detailed flow level statistics.
The Tstat container generates no traffic; flow level data is synchronized to the \monroe{} repository using the standard synchronization process described above.
\end{itemize}
\item Finally, some built-in \monroe{} experiments run as scheduled containers.
These experiments will not run at the same time than user experiments:
\begin{itemize}
\item A bandwidth measurement test, which periodically downloads an object using the HTTP protocol to measure the achievable bandwidth.
The test runs on each interface.
The periodicity of this experiment and whether it can be run while user experiments are being executed are yet to be decided.
\item A container that periodically executes a paris-traceroute to several popular websites recording information about all the intermediate hops.
This container will in principle be run several times per day, but the interactions with user experiments are yet to be determined.
\end{itemize}
\end{itemize}
\subsection{Overview of the experimental workflow}
Experiments conducted in the \monroe{} platform follow the workflow shown in Figure~\ref{fig:ExperimentWorkflow}, which consists of three phases: Experiment design, testing and experimentation.
During the experiment design phase, the experiment goals and properties are defined and the container required to deploy it in \monroe{} nodes is configured.
During the testing phase, the container is executed on nodes specifically devoted to testing new experiments.
If the experiment passes all the safety and behavior tests, a \monroe{} manager will digitally sign the container image.
Signed containers cannot be further modified without running again through the testing phase.
Finaly, the experimenter is free to schedule the experiment container on any nodes, subject to the specific quotas assigned to their project.
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth,trim={7cm 7.5cm 7cm 5cm}]{ExperimentWorkflow.pdf}
\caption{Experimental workflow.}
\label{fig:ExperimentWorkflow}
\end{figure}
%------------------------------------------------------------%
%------------------------------------------------------------%
%------------------------------------------------------------%
\section{Experiment preparation}
\label{sec:experimentPreparation}
%Abcd.
\subsection{General experiment notes}
\label{subsec:generalExperimentNotes}
\monroe{} experiments run under the root user of a Docker container.
Therefore, experimenters can design any kind of experiment within the security restrictions of the platform, including the configuration of routing tables, stopping or starting interfaces and executing any kind of applications.
We assume the reader is familiar with the Docker technology.
Otherwise, we suggest getting used to it by accessing the documentation at \url{https://docs.docker.com/engine/understanding-docker/}~.
Creating and using containers is a two-step process.
At design time, the experimenters create the image for the container in their local machine using a container-creation script.
If necessary, they can install new packages (e.g., via apt-get) or copy libraries.
The docker tools read the script and create the final image for the experiment, which will then have to be uploaded to a repository.
At run-time, the nodes retrieve the container image from the repository and start it as scheduled.
During execution, the experiment should not install additional applications or download any data that is not part of the experiment itself (e.g., if the experiment uploads a file to a server to test upstream speed, either include the file to be uploaded in the container at design time or create it locally).
\emph{$\Rightarrow$~Experiments will under no circumstances allow direct ssh access to the node or any other form of running interactive commands from outside the container that can pose a security risk for the platform.~$\Leftarrow$}\newline
\subsection{Container preparation}
\label{subsec:containerPreparation}
\monroe{} experiments are deployed in Docker containers (\url{https://www.docker.com/}).
Preparing a new container from \monroe{}'s base image is an easy process:
\begin{enumerate}
\item Install Docker in your machine. Do it preferably downloading the installation script from the web page, rather than through a package manager such as apt-get:
{\VerbatimFont\begin{verbatim}
$ wget https://get.docker.com -O install.sh
$ chmod u+x install.sh
$ ./install.sh
\end{verbatim}}
You will have to run docker as root unless you add yourself to the docker group.
Mac users: Download and install ``Docker for MAC''\\
(\url{https://www.docker.com/products/docker#/mac})\\
or the ``Docker Toolbox''\\ (\url{https://docs.docker.com/toolbox/overview/}), according to your OS version.
\item Test the Docker installation with the `Hello world!' example:
{\VerbatimFont\begin{verbatim}
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
03f4658f8b78: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:xxxxxxxxxxxxxxxxxxxxxxxx
Status: Downloaded newer image for hello-world:latest
\end{verbatim}}
If everything has worked correctly up to here, you will see a welcome message similar to the following:
{\VerbatimFont\begin{verbatim}
Hello from Docker.
This message shows that your installation appears to be working correctly.
...
\end{verbatim}}
You can check which images are locally installed with:
{\VerbatimFont\begin{verbatim}
$sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 690ed74de00f 4 months ago 960 B
\end{verbatim}}
\item Now you are ready to download the \monroe{} base image:
{\VerbatimFont\begin{verbatim}
git clone https://github.com/MONROE-PROJECT/Experiments.git
\end{verbatim}}
This will fetch the repository with \monroe{}'s example containers.
\item Head to \identifier{Experiments/experiments/template/}.
Here, you will find the required files to prepare your image based on \monroe{}'s base.
You should care about four things: a) The contents of the \identifier{files/} folder, b) the \identifier{build.sh} file, c) the \identifier{push.sh} file and d) the \identifier{template.docker} script file that describes how to create your container.
In the directory \identifier{files/} you can put all the files that are part of your experiment.
As a simple example, we can use the following script:
{\VerbatimFont\begin{verbatim}
$vi files/myscript.sh
#!/bin/bash
ls -lah > /monroe/results/listing.txt
\end{verbatim}}
Any files that your experiment creates in \identifier{/monroe/results} are delivered to the repository, where you will be able to retrieve them.
\emph{Writes to any other part of the filesystem will be lost once the experiment is finished.}
In periodic schedules, no data will survive from one execution to the next (i.e., the container is loaded fresh before each execution).
If result persistence is needed, the experimenter will have to supply it by downloading the needed files from the network during the experiment itself.
\item You should not need to modify the \identifier{build.sh} file. The name of the container is the name of the current directory, and it must match the name of the \identifier{.docker} file (e.g., \identifier{template.docker} as we are in a folder named \identifier{template/}).
\item The file \identifier{template.docker} is the script used to build your container.
You can modify it to:
\begin{itemize}
\item Define the entry point of your experiment (``ENTRYPOINT'').
\item Change the base image of the container, e.g., \identifier{monroe/base}.
\item Install additional packages or libraries.
\end{itemize}
For example:
{\VerbatimFont\begin{verbatim}
FROM monroe/base
MAINTAINER your-email-address
COPY files/* /opt/monroe/
#Default cmd to run.
ENTRYPOINT ["dumb-init", "--", "/bin/bash", "/opt/monroe/myscript.sh"]
\end{verbatim}}
This example will copy the files in the \identifier{files/} directory to the one you specify \emph{inside} the docker container (e.g., \identifier{/opt/monroe}).
TIP: If you need to install additional packages in the container, be sure to clean any temporary files from the image. Also, notice that the Docker creation script analyses the contents of the container filesystem after every line in the .docker script is executed. That means that, even if you delete files at the end, Docker will create intermediate ``layers'' that will be downloaded and applied sequentially to build the final image of your container. Consider instead using one-liners such as the following:
{\VerbatimFont\begin{verbatim}
RUN apt-get update && apt-get install -y vim && apt-get clean
\end{verbatim}}
This will ensure that the files are deleted before Docker analyses the filesystem.
\item Modify the file \identifier{push.sh} to reflect the name of your repository:
{\VerbatimFont\begin{verbatim}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CONTAINER=${DIR##*/}
CONTAINERTAG=myuser/myrepo # --> Modify to your own dockerhub user/repo
docker login && docker tag ${CONTAINER} ${CONTAINERTAG} && docker push ${CONTAINERTAG} && \
echo "Finished uploading ${CONTAINERTAG}"
\end{verbatim}}
During the development phase of your experiment, follow these steps to make your container accessible for the testing nodes:
\begin{itemize}
\item Create an account at Docker Hub.
\item Create your own repository (you can create one container as private; no limits for public ones). Containers for deployment on \monroe{} nodes must be public.
\item In your development machine, run: \identifier{docker login}. It will ask you for your credentials. \tabitem
\end{itemize}
\item After populating the \identifier{files/} directory, modifying the .docker file and updating the \identifier{push.sh} file, you are ready to create the image:
{\VerbatimFont\begin{verbatim}
$sudo ./build.sh
Using default tag: latest
latest: Pulling from monroe/base
Digest: sha256:6df1195a3cc3da2bfe70663157fddc42e174ec88761ead7c9a3af591e80ebbd5
Status: Image is up to date for monroe/base:latest
Sending build context to Docker daemon 11.26 kB
Step 1 : FROM monroe/base
---> d1b4f4baa60d
Step 2 : MAINTAINER mikepeon@imdea.org
---> Using cache
---> 0b05b5c453c7
Step 3 : COPY files/* /opt/monroe/
---> acc2df443070
Removing intermediate container 66a666516a27
Step 4 : ENTRYPOINT dumb-init -- /bin/bash /opt/monroe/myscript.sh
---> Running in f4b7a1ee804a
---> 096c7a56ff1c
Removing intermediate container f4b7a1ee804a
Successfully built 096c7a56ff1c
Finished building template
\end{verbatim}}
\item Test that your new docker container is available:
{\VerbatimFont\begin{verbatim}
$sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 690ed74de00f 4 months ago 960 B
your_docker_account/your_experiment latest xxxxxxxxxxxx 32 seconds ago 626.6 MB
monroe/base latest xxxxxxxxxxxx 12 days ago 626.6 MB
\end{verbatim}}
Exact image ids and sizes will vary.
\item Push the container image to the repository:
{\VerbatimFont\begin{verbatim}
$ sudo ./push.sh
Username (your-Docker-user-name):
Password: (type your DockerHub password)
WARNING: login credentials saved in /home/your-username/.docker/config.json
Login Succeeded
The push refers to a repository [docker.io/mikepeon/template]
5f339bfdaae2: Pushed
486ab26686cc: Layer already exists
034f70c0d9cd: Layer already exists
86b5acd8772a: Layer already exists
f03317610243: Layer already exists
50f6c1bd7ce6: Layer already exists
aec5953bffa2: Layer already exists
507169b05eea: Layer already exists
5d799297d10c: Layer already exists
759d76df9ac7: Layer already exists
5f70bf18a086: Layer already exists
12e469267d21: Layer already exists
latest: digest: sha256:c855de65307191b4832b2ec60a4401c1b63424827c29149703c5d7ef07b519f7
size: 3001
Finished uploading your-username/template
\end{verbatim}}
\item You can now test that your image runs correctly, even on your own PC (if the experiment logic and resource demands allow for it).
{\VerbatimFont\begin{verbatim}
$mkdir /run/shm/myresults
$sudo docker run -v /run/shm/myresults:/monroe/results your_docker_account/your_experiment
--> The output of your experiment will be in /run/shm/myresults/listing.txt
\end{verbatim}}
The docker command line allows you to specify a mapping between a directory inside the docker image and one in the host system.
In this case, we have mapped \identifier{/monroe/results} from the container to \identifier{/run/shm/my\-results}.
This is useful if you are running the container locally in a normal PC for debugging purposes.
\textbf{IMPORTANT:} This process shows how to build and run a container \emph{locally} in your workstation.
However, experimenters do not have direct access to the \monroe{} nodes.
Therefore, to execute your experiment \emph{in} a \monroe{} node, you will follow the process just up to the \identifier{sudo ./push.sh} step and then use the web interface to upload and schedule the container into the nodes.
\end{enumerate}
You may check the contents of \identifier{experiments/*} for more useful examples.
The following is a list of useful common Docker commands:
\begin{itemize*}
\item To list installed/built images (and get their ids):
\begin{verbatim}docker images\end{verbatim}
\item To list running containers and get their tags:
\begin{verbatim}docker ps\end{verbatim}
\item To stop running containers:
\begin{verbatim}docker kill container-tag\end{verbatim}
\item To delete images:
\begin{verbatim}docker rm -f image_id\end{verbatim}
\item To retrieve the latest version of an image (e.g., \identifier{monroe/base}):
\begin{verbatim}docker pull monroe/base\end{verbatim}
\item To attach to a running container and get an interactive shell:
\begin{verbatim}docker exec -i -t container-tag bash\end{verbatim}
\end{itemize*}
\subsubsection{Package and tool installation}
\label{subsubsec:packagesInstallation}
If you have to install extra packages, libraries or tools, do it from the \identifier{my\_experiment.docker} file.
You should never pull repositories or download libraries from inside your experiment as this will count against your data quota (and execution slot) for every instance of your experiment.
Instead, modify the container configuration file as in the following example:
{\VerbatimFont\begin{verbatim}
FROM monroe/base
MAINTAINER your-email-address
RUN apt-get update && apt-get install -y \
python \
python-pip \
traceroute \
&& apt-get clean
RUN pip install pygame
RUN mkdir -p /opt/yourname
COPY files/* /opt/yourname/
#Default cmd to run
ENTRYPOINT ["dumb-init", "--", "/bin/bash", "/opt/yourname/myscript.sh"]
\end{verbatim}}
You may also download any files using \identifier{wget}, but you may simply put them in the \identifier{files/} folder as well.
Remember, this happens during container creation on your PC, \emph{not} during experiment execution on the nodes.
If you find the need for big libraries that you think should go into the base image, please contact \monroe{}'s administrators.
TIP: The easiest way to find out which packages and versions are available in the \monroe{} base image is to create a simple container and run an interactive batch session inside it in your workstation.
For example, assuming that you have a basic container that simply waits when run, you may follow the following steps:
{\VerbatimFont\begin{verbatim}
mkdir /run/shm/myresults
docker run -v /run/shm/myresults:/monroe/results repository/your_container &
docker ps --> Look for the tag of your running container
docker exec -i -t container_tag bash
--> Here you are inside the container
dpkg -l > /monroe/results/package-listing.txt
exit
--> You'll find the output at /run/shm/myresults/package-listing.txt
\end{verbatim}}
For easier reference, Table~\ref{tab:installedPackages} in Appendix~\ref{app:installedPackages} gives a detailed listing of packages available in \identifier{monroe/base} at the time of writing this text.
\subsubsection{Band Locking}
This option allows experimenters to lock the monroe node modems in LTE, 3G etc...
by sending a PUT request from within a \textbf{container} using different lock types see Table~\ref{tab:lock} using curl similar to:
{\VerbatimFont\begin{verbatim}
curl -X POST -d '{"lockType": 16}' http://172.17.0.1:80/modems/1/lock
HTTP/1.0 200 OK
\end{verbatim}}
Where "lockType": 16 indicates that it has been locked on 4G LTE and modems/\#/lock indicates the modems ip4table to check ip4table first, or that the modem is locked run:
{\VerbatimFont\begin{verbatim}
curl -s http://172.17.0.1:80/modems/ | jq
[
{
"ispName": "YOIGO",
"apnId": 77,
"apn": "internet",
"mode": "LTE",
"deviceType": 0,
"disconnects": 0,
"ip4table": 1,
"modemState": 7,
"deviceKind": 1,
"ifname": "wwan0",
"deviceMode": 5,
"deviceSubMode": 10,
"signalStrength": -56,
"modemName": "MC7455",
"locking": 16,
"imei": "359072060710833",
"iccid": "8934041514050773954",
"usb_vid": 4505
}
]
\end{verbatim}}
\begin{table}[]
\centering
\begin{tabular}{l|l}
\hline
\textbf{LockType} & \textbf{DESCRIPTION} \\ \hline
4 & Lock in MODE\_GSM \\ \hline
8 & Lock in MODE\_UMTS \\ \hline
16 & Lock in MODE\_LTE \\ \hline
\end{tabular}
\caption{LockTypes}
\label{tab:lock}
\end{table}
\subsubsection{Virtual Machine support}
This option allows experimenters to use a different kernel or kernel options than installed on the \monroe{} node.
To develop and deploy the experiments to the nodes we utyilize the docker container system. The container will on the node be converted to a virtual machine (\identifier{kvm}) and executed in a environment similar to a regular experiment.
A example on how to configure and run a virtual machine experiment can be found here: \url{https://github.com/MONROE-PROJECT/Experiments/tree/master/experiments/nodetest}~.
There are a couple of things to consider when deploying a experiment as a virtual machine;
\begin{itemize*}
\item Base your docker image on \identifier{monroe/base:virt}
\begin{itemize*}
\item \identifier{monroe/base:virt} is a stripped down version of \identifier{monroe/base}: \url{https://github.com/MONROE-PROJECT/Experiments/blob/master/monroe_base/10_virt_docker}~.
\end{itemize*}
\item Include a kernel
\item Set the parameter \identifier{"vm":1} when scheduling the experiment.
\item Be very conservative on diskspace, eg installed packages etc.
\item Define as the last line of /opt/monroe/user-experiment.sh how to start your experiment.
\item Issue poweroff as last command of the experiment script.
\end{itemize*}
\subsubsection{NEAT support}
This option allows experimenters to route all TCP traffic through a NEAT proxy \url{https://github.com/NEAT-project/neat}~. To enable this feature set the parameter \identifier{"neat":1} when scheduling the experiment. The NEAT rest api can be reached from inside a experiment container on url \url{172.17.0.1:45888}, eg \url{172.17.0.1:45888/pib} and \url{172.17.0.1:45888/cib}.
\subsection{Optional interactive debugging}
To speed up the process of debugging experiments in the nodes, three debugging paths are provided.
First, experimenters can order (buy) a number of ``development'' nodes to be hosted locally in their premises.
These nodes, which will not be accessible through the standard scheduler and user interface, can be accessed through local interfaces (eth, serial console) and provide root access.
Second, and only for ``testing'' nodes, the user interface includes an option to provide an SSH public key to the container.
Once the container starts, experimenters can connect to monitor experiment progress.
The SSH session can extend until the container finishes or is stopped.
Finally, a virtual machine containing a ``virtual \monroe{} node'' has been designed to ease development and debugging on a local PC.
This virtual node replays metadata previously recorded from a real one.
\textcolor{red}{CAUTION:} Enabling ssh changes the entry point to the container, for this matter it is best not to use ssh when you have designed your container just to make sure that the container starts automatically in the UI.
\subsection{Mandatory certification process}
\label{subsec:testingProcess}
\monroe{} experiments have to be certified before they can be executed by deployed nodes.
A small number of nodes are available through the user interface so that experimenters can test their experiments before starting the certification process.
The certification process consists of the following steps:
\begin{enumerate}
\item The experimenter contacts their patron to inform them that a new version of their experiment is ready for certification.
\item The experimenter has to provide a summary of the experiment, i.e., overall purpose, design and implementation (reasonable length around \num{0.5} to \num{1} A4~pages).
\item The container should be submitted as source (i.e., build scripts for Docker, not tools source code) for easy inspection by the patron.
Additionally, this will allow the \monroe{} administrators to update the containers when a new version of \identifier{monroe/base} is available.
\item The patron, or the maintenance team, will then build (or pull) the container, tag it as \identifier{partnername/\allowbreak experimentname}, and push it to the deployed docker repository.
\end{enumerate}
Every experiment submitted to the \monroe{} testbed \emph{must} first pass through a testing process to receive manual approval by a \monroe{} administrator.
To submit your experiment for testing, you have to use the web interface specifying ``testing'' as the required node type.
\subsection{Deployment}
\label{subsec:deployment}
\monroe{}'s scheduling system will automatically deploy experiments to the nodes before their execution time.
The nodes will fetch the container image from the Docker repository, and the size of the download will be accounted in your data quota.
Notice that in the case of periodic experiments, each time an experiment is run, the Docker container may have to be re-downloaded and its costs will be accounted in your quota.
\subsection{Life cycle of monroe/base}
The current version of \identifier{monroe/base} deployed on nodes is tagged as ``latest.''
New versions will be tagged as ``staging;'' their existence will be announced on the experimenters mail list.
Experimenters must check their experiments against the new stagging version to verify that no incompatibilities appear.
Any relevant issues can be discussed with the \monroe{} administrators.
After a reasonable period of time, the new version will be retagged as ``latest,'' and deployed into the nodes.
All the containers should have been built against the new version at this time to avoid wasting quota resources when they are deployed in the nodes.
%------------------------------------------------------------%
%------------------------------------------------------------%
%------------------------------------------------------------%
\section{Resource allocation, and experiment scheduling and monitoring}
\label{sec:allocSchedMonitor}
Once a experiment is configured as a Docker container, it can be scheduled multiple times under different conditions using the user client web located at \url{https://www.monroe-system.eu}~.
\subsection{User login and certificates}
\label{subsec:login}
User identification in \monroe{} is achieved through client certificates.
Every experimenter has their own certificate compatible with the FED4FIRE%
\footnote{\url{http://www.fed4fire.eu/}} %
federation.
User certificates are issued by iMinds through the following URL: \url{https://authority.ilabt.iminds.be/}.
New users must create a new account (``sign up'').
Be sure to select the option ``Join Existing Project'' and type the name ``Monroe'' in the project name field (Figure~\ref{fig:iMindsCreateAccount}).
The authorization process involves a manual verification step by one of the \monroe{} administrators, so it will probably take one or two days.
\begin{figure}[tp]
\centering
\includegraphics[width=0.5\textwidth]{iMindsCreateAccount2.png}
\caption{iMinds registration page to obtain FED4FIRE-compatible certificates for use with the \monroe{} platform.}
\label{fig:iMindsCreateAccount}
\end{figure}
Please, notice that the current policy for \monroe{} is to use one user certificate per project, shared between all the experimenters belonging to that project.
Once the identity of the experimenter is approved, they will receive an informative email.
They should then log into the iMinds webpage to download the certificate files (PKCS12).
These files must be installed in the experimenter browser.
After that, the user should be able to access the user web directly.
Upon request of the main (index.html) file, the browser will contact \monroe{} servers to verify that the user credentials are correct.
In the case of any problems, the user will be presented with instructions on how to obtain a certificate.
If the client certificate is verified successfully, they will be automatically redirected to the listing of their experiments.
\textbf{NOTE:} User certificates are manually activated in the scheduling software.
To use your certificate, please send its SSL ID (``fingerprint'') to one of the \monroe{} administrators (e.g., \url{mailto:mikepeon@imdea.org}, \url{mailto:mohamed.moulay@imdea.org}).
You may find it in the screen after pressing the ``Try me'' button, once the certificate is correctly installed in your browser:
{\VerbatimFont\begin{verbatim}
{
"fingerprint": "c79f1967aea17811a1ebed39b7d718430904338a",
"user": {
"id": 3,
"name": "MONROE Test admin",
"quota_data": 50000000000,
"quota_storage": 500000000,
"quota_time": 500000000,
"role": "admin",
\end{verbatim}
\color{red}
\vspace{-0.5cm}
\begin{verbatim}
"ssl_id":"c79f1967aea17811a1ebed39b7d718430904338a",
\end{verbatim}
\color{black}
\vspace{-0.7cm}
\begin{verbatim}
},
"verified": "SUCCESS"
}
\end{verbatim}}
~\\$\Rightarrow$~We have identified some common issues that are not yet solved. Below are some workarounds:
\begin{itemize}
\item For the first login, you may be asked for your user certificate and then your browser may show a security warning. This is due to the use of a self-signed server certificate. Please ask your browser to proceed. Then, you will probably see an error page from \monroe{}. Please, click the red button labeled ``Try me'' and check that you get a successful data output. Finally, please proceed again to the main page of the project. From that point, you should be able to access the system without further problems in future sessions. (Pointers on how to simplify this issue are welcome!)
\item Firefox on OSX has an issue with CORS headers. Although the web and scheduling servers are running now on the same machine, you may still encounter this problem.
\end{itemize}
\vspace{-0.4cm}
~\\$\Rightarrow$~\textcolor{red}{Reminder:} All user certificates will end on the 31st of July 2018.
\subsubsection{Installation of user certificates in Chrome}
\label{subsec:userCertsInstallWinChrome}
This section explains how to install the FED4FIRE-compatible user certificates used by the \monroe{} platform in Google Chrome for Windows.
The procedure for other browsers and platforms should be similar.
\begin{enumerate}
\item Go to your browser settings page:\\
\begin{center}\includegraphics[width=0.7\textwidth]{InstallCert01.png}\end{center}
\item Display the advanced configuration settings:\\
\begin{center}\includegraphics[width=0.7\textwidth]{InstallCert02.png}\end{center}
\item Go to the section labeled ``HTTPS/SSL'' and click the button ``Manage certificates...'':\\
\begin{center}\includegraphics[width=0.7\textwidth]{InstallCert03.png}\end{center}
\item The dialog box for managing your certificates will be displayed. Press the button ``Import...'' to import your certificate:\\
\begin{center}\includegraphics[width=0.5\textwidth]{InstallCert04.png}\end{center}
\item In the new dialog, click ``Next'':\\
\begin{center}\includegraphics[width=0.5\textwidth]{InstallCert05.png}\end{center}
\item In the file-selection dialog that appears next, change the file type from ``X.509 Certificate (*,cer;*.crt)'' to ``Personal Information Exchange'':\\
\begin{center}\includegraphics[width=0.6\textwidth]{InstallCert06.png}\end{center}
\item And select the file containing your certificate:\\
\begin{center}\includegraphics[width=0.6\textwidth]{InstallCert07.png}\end{center}
\item In the next dialog box, enter your certificate password:\\
\begin{center}\centering\includegraphics[width=0.5\textwidth]{InstallCert08.png}\end{center}
\item If the import is successful, your certificate will be imported to your ``Personal Store'' and you will be able to access the \monroe{} user interface by selecting it when prompted by your browser. Notice that you may still get a warning about the validity of the server certificate.
\end{enumerate}
\FloatBarrier
\subsection{Resource allocation}
\label{subsec:resourceAllocation}
The ``New'' tab allows assigning resources and scheduling new experiments.
Here, the user will be presented with a page similar to Figure~\ref{fig:newExperimentBlank}.
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth]{NewExperiment_blank.png}
\caption{Example for the creation of a new experiment.}
\label{fig:newExperimentBlank}
\end{figure}
To create a new experiment, at least the following parameters must be specified:
\begin{description}
\item [Name:] A representative experiment description.
\item [Script:] A Docker hub path for the experiment container. In the previous example, it would be \identifier{your\_\allowbreak docker\_\allowbreak account/my\_\allowbreak experiment.} Experiments on deployed nodes must be lodged in \monroe{}'s repository: \identifier{docker.monroe-system.eu/...} (the final URL is communicated when the container is certified).
\item [Number of nodes:] The number of nodes that must execute the experiment.
\item [Duration:] Length of the experiment execution, in seconds (excluding the time required to deploy the container).
The node will kill the experiment after this time. The minimum slot that can be reserved is $\SI{5}{\minute}$ and the maximum, $\SI{24}{\hour}$. However, because of the scheduling of \monroe{} experiments, the maximum possible duration is in practice slightly less than three hours.
\end{description}
If the starting date is fixed, the user can introduce it in the field ``Start.''
All dates are introduced as UTC times; the interface presents alongside the corresponding local time for the user's browser.
The scheduler will then try to satisfy the requirements.
Alternatively, if the starting date is not relevant, the user may leave this field empty and press the button ``Check availability'' to check the earliest available slot (add at least ten minutes to the proposed time to allow for container deployment into the nodes).
If the user just wants to submit the experiment as soon as possible, they can just mark the option ``As soon as possible'' and leave the other fields empty when pressing the ``Submit'' button.
Additionally, the user may specify the following restrictions (Figure~\ref{fig:newExperimentFilters}):
\begin{description}
\item [Country filter:] The user may select nodes located in one or several countries, or they may choose to use nodes from any country indistinctly.
\item [Node type:] %Available node types are static or mobile (e.g., in buses or trains).
%Some mobile nodes may have restricted availability.
%The ``testing'' nodes are reserved for experiments that must still be sanctioned by a \monroe{} administrator.
Currently available node types are deployed or testing.
The testing nodes are reserved for experiments that must still be verified by a \monroe{} administrator.
Experiments on deployed nodes must be lodged in \monroe{}'s repository: \identifier{docker.monroe-system.eu/}.
\item [Node model:] Until complete retirement of the old \monroe{} nodes, experiments can run on old or new nodes. Eventually, all experiments will be run on new nodes.
\item [Number of interfaces:] New \monroe{} nodes come in pairs of co-located nodes, where one node (``head'') has two 4G interfaces, and the other (``tail'') has one 4G interface and one WiFi interface.
Specifying the number of required interfaces for the experiment restricts the type of nodes that can be selected by the scheduler:
\begin{itemize*}
\item One interface: The scheduler chooses only nodes with one 4G interface and WiFi (tails).
\item Two interfaces: The scheduler chooses only nodes with two 4G interfaces (heads).
\item Three interfaces: The scheduler chooses pairs of co-located nodes. In that case, the number of requested nodes must be even, as each pair is counted as two nodes. The assignment is atomic, i.e., either the complete pairs will be secured or the complete assignment will fail.
\end{itemize*}
The numbering of nodes follows the convention that the head in a pair receives number $n$ and the co-located tail receives number $n+1$, where $n$ is even.
\item [Node IDs:] If the experimenter wants to use a set of specific nodes, for example, to repeat one experiment under the very same conditions, it is possible to introduce a comma-separated list of required nodes, instead of accepting any available ones.
\item [Active-data quota:] The experimenter must specify the active-data quota for each interface, that is, the maximum amount of data that each interface can use.
The scheduler checks this value against the quota available for the user.
\item [Log files quota:] The user may want to place an estimate on the maximum amount of data that may be generated as result files in \identifier{/monroe/results}.
This is important because the size of the results is also counted against the user quota.
\item [Deployment-storage quota:] This is the size allocated for the container file system in the node.
Bigger sizes require more time to deploy.
The maximum limit is \SI{1}{\giga\byte}.
\item [Additional options:] The user may provide a set of comma separated key-value pairs.
These options will be appended to the JSON-formatted configuration file that can be read at run-time by the container at \identifier{/monroe/config}.
This mechanism enables experiment parameterization.
\end{description}
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth]{NewExperimentFilters.png}
\caption{Filters for node selection.}
\label{fig:newExperimentFilters}
\end{figure}
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth]{eduroam.png}
\caption{Eduroam configuration.}
\label{fig:edu}
\end{figure}
\subsubsection{Eduroam}
\label{subsec:eduoroam}
In the additional option tab experimenters can use eduroam, which is a roaming service for researchers or students in universities across Europe, to use eduoroam see Figure~\ref{fig:edu} the key values are similar to:
{\VerbatimFont\begin{verbatim}
"_eduroam": { "identity": "100368007@****", "hash": "YourpasswdHash" }
\end{verbatim}
When the experiments starts the docker container will initialize wpa\_supplicant to bring up the Wlan0 interface up, as it will be available in the network namespace alongside op0, op1. The start log and the container network namespace will be similar to:
{\VerbatimFont\begin{verbatim}
$Start Log$
Starting container... Successfully initialized wpa_supplicant
Killed old client process
Loading iptables rules
ok.
Starting accounting.
Loading iptables rules
Started docker process xx.
Startup finished Tue Month x xx:xx:xx UTC 20xx.
Started allocator client
JSON request: {"address":"xxx.xxx.xx.xx","ifname":"wlan0","addr_family":x,"cmd":0,"version":1}
Sent 80 bytes
Server: tas_socket Table: xxxxx Lease: xxxxxx Ifname: wlan0 Address: xxx.xxx.xx.xx Family: x
Table: xxxxx
root@xxxxxxx:/# ifconfig
eth0: flags=xx<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.xx.x.x netmask xxx.xxx.xxx.x broadcast x.x.x.x
lo: flags=xx<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
op0: flags=xx<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.xx.x.x netmask xxx.xxx.xxx.xxx broadcast x.x.x.x
wlan0: flags=4xxx<UP,BROADCAST,MULTICAST> mtu 1500
inet xxx.xx.xx.xx netmask xxx.xxx.xxx.xxx broadcast x.x.x.x
\end{verbatim}
Noting that the eduroam parameters are hidden parameters, but not encrypted and they are still stored in the scheduler database.
\subsection{Experiment scheduling}
\label{subsec:experimentScheduling}
When all the requirements are specified, the user needs to click the ``Submit experiment'' button to submit to the scheduler.
The experiments must respect several restrictions to be successfully scheduled:
\begin{itemize}
\item The starting time must be at least \SI{10}{\minute} in the future, to allow time for container deployment.
\item No experiment can be scheduled more than one month in advance.
\item Periodic experiments must have a period greater than \SI{3600}{\second}.
The finishing time must also obey the previous rule, that is, the last experiment instance in the recurrence must be scheduled in less than a month from the current time.
\item No experiment (or instance in a series) can last more than one day.
In practice, the longest period that an experiment will be awarded is less than \SI{3}{\hour}.
\item If a list of specific nodes and a starting date are given, the scheduler may be unable to grant the required resources.
% TODO: Find a way to ease the problem of finding a slot, with perhaps a time-line of resource availability.
\end{itemize}
\subsubsection{Recurrence}
\monroe{}'s scheduler allows to specify experiments that need to be repeated periodically.
In that case, the user has to specify the repetition period ($\ge \SI{3600}{\second}$) and the final stopping date.
The scheduler will treat each repetition as a different experiment and will try to satisfy the requirements for each of them consecutively.
However, the operation is atomic:
Either all the repetitions are scheduled, or none are.
\subsubsection{Checking availability}
If the exact starting time is not relevant, the user can press the ``Check availability'' button.
If the requirements can be satisfied, a message explaining when the experiment might be started will be displayed.
Additionally, it will also inform of the maximum number of nodes that can be used during this period, and the maximum ending time.
With these data, the experimenter may decide to increase the number of nodes that run the experiment, or increase its duration until the time that the scheduler is likely being able to grant.
Figure~\ref{fig:newExperimentCheckAvailability} shows the answer of the scheduler for an availability query.
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth]{NewExperimentCheckAvailability.png}
\caption{The scheduler may supply hints on the scheduling availability, including the earliest starting date that is possible, the end of the availability period for the required resources and the maximum number of nodes, with the specified requirements, that the experiment could reserve. In this example, the experiment can start on ``2017-02-28 16:04:08 UTC'' and can last until ``2017-02-28 16:45:02 UTC.'' The experiment can be scheduled with up to 36 nodes during this period.}
\label{fig:newExperimentCheckAvailability}
\end{figure}
\subsubsection{First availability scheduling}
\begin{figure}[tp]
\centering
\includegraphics[width=0.75\textwidth]{FirstAvailability1.png}
\caption{Example of a first availability scheduling.}
\label{fig:firstAvailability1}
\end{figure}
\begin{figure}[tp]
\centering
\includegraphics[width=0.9\textwidth]{FirstAvailability2.png}
\caption{Status of an experiment in the fist availability queue without defined starting and stopped times.}
\label{fig:firstAvailability2}
\end{figure}
The \monroe{} scheduler allows users to define experiments with an execution window instead of a fixed starting time.
This option is particularly useful with mobile nodes whose active times are difficult to foresee.
With first availability scheduling, the user specifies requirements as usual, except the starting date; instead, a temporal window within which the experiment can be scheduled is defined.
The scheduler will assign a node or set of nodes to the experiment, without committing a specific time slot.
When the node contacts the scheduler (e.g., when a mobile bus becomes online), if it has no pending tasks, the scheduler will assign one of the tasks in the first-availability queue.
Figure~\ref{fig:firstAvailability1} shows the definition of an experiment for first availability scheduling.
In the time between the experiment definition and the assignment of an execution window to each of its tasks, the status of the experiment tasks shows no start and stop times, as shown in Figure~\ref{fig:firstAvailability2}.
The start and stop times of the experiment show the boundaries of the execution window for all the tasks.
First availability scheduling presents some particularities that users should consider:
\begin{itemize}
\item If several nodes are requested, execution on each node is asynchronous and thus \emph{not} guaranteed to be simultaneous.
\item Experiments may not be executed if the end of the scheduling window is reached without a chance to execute them.
\item Tasks in the first-availability queue are not deployed on advance to the nodes. The user should take this into consideration, increasing the ``duration'' of the experiment to include long deployment times.
\item The scheduler checks if the first-availability request has a chance to be fulfilled at all, under the current circumstances.
\item By default, the execution window ends \SI{24}{\hour} after the current time.
\end{itemize}
\subsection{Experiment monitoring}
\label{subsec:experimentMonitoring}
Once an experiment is successfully submitted, the user can check its progress under the ``Status'' tab.
Figure~\ref{fig:ExperimentsSummary} shows an example of a list of experiments.
\begin{figure}[tp]
\centering
\includegraphics[width=1.0\textwidth]{ExperimentSummary.png}
\caption{List of user experiments.}
\label{fig:ExperimentsSummary}
\end{figure}
All the active (i.e., not completed) experiments for the user are shown.
Experiments that have not yet been started can be canceled and deleted.
However, the scheduler will try to stop experiments that have already started, but they will not be deleted from the list.
Clicking on any experiment displays the details for its individual schedules.
There, the number of schedules that are defined but not yet deployed, the ones that are deployed and ready to be started, the ones that are currently running, etc., is summarized.
One line is presented for each individual schedule on each \monroe{} node.
Table~\ref{tab:experimentStates} explains the states in which an individual task may be.
\begin{table}[tp]
\caption{Experiment states}\label{tab:experimentStates}
\begin{center}
\begin{tabular*}{1\textwidth}{p{0.15\textwidth}p{0.8\textwidth}}
\toprule
\textbf{STATE} & \textbf{DESCRIPTION} \\ \midrule
\multicolumn{2}{l}{\textbf{(Ongoing states)}}\\~\\
\textcolor{blue}{Defined} & The experiment is created in the scheduler. If a task remains in this state past its starting time, the node was probably shut down and the task will not be executed anymore.\\
\textcolor{blue}{Requested} & The node has requested the container and is deploying it.\\
\textcolor{blue}{Deployed} & The node has already deployed the container and is waiting for its starting time.\\
\textcolor{blue}{Delayed} & The scheduling process failed temporarily.\\
\textcolor{blue}{Started} & The container is being executed in the designated node. The ``download'' link for the task results is already available.\\
\textcolor{blue}{Restarted} & The node has restarted the experiment after a node failure.\\~\\
\midrule
\multicolumn{2}{l}{\textbf{(Final states)}}\\~\\
\textcolor{green}{Finished} & The task was correctly executed and it finished on its own before consuming the complete time slot.\\