-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathmongodb_data_importer.nomad.hcl
63 lines (53 loc) · 1.31 KB
/
mongodb_data_importer.nomad.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
job "guy_importer" {
datacenters = ["eu-west-2"]
type = "batch"
group "import_data" {
constraint {
attribute = "${meta.name}"
value = "EU-guystack-worker-2"
}
count = 1
network {
mode = "bridge"
}
task "dummy_data" {
driver = "exec"
template {
data = <<EOH
#!/bin/bash
pip3 install pymongo requests && python3 local/repo/1/mongodb_importer.py && tail -f /dev/null
EOH
destination = "local/run.sh"
perms = "755"
}
artifact {
source = "git::https://github.com/GuyBarros/nomad_jobs"
destination = "local/repo/1/"
}
env{
"MONGODB_SERVER" = "127.0.0.1"
"MONGODB_PORT" = 27017
"MONGODB_DATABASENAME" = "users"
}
config {
command = "bash"
args = ["local/run.sh"]
}
}
service {
name = "dataimporter"
tags = ["dataimporter"]
port = "8888"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "mongodb"
local_bind_port = 27017
}
}
}
}
}
}
}