Loading...39 | {% endblock %} -------------------------------------------------------------------------------- /docs/tutorials/tictoc/code/txc1.cc: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of an OMNeT++/OMNEST simulation example. 3 | // 4 | // Copyright (C) 2003 Ahmet Sekercioglu 5 | // Copyright (C) 2003-2015 Andras Varga 6 | // 7 | // This file is distributed WITHOUT ANY WARRANTY. See the file 8 | // `license' for details on this and other legal matters. 9 | // 10 | 11 | #include
18 |
19 | !!! tip
20 | For further information about the charting and processing capabilities,
21 | please refer to the OMNeT++ Users Guide (you can find it in the `doc` directory of the OMNeT++ installation).
22 |
23 | Our last model records the `hopCount` of a message each time the message
24 | reaches its destination.
25 | To plot these vectors for all nodes, select the 6 nodes in the browse data tab.
26 | Right click and select Plot.
27 |
28 |
29 |
30 | We can change various options about how the data on the chart is displayed.
31 | Right click on the chart background, and select Properties.
32 | This opens the *Edit LineChart* window.
33 | In the *Lines* tab, set *Line type* to *Dots*, and *Symbol Type* to *Dot*.
34 |
35 |
36 |
37 | To add a legend to the chart, select *Display legend* on the *Legend* tab.
38 |
39 |
40 |
41 | The chart looks like the following:
42 |
43 |
44 |
45 | If we apply a `mean` operation we can see how the `hopCount` in the different
46 | nodes converge to an average.
47 | Right-click the chart, and select *Apply -> Mean*.
48 | Again, right-click on the chart background, and select *Properties*.
49 | In the *Lines* tab, set *Line type* to Linear, and *Symbol Type* to None.
50 | The mean is displayed on the following chart. The lines are easier to see this way because they are thinner.
51 |
52 |
53 |
54 | Scalar data can be plotted on bar charts.
55 | The next chart displays the mean and the maximum of the `hopCount` of the messages
56 | for each destination node, based on the scalar data recorded at the end of the simulation.
57 | In the *Browse data* tab, select *Scalars*. Now select `hop count:max` and `hop count:mean`
58 | for all 6 nodes.
59 |
60 |
61 |
62 |
63 | To create a histogram that shows `hopCount`'s distribution, select *Histograms*
64 | on the *Browse data* tab. Select all nodes, and right click *Plot*.
65 |
66 |
67 |
68 | [`cMessage`]: https://omnetpp.org/doc/omnetpp/api/classomnetpp_1_1cMessage.html
69 |
70 |
--------------------------------------------------------------------------------
/docs/tutorials/tictoc/code/txc13.cc:
--------------------------------------------------------------------------------
1 | //
2 | // This file is part of an OMNeT++/OMNEST simulation example.
3 | //
4 | // Copyright (C) 2003 Ahmet Sekercioglu
5 | // Copyright (C) 2003-2015 Andras Varga
6 | //
7 | // This file is distributed WITHOUT ANY WARRANTY. See the file
8 | // `license' for details on this and other legal matters.
9 | //
10 |
11 | #include to the DOM
77 |
78 | // And then invoke the highlighter on the containing .
79 | // The Rainbow.linenumbers plugin will replace the with a .
80 | Rainbow.color(pre);
81 | });
82 | };
83 |
84 | document.addEventListener("DOMContentLoaded", function (event) {
85 | pres = $('pre[src]');
86 | files = new Set();
87 | $.each(pres, function(i,pre) {pre.textContent="Loading...\n"; files.add(pre.attributes.src.value); });
88 |
89 |
90 | files.forEach(function(file) {
91 | jQuery.ajax({url: file,
92 | success: function(data) { fileLoaded(file, data); },
93 | dataType: "text" });
94 | });
95 | });
96 |
--------------------------------------------------------------------------------
/docs/tutorials/tictoc/code/txc15.cc:
--------------------------------------------------------------------------------
1 | //
2 | // This file is part of an OMNeT++/OMNEST simulation example.
3 | //
4 | // Copyright (C) 2003 Ahmet Sekercioglu
5 | // Copyright (C) 2003-2015 Andras Varga
6 | //
7 | // This file is distributed WITHOUT ANY WARRANTY. See the file
8 | // `license' for details on this and other legal matters.
9 | //
10 |
11 | #include
12 | #include
13 | #include
14 | #include "tictoc15_m.h"
15 |
16 | using namespace omnetpp;
17 |
18 | /**
19 | * This model is exciting enough so that we can collect some statistics.
20 | * We'll record in output vectors the hop count of every message upon arrival.
21 | * Output vectors are written into the omnetpp.vec file and can be visualized
22 | * with the Plove program.
23 | *
24 | * We also collect basic statistics (min, max, mean, std.dev.) and histogram
25 | * about the hop count which we'll print out at the end of the simulation.
26 | */
27 | class Txc15 : public cSimpleModule
28 | {
29 | private:
30 | long numSent;
31 | long numReceived;
32 | cLongHistogram hopCountStats;
33 | cOutVector hopCountVector;
34 |
35 | protected:
36 | virtual TicTocMsg15 *generateMessage();
37 | virtual void forwardMessage(TicTocMsg15 *msg);
38 | virtual void initialize() override;
39 | virtual void handleMessage(cMessage *msg) override;
40 |
41 | // The finish() function is called by OMNeT++ at the end of the simulation:
42 | virtual void finish() override;
43 | };
44 |
45 | Define_Module(Txc15);
46 |
47 | void Txc15::initialize()
48 | {
49 | // Initialize variables
50 | numSent = 0;
51 | numReceived = 0;
52 | WATCH(numSent);
53 | WATCH(numReceived);
54 |
55 | hopCountStats.setName("hopCountStats");
56 | hopCountStats.setRangeAutoUpper(0, 10, 1.5);
57 | hopCountVector.setName("HopCount");
58 |
59 | // Module 0 sends the first message
60 | if (getIndex() == 0) {
61 | // Boot the process scheduling the initial message as a self-message.
62 | TicTocMsg15 *msg = generateMessage();
63 | scheduleAt(0.0, msg);
64 | }
65 | }
66 |
67 | void Txc15::handleMessage(cMessage *msg)
68 | {
69 | TicTocMsg15 *ttmsg = check_and_cast(msg);
70 |
71 | if (ttmsg->getDestination() == getIndex()) {
72 | // Message arrived
73 | int hopcount = ttmsg->getHopCount();
74 | EV << "Message " << ttmsg << " arrived after " << hopcount << " hops.\n";
75 | bubble("ARRIVED, starting new one!");
76 |
77 | // update statistics.
78 | numReceived++;
79 | hopCountVector.record(hopcount);
80 | hopCountStats.collect(hopcount);
81 |
82 | delete ttmsg;
83 |
84 | // Generate another one.
85 | EV << "Generating another message: ";
86 | TicTocMsg15 *newmsg = generateMessage();
87 | EV << newmsg << endl;
88 | forwardMessage(newmsg);
89 | numSent++;
90 | }
91 | else {
92 | // We need to forward the message.
93 | forwardMessage(ttmsg);
94 | }
95 | }
96 |
97 | TicTocMsg15 *Txc15::generateMessage()
98 | {
99 | // Produce source and destination addresses.
100 | int src = getIndex();
101 | int n = getVectorSize();
102 | int dest = intuniform(0, n-2);
103 | if (dest >= src)
104 | dest++;
105 |
106 | char msgname[20];
107 | sprintf(msgname, "tic-%d-to-%d", src, dest);
108 |
109 | // Create message object and set source and destination field.
110 | TicTocMsg15 *msg = new TicTocMsg15(msgname);
111 | msg->setSource(src);
112 | msg->setDestination(dest);
113 | return msg;
114 | }
115 |
116 | void Txc15::forwardMessage(TicTocMsg15 *msg)
117 | {
118 | // Increment hop count.
119 | msg->setHopCount(msg->getHopCount()+1);
120 |
121 | // Same routing as before: random gate.
122 | int n = gateSize("gate");
123 | int k = intuniform(0, n-1);
124 |
125 | EV << "Forwarding message " << msg << " on gate[" << k << "]\n";
126 | send(msg, "gate$o", k);
127 | }
128 |
129 | void Txc15::finish()
130 | {
131 | // This function is called by OMNeT++ at the end of the simulation.
132 | EV << "Sent: " << numSent << endl;
133 | EV << "Received: " << numReceived << endl;
134 | EV << "Hop count, min: " << hopCountStats.getMin() << endl;
135 | EV << "Hop count, max: " << hopCountStats.getMax() << endl;
136 | EV << "Hop count, mean: " << hopCountStats.getMean() << endl;
137 | EV << "Hop count, stddev: " << hopCountStats.getStddev() << endl;
138 |
139 | recordScalar("#sent", numSent);
140 | recordScalar("#received", numReceived);
141 |
142 | hopCountStats.recordAs("hop count");
143 | }
144 |
145 |
--------------------------------------------------------------------------------
/docs/tutorials/cloud/page5.md:
--------------------------------------------------------------------------------
1 | # Trying It Out
2 |
3 | ## Configuration
4 |
5 | To try it out, we add a new Configuration to the `routing` sample that comes
6 | with OMNeT++.
7 |
8 | Append this section to the `omnetpp.ini` file in the `samples/routing` directory:
9 |
10 | [Config MeshExperiment]
11 | network = networks.Mesh
12 | **.width = ${10..20 step 2}
13 | **.height = ${10..20 step 2}
14 |
15 | **.destAddresses = "0 2 5 6 9 14 17 18 23 27 29 36 42 52 89 123 150 183 192"
16 | **.sendIaTime = uniform(100us, 10ms) # high traffic
17 |
18 | **.vector-recording = false
19 | sim-time-limit = 10s
20 |
21 |
22 | This configuration tries to make each of its runs execute for a significant
23 | amount of time - about a minute each on average - by setting up a large network
24 | with a small packet inter-arrival time and a relatively long simulation time
25 | limit. It also disables vector recording to keep the size of the result files
26 | within the limits of the presented solution.
27 |
28 | ## Execution
29 |
30 | To run it, open a terminal, set up the necessary environment variables using
31 | `setenv`, then change into the directory of the sample:
32 |
33 | ```terminal
34 | $ cd /path/to/omnetpp/
35 | $ . setenv
36 | $ cd samples/routing
37 | ```
38 |
39 | Then execute the `client.py` script, substituting the IP address of your Redis
40 | server on AWS:
41 |
42 | ```terminal
43 | $ python3 /path/to/client.py ./routing -c MeshExperiment --redis-host 172.17.1.19
44 | ```
45 |
46 | You should see all runs submitted to the job queue, and after a while, finishing
47 | them. The results should appear in the `results` directory, just like with local
48 | execution.
49 |
50 | ## Comparison
51 |
52 | You can compare the performance of the cloud solution with that of your own
53 | machine by running the same campaign on both, through the `time` utility:
54 |
55 | ```terminal
56 | $ time python3 /path/to/client.py ./routing -c MeshExperiment --redis-host 172.17.1.19
57 | …
58 | $ time opp_runall ./routing -c MeshExperiment
59 | ```
60 |
61 | After the output of each command, `time` will print a summary of the execution
62 | times.
63 |
64 | Locally on my computer, using all `8` of its cores, the times were:
65 |
66 | ```terminal
67 | real 4m37.610s
68 | user 25m4.576s
69 | sys 0m0.870s
70 | ```
71 |
72 | The most interesting from our perspective is the `real` time, as this shows the
73 | amount of wall-clock time it took to run each command. The `user` time is the
74 | net processing time. It is much more than the `real` time, because it is
75 | aggregated across all cores.
76 |
77 | And of the one running on AWS:
78 |
79 | ```terminal
80 | real 4m12.310s
81 | user 0m1.931s
82 | sys 0m1.925s
83 | ```
84 |
85 | With just `3` single-core workers, the simulation completes faster than running
86 | on `8` local cores. The `user` time is next to negligible in this case, because
87 | my computer spent most of the time idling, waiting for the results to come back.
88 |
89 |
90 |
91 | ## Shutting Down
92 |
93 |
94 | To prevent the aimless and useless exhaustion of your Free Tier resource
95 | allowance (or in the long term, your credit card balance), it is important to
96 | terminate your allocated resources once you are done using them. In our case,
97 | these are the EC2 Instances started by the ECS Cluster. We need to shut these
98 | down, because when calculating their usage, the whole amount of time the
99 | instances are running (or paused, but kept available) is taken into account,
100 | not just the time when they were actually used, doing something useful.
101 |
102 | If you wish to use the Cluster again later, the easiest thing to do is scaling
103 | down the number of underlying EC2 Instances to `0`. This will of course cause
104 | all running tasks to stop, as they no longer have anything to run on.
105 |
106 |
107 |
108 |
109 |
110 |
111 | Alternatively, you can delete the whole Cluster. This will also terminate the
112 | EC2 Instances, but it will delete the `worker` Service as well.
113 |
114 |
115 |
116 |
117 |
118 |
119 | The Task Definitions are not deleted either way, but this is not a problem,
120 | since they can be kept around indefinitely, free of charge.
121 |
--------------------------------------------------------------------------------
/docs/tutorials/cloud/page2.md:
--------------------------------------------------------------------------------
1 | # Implementation
2 |
3 | To put all of this together into a working solution, in the rest of this
4 | tutorial, we're going to:
5 |
6 | - Install some necessary software packages on our machine
7 | - Build a Docker image which includes OMNeT++ and the worker code
8 | - Deploy the system on AWS
9 | - Run a simple simulation campaign with it using a custom client
10 | - Take a look at all the code needed to perform the above
11 |
12 | Before you begin, create a new empty folder. Later save all linked source files
13 | from this tutorial in that.
14 |
15 | ## Solution Architecture
16 |
17 | We will create the following architecture for running simulations on AWS:
18 |
19 | We want to use Docker images for easy deployment, so we will use an ECS cluster.
20 | One container will run a Redis-based job queue, and others will be workers. The
21 | workers will need to run simulations, so their image will have OMNeT++ installed
22 | in addition to the RQ worker client. After the worker completes a simulation
23 | run, the results will be stored in the Redis database.
24 |
25 | We will provide a custom tool that submits jobs to the job queue from the user's
26 | computer and downloads the results after simulation completion.
27 |
28 | The final architecture will look like this:
29 |
30 | 
31 |
32 | In the following sections, we will show how to implement this architecture.
33 | We will discuss how to create the Docker images, how to configure the cluster,
34 | how to implement the worker and the end-user client and so on.
35 |
36 |
37 | ## Preparation
38 |
39 | First we need to install a few things on our computer.
40 |
41 | ### OMNeT++
42 |
43 | Download the archive from the [official website](https://omnetpp.org/omnetpp).
44 | Then follow the [Installation
45 | Guide](https://omnetpp.org/doc/omnetpp/InstallGuide.pdf).
46 |
47 | The `core` version will work fine as well, if you don't need the IDE.
48 |
49 | ### Docker
50 |
51 | Follow the guides on the official website: [for
52 | Ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) or
53 | [for Fedora](https://docs.docker.com/engine/installation/linux/docker-ce/fedora/).
54 |
55 | Note that even if your distribution has Docker in its own native package
56 | archive, it is most likely an outdated, and you will have to uninstall it first.
57 |
58 | ### Python 3 and pip3
59 |
60 | We will use Python version 3; and pip, which is the recommended tool for
61 | installing packages from the [Python Package Index](https://pypi.python.org/pypi).
62 | Install these using the native package manager of your distribution.
63 |
64 | On Ubuntu:
65 |
66 | ```terminal
67 | $ sudo apt install python3 python3-pip
68 | ```
69 |
70 | On Fedora:
71 |
72 | ```terminal
73 | $ sudo dnf install python3 python3-pip
74 | ```
75 |
76 | Then, in any case, upgrade `pip`:
77 |
78 | ```terminal
79 | $ sudo pip3 install --upgrade pip
80 | ```
81 |
82 | Feel free to use a `virtualenv` for this instead of `sudo` if you're familiar
83 | with the concept.
84 |
85 | ### RQ
86 |
87 | Use `pip` to install the RQ library:
88 |
89 | ```terminal
90 | $ sudo pip3 install rq
91 | ```
92 |
93 | This will install the `redis` client module as well, as a dependency.
94 |
95 |
96 | ### Getting the Code
97 |
98 | Download the following files into the directory you just created:
99 |
100 | - [utils.py](code/utils.py) - Contains some common utilities used by both `worker.py` and `client.py`.
101 | - [worker.py](code/worker.py) - Contains the code to be executed by the workers as a job.
102 | - [Dockerfile](code/Dockerfile) - Is a recipe to build the Docker image for the workers.
103 | - [client.py](code/client.py) - Is the client-side software to submit the simulations.
104 |
105 | We will take a closer look at their contents in the "Examining the Code" chapter.
106 |
107 | ### Building the Docker Image
108 |
109 |
110 | Building the image is done by issuing the following command in the directory
111 | where the above files can be found:
112 |
113 | ```terminal
114 | $ docker build . -t worker
115 | ```
116 |
117 | The `Dockerfile` is picked up automatically by name, the build context is the
118 | current directory (`.`), and the resulting image will be named `worker`.
119 |
120 | This will likely take a few minutes to complete. If you see a couple of warnings
121 | written in red, but the process continues, don't worry, this is expected.
122 |
123 | ### Publishing
124 |
125 | Now that we built our image for the worker nodes, we need to make it available
126 | for our AWS Instances by uploading it to Docker Hub.
127 |
128 | First authenticate yourself (in case you haven't already) by typing in your
129 | Docker ID and password after running this command:
130 |
131 | ```terminal
132 | $ docker login
133 | ```
134 |
135 | Now tag the image "into your repo", substituting your user name (Docker ID), so
136 | Docker knows where to push the image:
137 |
138 | ```terminal
139 | $ docker tag worker username/worker
140 | ```
141 |
142 | And finally issue the actual push:
143 |
144 | ```terminal
145 | $ docker push username/worker
146 | ```
147 |
148 | This will upload about 400-500 MB of data, so it can take a while. Once it's
149 | done, your image is available worldwide. You can see it appeared on [Docker
150 | Hub](https://hub.docker.com/). You may even get email notification if it was
151 | successful.
152 |
--------------------------------------------------------------------------------
/docs/stylesheets/jupyter.css:
--------------------------------------------------------------------------------
1 | /* code and dataframe outputs */
2 | .md-typeset .codehilite, .md-typeset .highlight {
3 | margin-top: 0px;
4 | }
5 |
6 | /* image outputs */
7 | .output-prompt + p {
8 | margin-top: 0px;
9 | }
10 |
11 | div.output-prompt {
12 | color: #C00000;
13 | font-size: smaller;
14 | }
15 |
16 | div.input-prompt {
17 | color: #303F9F;
18 | font-size: smaller;
19 | }
20 |
21 | .output-prompt + div {
22 | overflow-x: auto;
23 | }
24 |
25 | table.dataframe {
26 | margin-left: auto;
27 | margin-right: auto;
28 | border: none transparent;
29 | border-spacing: 0;
30 | font-size: small;
31 | line-height: normal;
32 | }
33 | .dataframe thead {
34 | border-bottom: 1px solid black;
35 | }
36 |
37 | .dataframe tbody tr:nth-child(odd) {
38 | background: #f5f5f5;
39 | }
40 |
41 | .dataframe tr,
42 | .dataframe th,
43 | .dataframe td {
44 | margin: 1em 2em;
45 | }
46 |
47 | .dataframe td,
48 | .dataframe th {
49 | text-align: right;
50 | vertical-align: middle;
51 | padding: 3px 6px;
52 | }
53 |
54 | .dataframe th {
55 | font-weight: bold;
56 | }
57 |
58 | .highlight .hll { background-color: #ffffcc }
59 | .highlight { background: #f8f8f8; }
60 | .highlight .c { color: #408080; font-style: italic } /* Comment */
61 | .highlight .err { border: 1px solid #FF0000 } /* Error */
62 | .highlight .k { color: #008000; font-weight: bold } /* Keyword */
63 | .highlight .o { color: #666666 } /* Operator */
64 | .highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
65 | .highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
66 | .highlight .cp { color: #BC7A00 } /* Comment.Preproc */
67 | .highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
68 | .highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
69 | .highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
70 | .highlight .gd { color: #A00000 } /* Generic.Deleted */
71 | .highlight .ge { font-style: italic } /* Generic.Emph */
72 | .highlight .gr { color: #FF0000 } /* Generic.Error */
73 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
74 | .highlight .gi { color: #00A000 } /* Generic.Inserted */
75 | .highlight .go { color: #888888 } /* Generic.Output */
76 | .highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
77 | .highlight .gs { font-weight: bold } /* Generic.Strong */
78 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
79 | .highlight .gt { color: #0044DD } /* Generic.Traceback */
80 | .highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
81 | .highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
82 | .highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
83 | .highlight .kp { color: #008000 } /* Keyword.Pseudo */
84 | .highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
85 | .highlight .kt { color: #B00040 } /* Keyword.Type */
86 | .highlight .m { color: #666666 } /* Literal.Number */
87 | .highlight .s { color: #BA2121 } /* Literal.String */
88 | .highlight .na { color: #7D9029 } /* Name.Attribute */
89 | .highlight .nb { color: #008000 } /* Name.Builtin */
90 | .highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
91 | .highlight .no { color: #880000 } /* Name.Constant */
92 | .highlight .nd { color: #AA22FF } /* Name.Decorator */
93 | .highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
94 | .highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
95 | .highlight .nf { color: #0000FF } /* Name.Function */
96 | .highlight .nl { color: #A0A000 } /* Name.Label */
97 | .highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
98 | .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
99 | .highlight .nv { color: #19177C } /* Name.Variable */
100 | .highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
101 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */
102 | .highlight .mb { color: #666666 } /* Literal.Number.Bin */
103 | .highlight .mf { color: #666666 } /* Literal.Number.Float */
104 | .highlight .mh { color: #666666 } /* Literal.Number.Hex */
105 | .highlight .mi { color: #666666 } /* Literal.Number.Integer */
106 | .highlight .mo { color: #666666 } /* Literal.Number.Oct */
107 | .highlight .sa { color: #BA2121 } /* Literal.String.Affix */
108 | .highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
109 | .highlight .sc { color: #BA2121 } /* Literal.String.Char */
110 | .highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
111 | .highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
112 | .highlight .s2 { color: #BA2121 } /* Literal.String.Double */
113 | .highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
114 | .highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
115 | .highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
116 | .highlight .sx { color: #008000 } /* Literal.String.Other */
117 | .highlight .sr { color: #BB6688 } /* Literal.String.Regex */
118 | .highlight .s1 { color: #BA2121 } /* Literal.String.Single */
119 | .highlight .ss { color: #19177C } /* Literal.String.Symbol */
120 | .highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
121 | .highlight .fm { color: #0000FF } /* Name.Function.Magic */
122 | .highlight .vc { color: #19177C } /* Name.Variable.Class */
123 | .highlight .vg { color: #19177C } /* Name.Variable.Global */
124 | .highlight .vi { color: #19177C } /* Name.Variable.Instance */
125 | .highlight .vm { color: #19177C } /* Name.Variable.Magic */
126 | .highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
127 |
128 |
--------------------------------------------------------------------------------
/docs/tutorials/swarm/code/docker-for-aws-policy.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Sid": "FullAccessPermissions",
6 | "Effect": "Allow",
7 | "Action": [
8 | "autoscaling:*",
9 | "cloudformation:*",
10 | "elasticfilesystem:*",
11 | "elasticloadbalancing:*"
12 | ],
13 | "Resource": "*"
14 | },
15 | {
16 | "Sid": "SelectivePermissions",
17 | "Effect": "Allow",
18 | "Action": [
19 | "cloudwatch:PutMetricAlarm",
20 | "dynamodb:CreateTable",
21 | "dynamodb:DeleteItem",
22 | "dynamodb:DeleteTable",
23 | "dynamodb:DescribeTable",
24 | "dynamodb:GetItem",
25 | "dynamodb:ListTables",
26 | "dynamodb:PutItem",
27 | "dynamodb:Query",
28 | "dynamodb:UpdateItem",
29 | "dynamodb:UpdateTable",
30 | "ec2:AllocateHosts",
31 | "ec2:AssignPrivateIpAddresses",
32 | "ec2:AssociateRouteTable",
33 | "ec2:AttachInternetGateway",
34 | "ec2:AttachNetworkInterface",
35 | "ec2:AttachVolume",
36 | "ec2:AuthorizeSecurityGroupEgress",
37 | "ec2:AuthorizeSecurityGroupIngress",
38 | "ec2:CreateInternetGateway",
39 | "ec2:CreateKeyPair",
40 | "ec2:CreateNatGateway",
41 | "ec2:CreateNetworkAcl",
42 | "ec2:CreateNetworkAclEntry",
43 | "ec2:CreateNetworkInterface",
44 | "ec2:CreateRoute",
45 | "ec2:CreateRouteTable",
46 | "ec2:CreateSecurityGroup",
47 | "ec2:CreateSubnet",
48 | "ec2:CreateTags",
49 | "ec2:CreateVolume",
50 | "ec2:CreateVpc",
51 | "ec2:DeleteInternetGateway",
52 | "ec2:DeleteNatGateway",
53 | "ec2:DeleteNetworkAcl",
54 | "ec2:DeleteNetworkAclEntry",
55 | "ec2:DeleteNetworkInterface",
56 | "ec2:DeleteRoute",
57 | "ec2:DeleteRouteTable",
58 | "ec2:DeleteSecurityGroup",
59 | "ec2:DeleteSubnet",
60 | "ec2:DeleteTags",
61 | "ec2:DeleteVolume",
62 | "ec2:DeleteVpc",
63 | "ec2:DescribeAccountAttributes",
64 | "ec2:DescribeAvailabilityZones",
65 | "ec2:DescribeHosts",
66 | "ec2:DescribeImageAttribute",
67 | "ec2:DescribeImages",
68 | "ec2:DescribeInstances",
69 | "ec2:DescribeInstanceStatus",
70 | "ec2:DescribeInternetGateways",
71 | "ec2:DescribeKeyPairs",
72 | "ec2:DescribeNetworkInterfaces",
73 | "ec2:DescribeRegions",
74 | "ec2:DescribeRouteTables",
75 | "ec2:DescribeSecurityGroups",
76 | "ec2:DescribeSubnets",
77 | "ec2:DescribeTags",
78 | "ec2:DescribeVolumeAttribute",
79 | "ec2:DescribeVolumes",
80 | "ec2:DescribeVolumeStatus",
81 | "ec2:DescribeVpcAttribute",
82 | "ec2:DescribeVpcs",
83 | "ec2:DetachInternetGateway",
84 | "ec2:DetachNetworkInterface",
85 | "ec2:DetachVolume",
86 | "ec2:DisassociateAddress",
87 | "ec2:DisassociateRouteTable",
88 | "ec2:GetConsoleOutput",
89 | "ec2:GetConsoleScreenshot",
90 | "ec2:ImportKeyPair",
91 | "ec2:ModifyNetworkInterfaceAttribute",
92 | "ec2:ModifySubnetAttribute",
93 | "ec2:ModifyVpcAttribute",
94 | "ec2:RebootInstances",
95 | "ec2:ReleaseAddress",
96 | "ec2:ReleaseHosts",
97 | "ec2:RevokeSecurityGroupEgress",
98 | "ec2:RevokeSecurityGroupIngress",
99 | "ec2:RunInstances",
100 | "ec2:StartInstances",
101 | "ec2:StopInstances",
102 | "ec2:TerminateInstances",
103 | "iam:AddRoleToInstanceProfile",
104 | "iam:CreateInstanceProfile",
105 | "iam:CreateRole",
106 | "iam:DeleteInstanceProfile",
107 | "iam:DeleteRole",
108 | "iam:DeleteRolePolicy",
109 | "iam:GetRole",
110 | "iam:PassRole",
111 | "iam:PutRolePolicy",
112 | "iam:RemoveRoleFromInstanceProfile",
113 | "lambda:CreateFunction",
114 | "lambda:DeleteFunction",
115 | "lambda:GetFunctionConfiguration",
116 | "lambda:InvokeFunction",
117 | "lambda:UpdateFunctionCode",
118 | "lambda:UpdateFunctionConfiguration",
119 | "logs:CreateLogGroup",
120 | "logs:CreateLogStream",
121 | "logs:DeleteLogGroup",
122 | "logs:DeleteLogStream",
123 | "logs:DescribeLogGroups",
124 | "logs:GetLogEvents",
125 | "logs:PutLogEvents",
126 | "logs:PutRetentionPolicy",
127 | "sqs:ChangeMessageVisibility",
128 | "sqs:CreateQueue",
129 | "sqs:DeleteMessage",
130 | "sqs:DeleteQueue",
131 | "sqs:GetQueueAttributes",
132 | "sqs:GetQueueUrl",
133 | "sqs:ListQueues",
134 | "sqs:ReceiveMessage",
135 | "sqs:SendMessage",
136 | "sqs:SetQueueAttributes"
137 | ],
138 | "Resource": "*"
139 | }
140 | ]
141 | }
142 |
--------------------------------------------------------------------------------