Awight has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/392682 )
Change subject: [WIP] Build venv into deployed source dir
......................................................................
[WIP] Build venv into deployed source dir
This moves the python library installation to the fetch stage, and stores
inside the source dir so we rollback faster.
TODO:
* Where do we specify the $venv_dir for services? That needs to change.
* Why does the promote check only restart one service, and not ores-uwsgi?
Change-Id: Ibe44c2c3d7ec526a118a2b09a707616dd6cb3c05
---
M scap/checks.yaml
R scap/fetch_check.sh
A scap/promote_check.sh
3 files changed, 16 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/ores/deploy
refs/changes/82/392682/1
diff --git a/scap/checks.yaml b/scap/checks.yaml
index d9eb373..b17dd02 100755
--- a/scap/checks.yaml
+++ b/scap/checks.yaml
@@ -1,25 +1,12 @@
checks:
- worker_checks:
+ fetch_checks:
+ type: command
+ stage: fetch
+ timeout: 300
+ command: bash /srv/deployment/ores/deploy/scap/fetch_check.sh
+
+ promote_checks:
type: command
stage: promote
timeout: 300
- group: worker
- command: bash /srv/deployment/ores/deploy/scap/cmd_worker.sh
- web_checks:
- type: command
- stage: promote
- group: web
- timeout: 300
- command: bash /srv/deployment/ores/deploy/scap/cmd_worker.sh
- canary_checks:
- type: command
- stage: promote
- timeout: 300
- group: canary
- command: bash /srv/deployment/ores/deploy/scap/cmd_worker.sh
- cluster_checks:
- type: command
- stage: promote
- timeout: 300
- group: cluster
- command: bash /srv/deployment/ores/deploy/scap/cmd_worker.sh
+ command: bash /srv/deployment/ores/deploy/scap/promote_check.sh
diff --git a/scap/cmd_worker.sh b/scap/fetch_check.sh
similarity index 80%
rename from scap/cmd_worker.sh
rename to scap/fetch_check.sh
index 7ad3de5..47e5248 100644
--- a/scap/cmd_worker.sh
+++ b/scap/fetch_check.sh
@@ -1,11 +1,15 @@
-venv="/srv/deployment/ores/venv"
+# Point at deployed dirs.
deploy_dir="/srv/deployment/ores/deploy"
+venv="${deploy_dir}/venv"
+
+# Pull submodules.
cd $deploy_dir
git submodule sync
git submodule update --init
+
+# Install python libs.
rm -rf $venv
mkdir -p $venv
virtualenv --python python3 --system-site-packages $venv
[ -f $deploy_dir/submodules/wheels/pip-*.whl ] && $venv/bin/pip install
--use-wheel --no-deps $deploy_dir/submodules/wheels/pip-*.whl
$venv/bin/pip install --use-wheel --no-deps $deploy_dir/submodules/wheels/*.whl
-sudo service celery-ores-worker restart
diff --git a/scap/promote_check.sh b/scap/promote_check.sh
new file mode 100644
index 0000000..e96483e
--- /dev/null
+++ b/scap/promote_check.sh
@@ -0,0 +1,2 @@
+# Restart celery.
+sudo service celery-ores-worker restart
--
To view, visit https://gerrit.wikimedia.org/r/392682
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe44c2c3d7ec526a118a2b09a707616dd6cb3c05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/ores/deploy
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits