aboutsummaryrefslogtreecommitdiff
path: root/app/deployment
diff options
context:
space:
mode:
Diffstat (limited to 'app/deployment')
-rw-r--r--app/deployment/mariadb.hcl64
-rw-r--r--app/deployment/object_storage.hcl159
-rw-r--r--app/deployment/seafile.hcl77
-rw-r--r--app/deployment/webcap.hcl56
4 files changed, 61 insertions, 295 deletions
diff --git a/app/deployment/mariadb.hcl b/app/deployment/mariadb.hcl
deleted file mode 100644
index b0fb954..0000000
--- a/app/deployment/mariadb.hcl
+++ /dev/null
@@ -1,64 +0,0 @@
-job "mariadb" {
- datacenters = ["dc1"]
- type = "service"
- priority = 10
-
- constraint {
- attribute = "${attr.cpu.arch}"
- value = "amd64"
- }
-
- group "main" {
- count = 1
- task "server" {
- driver = "docker"
- config {
- image = "superboum/amd64_mariadb:v4"
- network_mode = "host"
- command = "tail"
- args = [
- "-f", "/var/log/mysql/error.log",
- ]
- volumes = [
- "/mnt/glusterfs/mariadb/main/server:/var/lib/mysql",
- ]
- }
-
- artifact {
- source = "http://127.0.0.1:8500/v1/kv/configuration/mariadb/main/env.tpl?raw"
- destination = "secrets/env.tpl"
- mode = "file"
- }
- template {
- source = "secrets/env.tpl"
- destination = "secrets/env"
- env = true
- }
-
-
- resources {
- memory = 800
- }
-
- service {
- tags = ["mariadb"]
- port = 3306
- address_mode = "driver"
- name = "mariadb"
- check {
- type = "tcp"
- port = 3306
- address_mode = "driver"
- interval = "60s"
- timeout = "5s"
- check_restart {
- limit = 3
- grace = "90s"
- ignore_warnings = false
- }
- }
- }
- }
- }
-}
-
diff --git a/app/deployment/object_storage.hcl b/app/deployment/object_storage.hcl
deleted file mode 100644
index fa40c4b..0000000
--- a/app/deployment/object_storage.hcl
+++ /dev/null
@@ -1,159 +0,0 @@
-job "not_safe_object_storage" {
- datacenters = ["dc1"]
- type = "service"
-
- constraint {
- attribute = "${attr.cpu.arch}"
- value = "amd64"
- }
-
- group "not_safe_pithos" {
- count = 2
- task "not_safe_server" {
- driver = "docker"
- config {
- image = "superboum/amd64_pithos:v1"
- readonly_rootfs = true
- port_map {
- s3_port = 8080
- }
- volumes = [
- "secrets/pithos.yaml:/etc/pithos/pithos.yaml"
- ]
- }
-
- resources {
- memory = 500
- network {
- port "s3_port" {
- static = "8080"
- }
- }
- }
-
- template {
- data = <<EOH
-service:
- host: '0.0.0.0'
- port: 8080
-
-
-## logging configuration
-## ---------------------
-logging:
- level: info
- console: true
- files: []
-
-# overrides:
-# io.exo.pithos: debug
-
-
-## global options
-## --------------
-options:
- service-uri: 's3.esir.deuxfleurs.fr'
- reporting: true
- server-side-encryption: true
- multipart-upload: true
- masterkey-provisioning: true
- masterkey-access: true
- default-region: 'FR-RN1'
-
-
-## keystore configuration
-## ----------------------
-#
-# Keystores associate an access key with
-# an organization and secret key.
-#
-# They may offer provisioning capacities with the
-# masterkey. The default provider relies on keys
-# being defined inline.
-# generate access key: openssl rand -base64 24
-# generate secret key: openssl rand -base64 39
-# (size is arbitrary)
-keystore:
- keys:
- NHu3glGc0lj5FL5AZPTvgjB20tb9w4Eo:
- master: true
- tenant: 'pyr@spootnik.org'
- secret: 'fpyehmZsimMHeYScjwTUREzvIOICeRZiO01Dck0JIKEifKdwOT3T'
- rXNoqKXY45RcxpBOKy8i4H8fqGzlHIZu:
- tenant: 'exoscale'
- secret: 'qtQlWujN70Ukh9IvIbqIM3Zqos/5aU72hOhLCXblQ0PmfYsGO8lU'
-
-
-## bucketstore configuration
-## -------------------------
-#
-# The bucketstore is ring global and contains information
-# on bucket location and global parameters.
-#
-# Its primary aim is to hold bucket location and ownership
-# information.
-#
-# The default provider relies on cassandra.
-bucketstore:
- default-region: 'FR-RN1'
- cluster:
- - 148.60.11.181
- - 148.60.11.183
- - 148.60.11.237
- keyspace: 'storage'
-
-
-## regions
-## -------
-#
-# Regions are composed of a metastore and an arbitrary number
-# of named storage classes which depend on a blobstore.
-#
-# The metastore holds metadata for the full region, as well as
-# object storage-class placement information.
-#
-# The default implementation of both metastore and blobstore
-# rely on cassandra.
-#
-regions:
- FR-RN1:
- metastore:
- cluster:
- - 148.60.11.181
- - 148.60.11.183
- - 148.60.11.237
- keyspace: 'storage'
- storage-classes:
- standard:
- cluster:
- - 148.60.11.181
- - 148.60.11.183
- - 148.60.11.237
- keyspace: 'storage'
- max-chunk: '128k'
- max-block-chunks: 1024
-EOH
- destination = "secrets/pithos.yaml"
- }
-
- service {
- tags = ["pithos"]
- port = "s3_port"
- address_mode = "host"
- name = "pithos"
- check {
- type = "tcp"
- port = "s3_port"
- interval = "60s"
- timeout = "5s"
- check_restart {
- limit = 3
- grace = "300s"
- ignore_warnings = false
- }
- }
- }
- }
- }
-}
-
diff --git a/app/deployment/seafile.hcl b/app/deployment/seafile.hcl
index a44bf60..3af7db3 100644
--- a/app/deployment/seafile.hcl
+++ b/app/deployment/seafile.hcl
@@ -12,17 +12,64 @@ job "seafile" {
count = 1
network {
- port "seafile-frontend" { static = 8000 }
- port "seafile-seafhttp" { static = 8083 }
- port "seafile-dav" { static = 8084 }
- port "seafile-hack" { static = 8085 }
+ port "seafile-frontend_port" { static = 8000 }
+ port "seafile-seafhttp_port" { static = 8083 }
+ port "seafile-dav_port" { static = 8084 }
+ port "seafile-hack_port" { static = 8085 }
+ port "mariadb_port" { static = 3306 }
}
+ task "mariadb" {
+ driver = "docker"
+ config {
+ image = "superboum/amd64_mariadb:v4"
+ network_mode = "host"
+ command = "tail"
+ ports = [ "mariadb_port" ]
+ args = [
+ "-f", "/var/log/mysql/error.log",
+ ]
+ volumes = [
+ "/mnt/glusterfs/mariadb/main/server:/var/lib/mysql",
+ ]
+ }
+
+ template {
+ data = file("../config/configuration/mariadb/main/env.tpl")
+ destination = "secrets/env"
+ env = true
+ }
+
+ resources {
+ memory = 800
+ }
+
+ service {
+ tags = ["mariadb"]
+ port = "mariadb_port"
+ address_mode = "host"
+ name = "mariadb"
+ check {
+ type = "tcp"
+ port = "mariadb_port"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
+ }
+ }
+
+
task "hack" {
driver = "docker"
config {
image = "alpine/socat:1.0.5"
network_mode = "host"
+ ports = [ "seafile-hack_port" ]
command = "tcp6-listen:8085,fork,reuseaddr"
args = [ "tcp-connect:127.0.0.1:8083" ]
}
@@ -37,13 +84,12 @@ job "seafile" {
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefixStrip:/seafhttp"
]
- port = 8085
- address_mode = "driver"
+ port = "seafile-hack_port"
+ address_mode = "host"
name = "seafhttp"
check {
type = "tcp"
- port = 8085
- address_mode = "driver"
+ port = "seafile-hack_port"
interval = "60s"
timeout = "5s"
check_restart {
@@ -61,6 +107,7 @@ job "seafile" {
config {
image = "superboum/amd64_seafile:v6"
network_mode = "host"
+ ports = [ "seafile-frontend_port", "seafile-dav_port", "seafile-seafhttp_port" ]
## cmd + args are used for running an instance attachable for update
# command = "/bin/sleep"
@@ -91,13 +138,12 @@ job "seafile" {
"traefik.frontend.entryPoints=https,http",
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/"
]
- port = 8000
- address_mode = "driver"
+ port = "seafile-frontend_port"
+ address_mode = "host"
name = "seahub"
check {
type = "tcp"
- port = 8000
- address_mode = "driver"
+ port = "seafile-frontend_port"
interval = "60s"
timeout = "5s"
check_restart {
@@ -116,13 +162,12 @@ job "seafile" {
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/seafdav"
]
- port = 8084
- address_mode = "driver"
+ port = "seafile-dav_port"
+ address_mode = "host"
name = "seafdav"
check {
type = "tcp"
- port = 8084
- address_mode = "driver"
+ port = "seafile-dav_port"
interval = "60s"
timeout = "5s"
check_restart {
diff --git a/app/deployment/webcap.hcl b/app/deployment/webcap.hcl
deleted file mode 100644
index 1246b76..0000000
--- a/app/deployment/webcap.hcl
+++ /dev/null
@@ -1,56 +0,0 @@
-job "webcap" {
- datacenters = ["dc1"]
- type = "service"
-
- constraint {
- attribute = "${attr.cpu.arch}"
- value = "amd64"
- }
-
- group "main" {
- task "flask" {
- driver = "docker"
- config {
- image = "superboum/amd64_webcap:v7"
- port_map {
- web_port = 3000
- }
- }
- env {
- FLASK_APP = "/usr/local/bin/webcap"
- }
-
- resources {
- cpu = 1000
- memory = 2000
- network {
- port "web_port" {}
- }
- }
-
- service {
- tags = [
- "webcap",
- "traefik.enable=true",
- "traefik.frontend.entryPoints=https,http",
- "traefik.frontend.rule=Host:webcap.deuxfleurs.fr;PathPrefix:/"
- ]
- port = "web_port"
- address_mode = "host"
- name = "webcap"
- check {
- type = "tcp"
- port = "web_port"
- interval = "60s"
- timeout = "5s"
- check_restart {
- limit = 3
- grace = "90s"
- ignore_warnings = false
- }
- }
- }
- }
- }
-}
-