summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-08-19 13:18:19 +0300
committerLars Wirzenius <liw@liw.fi>2017-08-19 13:18:19 +0300
commit38795830ff0666cfedc68b7804525da3c25a811e (patch)
treee9fa0bb7602ab010d50f55ea18e104938acc2d28 /arch
parent38c345ccf746c06880b2e74bc9089b20eddbc736 (diff)
downloadick2-38795830ff0666cfedc68b7804525da3c25a811e.tar.gz
Change: use only one worker in build scenario
To keep things simple, I've decided that for ALPHA-1 we'll just use one worker and not shuffle the workspace around workers. It is not good enough in the long run, but ALPHA-1 needs to be simple.
Diffstat (limited to 'arch')
-rw-r--r--arch/ick2-arch.mdwn52
1 files changed, 20 insertions, 32 deletions
diff --git a/arch/ick2-arch.mdwn b/arch/ick2-arch.mdwn
index 28b2686..1fddf98 100644
--- a/arch/ick2-arch.mdwn
+++ b/arch/ick2-arch.mdwn
@@ -294,14 +294,16 @@ A full build
=============================================================================
Next we look at how the various compontens interact during a complete
-build, using two workers: one trusted with credentials, one doing the
-actual heavy work. We assume that workers have been registered and
-projects added.
+build, using a single worker, which is trusted with credentials. We
+assume the worker has been registered and projects added.
The sequence diagrams in this chapter have been split into stages, to
make them easier to view and read. Each diagram after the first one
continues where the previous one left off.
+Although not shown in the diagrams, the same sequence is meant to work
+if having multiple projects running concurrently on multiple workers.
+
Trigger build by pushing changes to git server
-----------------------------------------------------------------------------
@@ -372,13 +374,7 @@ IDP --> trusty : token E
trusty -> controller : GET /worker/trusty (token E)
controller --> trusty : "clone website source into workspace"
trusty -> gitano : git clone
-trusty -> controller : POST /worker/trusty, exit=0 (token E)
-
-|||
-
-trusty -> controller : GET /worker/trusty (token E)
-controller --> trusty : "rsync to beefy"
-trusty -> beefy : rsync
+gitano --> trusty : website source code
trusty -> controller : POST /worker/trusty, exit=0 (token E)
|||
@@ -388,7 +384,8 @@ controller -> trusty : "notify trigger service pipeline is finished"
trusty -> controller : POST /worker/trusty, exit=0 (token E)
note right
note that we need to tell controller this last step is finished
- **before** telling the trigger service the pipeline is finished
+ **before** telling the trigger service the pipeline is finished,
+ otherwise there is a race condition
end note
trusty -> trigger : GET /pipelines/website/getsource (token E)
trigger -> controller : GET /projects/website/pipelines/getsource (token D)
@@ -396,6 +393,7 @@ note right
Trigger service checks
status of pipeline
end note
+controller --> trigger : "pipeline is has finished successfully"
trigger -> controller : POST /projects/website/pipelines/ikiwiki/+start (token D)
@enduml
@@ -406,26 +404,24 @@ That's the second pipeline, which has just been started.
Pipeline 2: Build static web site
-----------------------------------------------------------------------------
-The second pipeline runs on the beefy worker. The source is already
+The second pipeline runs on the same worker. The source is already
there and it just needs to perform the build.
@startuml
hide footbox
title Build static website
-beefy -> IDP : GET /auth, with Basic Auth, over https
-IDP --> beefy : token F
-beefy -> controller : GET /worker/beefy (token F)
-controller -> beefy : "build static website"
-beefy -> beefy : run ikiwiki to build site
-beefy -> controller : POST /worker/beefy, exit=0 (token F)
+trusty -> controller : GET /worker/trusty (token E)
+controller -> trusty : "build static website"
+trusty -> trusty : run ikiwiki to build site
+trusty -> controller : POST /worker/trusty, exit=0 (token E)
|||
-beefy -> controller : GET /worker/beefy (token F)
-controller -> beefy : "notify trigger service pipeline is finished"
-beefy -> controller : POST /worker/beefy, exit=0 (token F)
-beefy -> trigger : GET /pipelines/website/ikiwiki (token F)
+trusty -> controller : GET /worker/trusty (token E)
+controller -> trusty : "notify trigger service pipeline is finished"
+trusty -> controller : POST /worker/trusty, exit=0 (token E)
+trusty -> trigger : GET /pipelines/website/ikiwiki (token E)
trigger -> controller : GET /projects/website/pipelines/ikiwiki (token D)
trigger -> controller : POST /projects/website/pipelines/publish/+start (token D)
@@ -436,22 +432,14 @@ At the end of the second pipeline, we start the third one.
Pipeline 3: Publish web site to web server
-----------------------------------------------------------------------------
-The third pipeline copies the built static website from the beefy
-worker, via the trusted worker, to the actual web server.
+The third pipeline copies the built static website from the trusty
+worker to the actual web server.
@startuml
hide footbox
title Copy built site from beefy to web server
trusty -> controller : GET /worker/trusty (token E)
-controller -> trusty : "rsync workspace from beefy"
-trusty -> beefy : rsync
-beefy --> trusty : workspace updates
-trusty -> controller : POST /worker/trusty, exit=0 (token E)
-
-|||
-
-trusty -> controller : GET /worker/trusty (token E)
controller -> trusty : "rsync static website to web server"
trusty -> webserver : rsync
trusty -> controller : POST /worker/trusty, exit=0 (token E)