summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-04-07 11:32:25 +0100
committerNick White <git@njw.name>2020-04-07 11:32:25 +0100
commit22200755d471e77d20f490ffe01ede884b5acfcb (patch)
tree8a81ef1ddcd8d8256db4c7a5f405b0a354ffc8bb /cmd
parentcb126a80cfa8502a582ee651f9e45c3b0d6f79f7 (diff)
Separate out cloud settings into a separate file; cloudsettings.go
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mkpipeline/main.go31
1 files changed, 4 insertions, 27 deletions
diff --git a/cmd/mkpipeline/main.go b/cmd/mkpipeline/main.go
index ab68d9a..b15e9ef 100644
--- a/cmd/mkpipeline/main.go
+++ b/cmd/mkpipeline/main.go
@@ -4,11 +4,6 @@
package main
-// TODO: set up iam role and policy needed for ec2 instances to access this stuff;
-// see arn:aws:iam::557852942063:policy/pipelinestorageandqueue
-// and arn:aws:iam::557852942063:role/pipeliner
-// TODO: set up launch template for ec2 instances
-
import (
"log"
"os"
@@ -18,8 +13,7 @@ import (
type MkPipeliner interface {
MinimalInit() error
- CreateBucket(string) error
- CreateQueue(string) error
+ MkPipeline() error
}
func main() {
@@ -34,25 +28,8 @@ func main() {
log.Fatalln("Failed to set up cloud connection:", err)
}
- prefix := "rescribe"
- buckets := []string{"inprogress", "done"}
- queues := []string{"preprocess", "wipeonly", "ocr", "analyse", "ocrpage"}
-
- for _, bucket := range buckets {
- bname := prefix + bucket
- log.Printf("Creating bucket %s\n", bname)
- err = conn.CreateBucket(bname)
- if err != nil {
- log.Fatalln(err)
- }
- }
-
- for _, queue := range queues {
- qname := prefix + queue
- log.Printf("Creating queue %s\n", qname)
- err = conn.CreateQueue(qname)
- if err != nil {
- log.Fatalln(err)
- }
+ err = conn.MkPipeline()
+ if err != nil {
+ log.Fatalln("MkPipeline failed:", err)
}
}