Commit 64be7dde authored by David's avatar David

Updates to the readme, and build.sbt

parent 04f25194
......@@ -6,7 +6,10 @@ I'm sure there are other distributed tools that will do this for me, but I wante
## Design Notes
Akka actor system
Using jssh, bouncycastle, and jzlib for the SSH parts.
### Akka actor system
TimerActor -> tells when to start -> BackupCoordinatorActor
......@@ -15,17 +18,33 @@ BackupCoordinatorActor loads the configuration, which details what hosts to back
Creates a per host actor, that is responsible for that host, and sending the commands.
* Per host actor will have a list of commands to be run on each host
* commands are assumed to be in dependency order
* Hosts are executed in sequence for now
HostActor creates an actor for each SSH command.
* HostActor is responsible for the state of command execution, and should keep timer metrics and stuff
* HostActor should maintain the SSH connection and hand it to command actors to use.
* It's also responsible for fixing the SSH connection if it dies.
* commands will look something like:
* Mount network backup location
* run pre-backup command (mysql and databases or whatever)
* Run backup command <This command may loop up one for many backups on the same host>
* un mount network backup location
SSHCommandActor Only responsible for running the command on the remote host.
* Returns the output of the command to the HostActor (probably buffering it right now)
* Returns the output of the command to the HostActor
* Would be cool to do live streaming updates of stdout v2
* will receive an ssh context from the HostActor, since it maintains SSH state
BackupCoordinatorActor needs to run a command when it's all done. Say an rclone up into the cloud.
Need to specify a host for that to run on, or it runs locally. That is also it's own actor
Need to specify a host for that to run on, or it runs locally. That is also it's own actor.
Should always run the command, even if one of the hosts failed.
PostRunActor Only responsible for the post run command, after all hosts have backed up, do this work
PostRunActor Only responsible for the post run command, after all hosts have backed up, do this work.
ReportingActor should then email a report of all the things that have been done.
Data will be in the BackupCoordinatorActor, buffered until it's all finished, and then delivered to the ReportingActor.
Then to be emailed or archived, or whatever.
### Example Configuration
......@@ -41,6 +60,9 @@ PostRunActor Only responsible for the post run command, after all hosts have bac
#### Configuration yaml
TODO: configuration might need something that has a schema. That might be easier to deal with.
JSON is terrible at multiline strings, and XML can be way too verbose. HM
```yaml
backupTemplate: |
borg create \
......
......@@ -9,9 +9,13 @@ val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % akkaV % Test
val scalaTest = "org.scalactic" %% "scalactic" % scalaTestV
val scalacticScalaTest = "org.scalatest" %% "scalatest" % scalaTestV
val sshj = "com.hierynomus" % "sshj" % "0.26.0"
val bouncycastle = "org.bouncycastle" % "bcprov-jdk15on" % "1.60"
val jzlib = "com.jcraft" % "jzlib" % "1.1.3"
lazy val backupCoordinator = (project in file("."))
.settings(
name := "Backup Coordinator",
libraryDependencies ++= Seq(akka, akkaTestkit, scalaTest, scalacticScalaTest)
libraryDependencies ++= Seq(akka, akkaTestkit, scalaTest, scalacticScalaTest, sshj, bouncycastle, jzlib)
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment