Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastcgi: Add checks #333

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions jobs/fastcgi.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ job "fastcgi" {
options { checksum = "md5:fa11e91ebb96995b117b9a7408c3f315" }
}

artifact {
source = "https://github.com/wikimedia/operations-docker-images-production-images/raw/ad68c7cb62e4e01436ab3a34fb961fe8034c2cce/images/php/common/fpm/live-test/AdoyFastCgiClient.php"
destination = "local/AdoyFastCgiClient.php"
mode = "file"
}

artifact {
source = "https://github.com/wikimedia/operations-docker-images-production-images/raw/ad68c7cb62e4e01436ab3a34fb961fe8034c2cce/images/php/common/fpm/live-test/fcgi-probe.php"
destination = "local/fcgi-probe.php"
mode = "file"
}

template {
data = var.hotfix
destination = "local/Hotfix.php"
Expand All @@ -126,6 +138,8 @@ job "fastcgi" {
"local/php.ini:/usr/local/etc/php/php.ini",
"local/php-fpm.conf:/usr/local/etc/php-fpm.conf",
"local/www.conf:/usr/local/etc/php-fpm.d/www.conf",
"local/AdoyFastCgiClient.php:/srv/fcgi-check/AdoyFastCgiClient.php",
"local/fcgi-probe.php:/srv/fcgi-check/fcgi-probe.php",
"secrets/secrets.php:/a/secret.php",
"secrets/analytics-credentials-file.json:/a/analytics-credentials-file.json",
# Overwrite the default Hotfix.php provided by femiwiki/mediawiki
Expand Down Expand Up @@ -159,36 +173,34 @@ job "fastcgi" {
}

env {
# Used by fcgi-probe.php
FCGI_URL = "127.0.0.1:9000"

MEDIAWIKI_SKIP_INSTALL = "1"
MEDIAWIKI_SKIP_IMPORT_SITES = "1"
MEDIAWIKI_SKIP_UPDATE = "1"

WG_DB_SERVER = NOMAD_UPSTREAM_ADDR_mysql
WG_DB_USER = "mediawiki"
WG_DB_PASSWORD = var.mysql_password_mediawiki
WG_DB_SERVER = NOMAD_UPSTREAM_ADDR_mysql
WG_DB_USER = "mediawiki"
WG_DB_PASSWORD = var.mysql_password_mediawiki
}
}

service {
name = "fastcgi"
port = "9000"

connect {
sidecar_service {
proxy {

upstreams {
destination_name = "mysql"
local_bind_port = 3306
}

upstreams {
destination_name = "memcached"
local_bind_port = 11211
}
}
}

sidecar_task {
config {
memory_hard_limit = 70
Expand All @@ -198,6 +210,15 @@ job "fastcgi" {
}
}
}
check {
# readiness
type = "script"
task = "fastcgi"
command = "/usr/local/bin/php"
args = ["/srv/fcgi-check/fcgi-probe.php"]
interval = "10s"
timeout = "1s"
}
}

network {
Expand Down