Skip to content

Commit 09d37f8

Browse files
author
Tim Watson
committed
tidy up
1 parent 9309539 commit 09d37f8

File tree

5 files changed

+134
-40
lines changed

5 files changed

+134
-40
lines changed

Diff for: _layouts/documentation.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
<div data-spy="affix" data-offset-bottom="290">
2323
<ul class="nav nav-list sidenav">
2424
<li><a href="#cloud_haskell_platform"><i class="icon-chevron-right"></i> Cloud Haskell Platform</a></li>
25-
<li><a href="#architecture"><i class="icon-chevron-right"></i> Architecture</a></li>
26-
<li><a href="#network_abstraction_layer"><i class="icon-chevron-right"></i> Network Abstraction Layer</a></li>
25+
<li><a href="#network_transport_abstraction_layer"><i class="icon-chevron-right"></i> Network Abstraction Layer</a></li>
2726
<li><a href="#concurrency_and_distribution"><i class="icon-chevron-right"></i> Concurrency and Distribution</a></li>
2827
<li><a href="#rethinking_the_task_layer"><i class="icon-chevron-right"></i> Rethinking the Task Layer</a></li>
2928
</ul>

Diff for: documentation.md

+56-24
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ growing number of features for
2222
* working with several network transport implementations (and more in the pipeline)
2323
* supporting *static* values (required for remote communication)
2424

25-
API documentation for the latest releases is available on hackage. The latest
26-
(HEAD) API documentation for the platform can be viewed
27-
[here](/static/doc/distributed-process-platform/index.html).
28-
29-
### Architecture
30-
3125
Cloud Haskell comprises the following components, some of which are complete,
3226
others experimental.
3327

@@ -42,9 +36,8 @@ others experimental.
4236
* [distributed-process-simplelocalnet][10]: Simple backend for local networks
4337
* [distributed-process-azure][11]: Azure backend for Cloud Haskell (proof of concept)
4438

45-
46-
One goal of Cloud Haskell is to separate the transport layer from the
47-
process layer, so that the transport backend is entirely independent:
39+
One of Cloud Haskell's goals is to separate the transport layer from the
40+
*process layer*, so that the transport backend is entirely independent:
4841
it is envisaged that this interface might later be used by models
4942
other than the Cloud Haskell paradigm, and that applications built
5043
using Cloud Haskell might be easily configured to work with different
@@ -63,6 +56,30 @@ The following diagram shows dependencies between the various subsystems,
6356
in an application using Cloud Haskell, where arrows represent explicit
6457
directional dependencies.
6558

59+
-----
60+
61+
+------------------------------------------------------------+
62+
| Application |
63+
+------------------------------------------------------------+
64+
| |
65+
V V
66+
+-------------------------+ +------------------------------+
67+
| Cloud Haskell |<--| Cloud Haskell Backend |
68+
| (distributed-process) | | (distributed-process-...) |
69+
+-------------------------+ +------------------------------+
70+
| ______/ |
71+
V V V
72+
+-------------------------+ +------------------------------+
73+
| Transport Interface |<--| Transport Implementation |
74+
| (network-transport) | | (network-transport-...) |
75+
+-------------------------+ +------------------------------+
76+
|
77+
V
78+
+------------------------------+
79+
| Haskell/C Transport Library |
80+
+------------------------------+
81+
82+
-----
6683

6784
In this diagram, the various nodes roughly correspond to specific modules:
6885

@@ -184,25 +201,40 @@ pass data between processes using *ordinary* concurrency primitives such as
184201
types like `TMVar a` just as normal Haskell threads are. Numerous features
185202
in [distributed-process-platform][3] use this facility, for example the way
186203
that `Control.Distributed.Processes.Platform.Async.AsyncSTM` handles passing
187-
the result of its computation back to the caller:
204+
the result of its computation back to the caller, as the following snippet
205+
demonstrates:
206+
207+
----
188208

189209
{% highlight haskell %}
190-
workerPid <- spawnLocal $ do
191-
-- ... some setup
192-
r <- proc
193-
void $ liftIO $ atomically $ putTMVar result (AsyncDone r)
210+
root <- getSelfPid
211+
result <- liftIO $ newEmptyTMVarIO
212+
sigStart <- liftIO $ newEmptyTMVarIO
213+
(sp, rp) <- newChan
214+
215+
-- listener/response proxy
216+
insulator <- spawnLocal $ do
217+
worker <- spawnLocal $ do
218+
liftIO $ atomically $ takeTMVar sigStart
219+
r <- proc
220+
void $ liftIO $ atomically $ putTMVar result (AsyncDone r)
221+
222+
sendChan sp worker -- let the parent process know the worker pid
223+
224+
wref <- monitor worker
225+
rref <- case shouldLink of
226+
True -> monitor root >>= return . Just
227+
False -> return Nothing
228+
finally (pollUntilExit worker result)
229+
(unmonitor wref >>
230+
return (maybe (return ()) unmonitor rref))
231+
232+
workerPid <- receiveChan rp
233+
liftIO $ atomically $ putTMVar sigStart ()
234+
-- etc ....
194235
{% endhighlight %}
195236

196-
For example, we might implement a local process group using *only* message
197-
passing, and when members enter or leave the group, a *master* process does
198-
the book keeping to ensure the other members of the group can retain a
199-
consist view. If we want to introduce a *group level barrier* to facilitate
200-
mutual exclusion, we have two choices for handling this. If the process
201-
group allows members to enter and leave on an ad-hoc basis, then a shared
202-
memory based solution is a poor choice, because there is no *sane* way to
203-
pass the `MVar` (or whatever) to new joiners. Locking is best achieved using
204-
a messaging based protocol in this instance, which complicates the implementation
205-
237+
----
206238

207239
Processes reside on nodes, which in our implementation map directly to the
208240
`Control.Distributed.Processes.Node` module. Given a configured

Diff for: wiki/maintainers.md

+67-11
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,88 @@ wiki: Maintainers
99
This guide is specifically for maintainers, and outlines the
1010
development process and in particular, the branching strategy.
1111

12-
#### Master == Stable
12+
#### Branching/Merging Policy
1313

1414
The master branch is the **stable** branch, and should always be
1515
in a *releasable* state. This means that on the whole, only small
1616
self contained commits or topic branch merges should be applied
1717
to master, and tagged releases should always be made against it.
1818

19-
#### Development
19+
#### Development Branches
2020

2121
Ongoing work can either be merged into master when complete or
2222
merged into development. Development is effectively an integration
2323
branch, to make sure ongoing changes and new features play nicely
24-
with one another.
24+
with one another. On the other hand, master is a 'stable' branch
25+
and therefore you should only merge into it if the result will be
26+
releasable.
2527

26-
#### Releases
28+
In general, we try to merge changes that belong to a major version
29+
upgrade into development, whereas changes that will go into the
30+
next minor version upgrade can be merged into master.
2731

28-
Remember to update the change log for each project when releasing it.
29-
I forgot to add the changes to the changelog when tagging the recent
30-
distributed-process-0.4.2 release, but in general they should be added
31-
*before* tagging the release.
32+
#### Keeping History
33+
34+
Try to make only clean commits, so that bisect will continue to work.
35+
At the same time, it's best to avoid making destructive updates. If
36+
you're planning on doing lots of squashing, then work in a branch
37+
and don't commit directly to development - and **definitely** not to
38+
master.
3239

3340
#### Follow the <a href="/wiki/contributing.html">Contributing guidelines</a>
3441

3542
What's good for the goose...
3643

37-
#### After releasing, send out a mail
44+
#### Making API documentation available on the website
45+
46+
Currently this is a manual process. If you don't sed/awk out the
47+
reference/link paths, it'll be a mess. We will add a script to
48+
handle this some time soon.
49+
50+
There is also an open ticket to set up nightly builds, which will
51+
update the HEAD haddocks (on the website) and produce an 'sdist'
52+
bundle and add that to the website too.
53+
54+
See https://cloud-haskell.atlassian.net/browse/INFRA-1 for details.
55+
56+
### Release Process
57+
58+
First of all, a few prior warnings. **Do not** tag any projects
59+
until *after* you've finished the release. If you build and tag
60+
three projects, only to find that a subsequent dependent package
61+
needs a bit of last minute surgery, you'll be sorry you didn't
62+
wait. With that in mind....
63+
64+
Before releasing any source code, make sure that all the jira tickets
65+
added to the release are either resolved or remove them from the
66+
release if you've decided to exclude them.
67+
68+
First, make sure all the version numbers and dependencies are aligned.
69+
70+
* bump the version numbers for each project that is being released
71+
* bump the dependency versions across each project if needed
72+
* make sure you've run a complete integration build and everything still installs ok
73+
* bump the dependency version numbers in the cloud-haskell meta package
74+
75+
Now you'll want to go and update the change log and release notes for each
76+
project. Change logs are stored in the individual project's git repository,
77+
whilst release notes are stored on the wiki. This is easy to forget, as I
78+
discovered! Change logs should be more concise than full blown release
79+
notes.
80+
81+
Generate the packages with `cabal sdist` and test them all locally, then
82+
upload them to hackage. Don't forget to upload the cloud-haskell meta-package
83+
too!
84+
85+
#### After the release
86+
87+
**Now** you should tag all the projects with the relevant version number.
88+
Since moving to individual git repositories, the tagging scheme is now
89+
`x.y.z` and *not* `<project>-x.y.z`.
90+
91+
Once the release is out, you should go to [JIRA](https://cloud-haskell.atlassian.net)
92+
and close all the tickets for the release. Jira has a nice 'bulk change'
93+
feature that makes this very easy.
3894

39-
To the Parallel Haskell Mailing List, and anywhere else that makes
40-
sense.
95+
After that, it's time to tweet about the release, post to the parallel-haskell
96+
mailing list, blog etc. Spread the word.

Diff for: wiki/networktransport.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ completely stable yet. The design of the transport layer may also still change.
3838
Feedback and suggestions are most welcome. Email [Duncan](mailto:[email protected]) or [Edsko](mailto:[email protected]) at Well-Typed, find us at #HaskellTransportLayer on
3939
freenode, or post on the [Parallel Haskell][2] mailing list.
4040

41-
You may also submit issues on the [JIRA issue tracker][3].
41+
You may also submit issues on the [JIRA issue tracker][8].
4242

4343
### Hello World
4444

@@ -112,3 +112,4 @@ If you are interested in helping out, please add a brief paragraph to
112112
[5]: /wiki/newtransports.html
113113
[6]: /wiki/newdesign.html
114114
[7]: /wiki/protocols.html
115+
[8]: https://cloud-haskell.atlassian.net/issues/?filter=10002

Diff for: wiki/newdesign.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ A particular challenge is the per-connection performance parameters. It is vital
100100

101101
The following diagram shows dependencies between the various modules for the initial Cloud Haskell implementation. Arrows represent explicit module dependencies.
102102

103+
----
104+
103105
+------------------------------+
104106
| Application |
105107
+------------------------------+
@@ -114,11 +116,14 @@ The following diagram shows dependencies between the various modules for the ini
114116
| Haskell network (IP) library |
115117
+------------------------------+
116118

119+
----
120+
117121
As the diagram indicates, the initial implementation is monolithic and uses a single specific transport (TCP/IP).
118122

119123
The next diagram shows the various modules that are envisaged in the new design. We partition the system into the Cloud Haskell layer and a separate network transport layer. Each of the two layers has backend packages for different transports.
120124

121-
{% highlight %}
125+
----
126+
122127
+------------------------------------------------------------+
123128
| Application |
124129
+------------------------------------------------------------+
@@ -139,7 +144,8 @@ The next diagram shows the various modules that are envisaged in the new design.
139144
+------------------------------+
140145
| Haskell/C Transport Library |
141146
+------------------------------+
142-
{% endhighlight %}
147+
148+
----
143149

144150
We still expect applications to use the the Cloud Haskell layer directly. Additionally the application also depends on a specific Cloud Haskell backend, which provides functions to allow the initialisation of the transport layer using whatever topology might be appropriate to the application.
145151

0 commit comments

Comments
 (0)