Skip to content

Commit

Permalink
Weekly Deploy - 24 (#43)
Browse files Browse the repository at this point in the history
* Prepare analytics-credentials-file.json

* Replace memory_hard_limit with memory_max

* Improve comments

* Bump mediawiki docker image

* test: Retry to start Nomad
  • Loading branch information
lens0021 authored Jun 18, 2021
1 parent e633b5c commit d2ec075
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 76 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ jobs:
- name: Wait for initializing...
timeout-minutes: 5
run: |
TIME=0
until nomad node status > /dev/null; do
if [ $TIME -gt 30 ]; then
if [ -n "$(pidof nomad)" ]; then sudo kill "$(pidof nomad)"; fi
sudo nomad agent -dev-connect -config nomad/development.hcl &>/dev/null &
TIME=0
fi
((TIME+=1))
sleep 1; done;
NODE_ID="$(nomad node status -self | head -1 | awk '{print $3}')"
until [[ $(curl -s "http://127.0.0.1:4646/v1/node/$NODE_ID") = *"consul.version"* ]]; do
Expand Down
6 changes: 2 additions & 4 deletions jobs-consul-test/backupbot.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ job "backupbot" {
}

sidecar_task {
config {
memory_hard_limit = 300
}
resources {
memory = 30
memory = 30
memory_max = 300
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs-consul-test/development/lb.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ job "lb" {
config {
image = "traefik:v2.4.8"
network_mode = "host"
memory_hard_limit = 500
ports = ["http", "api"]

volumes = [
Expand Down Expand Up @@ -67,6 +66,7 @@ EOF

resources {
memory = 128
memory_max = 500
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions jobs-consul-test/development/mathoid.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ job "mathoid" {

config {
image = "ghcr.io/femiwiki/mathoid:latest"
memory_hard_limit = 600
}

resources {
memory = 150
memory_max = 600
}

env {
Expand All @@ -32,11 +32,9 @@ job "mathoid" {
sidecar_service {}

sidecar_task {
config {
memory_hard_limit = 500
}
resources {
memory = 100
memory_max = 500
}
}
}
Expand Down
20 changes: 12 additions & 8 deletions jobs-consul-test/fastcgi.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ job "fastcgi" {
mode = "file"
}

artifact {
source = "s3::https://femiwiki-secrets.s3-ap-northeast-1.amazonaws.com/analytics-credentials-file.json"
destination = "secrets/analytics-credentials-file.json"
mode = "file"
}

artifact {
source = "https://github.com/femiwiki/nomad/raw/main/php/opcache-recommended.ini"
destination = "local/opcache-recommended.ini"
Expand Down Expand Up @@ -63,11 +69,12 @@ job "fastcgi" {
}

config {
image = "ghcr.io/femiwiki/mediawiki:2021-05-28T22-03-473c97b0"
image = "ghcr.io/femiwiki/mediawiki:latest"
ports = ["fastcgi"]

volumes = [
"secrets/secrets.php:/a/secret.php",
"secrets/analytics-credentials-file.json:/a/analytics-credentials-file.json",
"local/opcache-recommended.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini",
"local/php.ini:/usr/local/etc/php/php.ini",
"local/php-fpm.conf:/usr/local/etc/php-fpm.conf",
Expand All @@ -90,12 +97,11 @@ job "fastcgi" {
readonly = false
},
]

memory_hard_limit = 800
}

resources {
memory = 300
memory = 300
memory_max = 800
}

env {
Expand Down Expand Up @@ -150,11 +156,9 @@ job "fastcgi" {
}

sidecar_task {
config {
memory_hard_limit = 300
}
resources {
memory = 30
memory = 30
memory_max = 300
}
}
}
Expand Down
13 changes: 5 additions & 8 deletions jobs-consul-test/http.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ job "http" {
}

config {
image = "ghcr.io/femiwiki/mediawiki:2021-05-28T14-01-0b1f9738"
image = "ghcr.io/femiwiki/mediawiki:latest"
command = "caddy"
args = ["run"]
volumes = ["local/Caddyfile:/srv/femiwiki.com/Caddyfile"]
Expand All @@ -34,12 +34,11 @@ job "http" {
ulimit {
nofile = "20000:40000"
}

memory_hard_limit = 400
}

resources {
memory = 100
memory = 100
memory_max = 400
}

env {
Expand Down Expand Up @@ -90,11 +89,9 @@ job "http" {
}

sidecar_task {
config {
memory_hard_limit = 500
}
resources {
memory = 300
memory = 300
memory_max = 500
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions jobs-consul-test/lb.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ job "lb" {
readonly = false
},
]

memory_hard_limit = 500
}

resources {
memory = 128
memory = 128
memory_max = 500
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions jobs-consul-test/mathoid.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ job "mathoid" {
sidecar_service {}

sidecar_task {
config {
memory_hard_limit = 500
}
resources {
memory = 300
memory = 300
memory_max = 500
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions jobs-consul-test/memcached.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ job "memcached" {
sidecar_service {}

sidecar_task {
config {
memory_hard_limit = 300
}
resources {
memory = 30
memory = 30
memory_max = 300
}
}
}
Expand Down
14 changes: 6 additions & 8 deletions jobs-consul-test/mysql.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ job "mysql" {
}

config {
image = "mysql/mysql-server:8.0.25"
volumes = ["local/my.cnf:/etc/mysql/my.cnf"]
memory_hard_limit = 800
image = "mysql/mysql-server:8.0.25"
volumes = ["local/my.cnf:/etc/mysql/my.cnf"]
}

resources {
memory = 300
memory = 300
memory_max = 800
}

env {
Expand All @@ -52,11 +52,9 @@ job "mysql" {
sidecar_service {}

sidecar_task {
config {
memory_hard_limit = 300
}
resources {
memory = 30
memory = 30
memory_max = 300
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions jobs-consul-test/restbase.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ job "restbase" {
readonly = false
}
]

memory_hard_limit = 400
}

resources {
memory = 100
memory = 100
memory_max = 400
}

env {
Expand Down Expand Up @@ -58,11 +57,9 @@ job "restbase" {
}

sidecar_task {
config {
memory_hard_limit = 500
}
resources {
memory = 300
memory = 300
memory_max = 500
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/development/fastcgi.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ job "fastcgi" {
config {
image = "ghcr.io/femiwiki/mediawiki:latest"
network_mode = "host"
memory_hard_limit = 600

volumes = [
"secrets/secrets.php:/a/secret.php",
Expand Down Expand Up @@ -70,6 +69,7 @@ job "fastcgi" {

resources {
memory = 100
memory_max = 600
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/development/http.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ job "http" {
]

network_mode = "host"
memory_hard_limit = 400
}

resources {
memory = 80
memory_max = 400
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/development/mathoid.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ job "mathoid" {

config {
image = "ghcr.io/femiwiki/mathoid:latest"
memory_hard_limit = 600
}

resources {
memory = 150
memory_max = 600
}

env {
Expand Down
2 changes: 1 addition & 1 deletion jobs/development/memcached.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ job "memcached" {

config {
image = "memcached:1-alpine"
memory_hard_limit = 240
}

resources {
memory = 60
memory_max = 240
}
}

Expand Down
2 changes: 1 addition & 1 deletion jobs/development/mysql.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ EOF

config {
image = "mysql/mysql-server:8.0"
memory_hard_limit = 1000
volumes = ["local/my.cnf:/etc/mysql/my.cnf"]

mounts = [
Expand All @@ -40,6 +39,7 @@ EOF

resources {
memory = 500
memory_max = 1000
}

env {
Expand Down
2 changes: 1 addition & 1 deletion jobs/development/restbase.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ job "restbase" {
config {
image = "ghcr.io/femiwiki/restbase:latest"
network_mode = "host"
memory_hard_limit = 400
}

resources {
memory = 100
memory_max = 400
}

env {
Expand Down
Loading

0 comments on commit d2ec075

Please sign in to comment.