Skip to content

Commit

Permalink
docs: 4kify images.
Browse files Browse the repository at this point in the history
These commits were squashed to avoid repo size exploding.

[cherrypick from master]
  • Loading branch information
dw committed Nov 23, 2018
1 parent 2ab6394 commit 71f8e84
Show file tree
Hide file tree
Showing 38 changed files with 100 additions and 24 deletions.
40 changes: 40 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,43 @@ div.figure {
div.body li {
margin-bottom: 0.5em;
}



/*
* Setting :width; on an image causes Sphinx to turn the image into a link, so
* set :Class: instead.
*/
.mitogen-full-width {
width: 100%;
}

.mitogen-right-150 {
float: right;
padding-left: 8px;
width: 150px;
}

.mitogen-right-225 {
float: right;
padding-left: 8px;
width: 225px;
}

.mitogen-right-275 {
float: right;
padding-left: 8px;
width: 275px;
}

.mitogen-right-300 {
float: right;
padding-left: 8px;
width: 300px;
}

.mitogen-right-350 {
float: right;
padding-left: 8px;
width: 350px;
}
19 changes: 10 additions & 9 deletions docs/ansible.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

.. image:: images/ansible/cell_division.png
:align: right
.. image:: images/ansible/ansible_mitogen.svg
:class: mitogen-right-225


Mitogen for Ansible
===================
Expand Down Expand Up @@ -211,8 +212,8 @@ New Features & Notes
Connection Delegation
~~~~~~~~~~~~~~~~~~~~~

.. image:: images/jumpbox.png
:align: right
.. image:: images/jumpbox.svg
:class: mitogen-right-275

Included is a preview of **Connection Delegation**, a Mitogen-specific
implementation of `stackable connection plug-ins`_. This enables connections
Expand Down Expand Up @@ -957,12 +958,12 @@ Sample Profiles
Local VM connection
~~~~~~~~~~~~~~~~~~~

This demonstrates Mitogen vs. connection pipelining to a local VM, executing
the 100 simple repeated steps of ``run_hostname_100_times.yml`` from the
examples directory. Mitogen requires **43x less bandwidth and 4.25x less
time**.
This demonstrates Mitogen vs. connection pipelining to a local VM executing
``bench/loop-100-items.yml``, which simply executes ``hostname`` 100 times.
Mitogen requires **43x less bandwidth and 6.5x less time**.

.. image:: images/ansible/run_hostname_100_times.png
.. image:: images/ansible/run_hostname_100_times_mito.svg
.. image:: images/ansible/run_hostname_100_times_plain.svg


Kathmandu to Paris
Expand Down
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ mitogen.parent
mitogen.fakessh
---------------

.. image:: images/fakessh.png
:align: right
.. image:: images/fakessh.svg
:class: mitogen-right-300

.. automodule:: mitogen.fakessh
.. currentmodule:: mitogen.fakessh
Expand Down
8 changes: 5 additions & 3 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Liability Waiver
Before proceeding, it is critical you understand what you're involving yourself
and possibly your team and its successors with:

.. image:: images/pandora.jpg
:align: right
.. image:: images/pandora.svg
:class: mitogen-right-350

* Constructing the most fundamental class, :py:class:`Broker
<mitogen.master.Broker>`, causes a new thread to be spawned, exposing a huge
Expand Down Expand Up @@ -78,7 +78,9 @@ operate across machines and privilege domains:
Broker And Router
-----------------

.. image:: images/layout.png
.. image:: images/layout.svg
:class: mitogen-full-width

.. currentmodule:: mitogen.core

Execution starts when your program constructs a :py:class:`Broker` and
Expand Down
6 changes: 4 additions & 2 deletions docs/howitworks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ associated with that stream if the stream is disconnected for any reason.
Example
#######

.. image:: images/context-tree.png
.. image:: images/context-tree.svg
:class: mitogen-full-width

In the diagram, when ``node12b`` is creating the ``sudo:node12b:webapp``
context, it must send ``ADD_ROUTE`` messages to ``rack12``, which will
Expand All @@ -572,7 +573,8 @@ When ``sudo:node22a:webapp`` wants to send a message to

``sudo:node22a:webapp -> node22a -> rack22 -> dc2 -> bastion -> dc1 -> rack12 -> node12b -> sudo:node12b:webapp``

.. image:: images/route.png
.. image:: images/route.svg
:class: mitogen-full-width


.. _source-verification:
Expand Down
2 changes: 2 additions & 0 deletions docs/images/ansible/ansible_mitogen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/ansible/cell_division.png
Binary file not shown.
Binary file removed docs/images/ansible/run_hostname_100_times.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/ansible/run_hostname_100_times_mito.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/images/ansible/run_hostname_100_times_plain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/async.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/billing.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/billing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/cell_division.png
Binary file not shown.
Binary file removed docs/images/context-tree.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/context-tree.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/detached-subtree.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/detached-subtree.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/distribute2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/fakessh.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/fakessh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/jumpbox.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/jumpbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/layout.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/layout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/images/mitogen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/pandora-orig.jpg
Binary file not shown.
Binary file removed docs/images/pandora.jpg
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/images/pandora.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/persistent.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/images/persistent.svg

Large diffs are not rendered by default.

Binary file modified docs/images/pipe.png
Binary file removed docs/images/radiation.png
Diff not rendered.
Binary file removed docs/images/route.png
Diff not rendered.
1 change: 1 addition & 0 deletions docs/images/route.svg

Large diffs are not rendered by default.

Binary file modified docs/images/topogit.png
18 changes: 10 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Mitogen is a Python library for writing distributed self-replicating programs.
}
</style>

.. image:: images/cell_division.png
:align: right
.. image:: images/mitogen.svg
:class: mitogen-right-225

There is no requirement for installing packages, copying files around, writing
shell snippets, upfront configuration, or providing any secondary link to a
Expand Down Expand Up @@ -76,8 +76,8 @@ program's domain of control outward to other machines, enabling your program to
**manipulate machines behind a firewall**, or enable its **data plane to cohere
to your network topology**.

.. image:: images/billing.png
:align: right
.. image:: images/billing.svg
:class: mitogen-right-150

.. code::
Expand Down Expand Up @@ -158,8 +158,8 @@ Common sources of import latency and bandwidth consumption are mitigated:
SSH Client Emulation
####################

.. image:: images/fakessh.png
:align: right
.. image:: images/fakessh.svg
:class: mitogen-right-300

Support is included for starting subprocesses with a modified environment, that
cause their attempt to use SSH to be redirected back into the host program. In
Expand Down Expand Up @@ -192,7 +192,8 @@ for example enforce an interactive TTY and account password.
Message Routing
###############

.. image:: images/route.png
.. image:: images/route.svg
:class: mitogen-full-width

Slaves may communicate autonomously without direct interaction with the master,
allowing a wide variety of complex data and control flows to be expressed using
Expand Down Expand Up @@ -230,7 +231,8 @@ uptime')** without further need to capture or manage output.
Detached Subtrees
#################

.. image:: images/detached-subtree.png
.. image:: images/detached-subtree.svg
:class: mitogen-full-width

Contexts may detach from and outlive the running program, while maintaining
communication with descendents in their subtree. This enables persistent
Expand Down
13 changes: 13 additions & 0 deletions docs/svg-boxify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Add viewBox attr to SVGs lacking it, so IE scales properly.

import lxml.etree
import glob


for name in glob.glob('images/*.svg') + glob.glob('images/ansible/*.svg'):
doc = lxml.etree.parse(open(name))
svg = doc.getroot()
if 'viewBox' not in svg.attrib:
svg.attrib['viewBox'] = '0 0 %(width)s %(height)s' % svg.attrib
open(name, 'w').write(lxml.etree.tostring(svg, xml_declaration=True, encoding='UTF-8'))

0 comments on commit 71f8e84

Please sign in to comment.