From a488ff41762320ef3395e31270686cc2413867b0 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 6 Nov 2016 18:58:51 +0100 Subject: [PATCH 1/5] Use Flamenco module --- README.md | 1 + cloud.py | 3 +++ deploy.sh | 38 ++++++++++++++----------------- docker/3_run/000-default.conf | 1 + docker/3_run/docker-entrypoint.sh | 2 ++ docker/docker-compose.yml | 1 + requirements.txt | 1 + 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5445110..a5292cd 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ cd /data/git git clone git://git.blender.org/pillar-python-sdk.git git clone git://git.blender.org/pillar-server.git pillar git clone git://git.blender.org/attract.git +git clone git://git.blender.org/flamenco.git git clone git://git.blender.org/blender-cloud.git ``` diff --git a/cloud.py b/cloud.py index fba88a2..2c0e3ca 100755 --- a/cloud.py +++ b/cloud.py @@ -2,11 +2,14 @@ from pillar import PillarServer from attract import AttractExtension +from flamenco import FlamencoExtension attract = AttractExtension() +flamenco = FlamencoExtension() app = PillarServer('.') app.load_extension(attract, '/attract') +app.load_extension(flamenco, '/flamenco') app.process_extensions() if __name__ == '__main__': diff --git a/deploy.sh b/deploy.sh index 06a8e1e..a0d6827 100755 --- a/deploy.sh +++ b/deploy.sh @@ -22,39 +22,35 @@ if [ -n "$(git log origin/production..production --oneline)" ]; then read dummy fi -# Find Pillar -PILLAR_DIR=$(python <&2 + +if [ $(git -C $MODULE_DIR rev-parse --abbrev-ref HEAD) != "production" ]; then + echo "${1^} ($MODULE_DIR) NOT on the production branch, refusing to deploy." >&2 exit 1 fi +} + +# Find Pillar +find_module pillar # Find Attract -ATTRACT_DIR=$(python <&2 - exit 1 -fi +# Find Flamenco +find_module flamenco # SSH to cloud to pull all files in function git_pull() { diff --git a/docker/3_run/000-default.conf b/docker/3_run/000-default.conf index 2996ebd..a68814d 100644 --- a/docker/3_run/000-default.conf +++ b/docker/3_run/000-default.conf @@ -4,6 +4,7 @@ XSendFilePath /data/storage/pillar XSendFilePath /data/git/pillar XSendFilePath /data/venv/lib/python2.7/site-packages/attract/static/ + XSendFilePath /data/venv/lib/python2.7/site-packages/flamenco/static/ XsendFilePath /data/git/blender-cloud ServerAdmin webmaster@localhost diff --git a/docker/3_run/docker-entrypoint.sh b/docker/3_run/docker-entrypoint.sh index 977044d..65eea48 100644 --- a/docker/3_run/docker-entrypoint.sh +++ b/docker/3_run/docker-entrypoint.sh @@ -7,6 +7,8 @@ if [ ! -f /installed ]; then ln -s /data/git/pillar/pillar /data/venv/lib/python2.7/site-packages/pillar # . /data/venv/bin/activate && pip install -e /data/git/attract ln -s /data/git/attract/attract /data/venv/lib/python2.7/site-packages/attract + # . /data/venv/bin/activate && pip install -e /data/git/flamenco + ln -s /data/git/flamenco/flamenco /data/venv/lib/python2.7/site-packages/flamenco # . /data/venv/bin/activate && pip install -e /data/git/pillar-python-sdk ln -s /data/git/pillar-python-sdk/pillarsdk /data/venv/lib/python2.7/site-packages/pillarsdk touch installed diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 87c71e1..15f3f8e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -21,6 +21,7 @@ blender_cloud: volumes: - /data/git/blender-cloud:/data/git/blender-cloud:ro - /data/git/attract:/data/git/attract:ro + - /data/git/flamenco:/data/git/flamenco:ro - /data/git/pillar:/data/git/pillar:ro - /data/git/pillar-python-sdk:/data/git/pillar-python-sdk:ro - /data/config:/data/config:ro diff --git a/requirements.txt b/requirements.txt index da65b0b..a15d9b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ # pillarsdk # pillar # attract +# flamenco # Secondary requirements (i.e. pulled in from primary requirements) algoliasearch==1.8.0 From 0b6584e5b1382099563d706a26ed8c9d4e6a394f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 12 Jan 2017 16:55:40 +0100 Subject: [PATCH 2/5] deploy.sh: assigning function param to named variable --- deploy.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy.sh b/deploy.sh index a0d6827..142afd6 100755 --- a/deploy.sh +++ b/deploy.sh @@ -22,29 +22,29 @@ if [ -n "$(git log origin/production..production --oneline)" ]; then read dummy fi -# Find Module function find_module() { + MODULE_NAME=$1 MODULE_DIR=$(python <&2 - exit 1 -fi -} + if [ $(git -C $MODULE_DIR rev-parse --abbrev-ref HEAD) != "production" ]; then + echo "${MODULE_NAME}: ($MODULE_DIR) NOT on the production branch, refusing to deploy." >&2 + exit 1 + fi # Find Pillar find_module pillar +} # Find Attract find_module attract From c381b45bfc4bfa8095f8cb9ed1c8146355d33fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 12 Jan 2017 16:56:06 +0100 Subject: [PATCH 3/5] deploy.sh: actually return & use the module path --- deploy.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index 142afd6..89a33eb 100755 --- a/deploy.sh +++ b/deploy.sh @@ -42,15 +42,17 @@ EOT exit 1 fi -# Find Pillar -find_module pillar + echo $MODULE_DIR } -# Find Attract -find_module attract +# Find our modules +PILLAR_DIR=$(find_module pillar) +ATTRACT_DIR=$(find_module attract) +FLAMENCO_DIR=$(find_module flamenco) -# Find Flamenco -find_module flamenco +echo "Pillar : $PILLAR_DIR" +echo "Attract : $ATTRACT_DIR" +echo "Flamenco: $FLAMENCO_DIR" # SSH to cloud to pull all files in function git_pull() { From 4a34e02b3525fbf93f25384728bd54239b3612f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 12 Jan 2017 16:56:20 +0100 Subject: [PATCH 4/5] deploy.sh: added missing git_pull & rsync_ui calls --- deploy.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy.sh b/deploy.sh index 89a33eb..98ea4e4 100755 --- a/deploy.sh +++ b/deploy.sh @@ -70,6 +70,7 @@ function git_pull() { git_pull pillar-python-sdk master git_pull pillar production git_pull attract production +git_pull flamenco production git_pull blender-cloud production # Update the virtualenv @@ -77,6 +78,7 @@ git_pull blender-cloud production # RSync the world $ATTRACT_DIR/rsync_ui.sh +$FLAMENCO_DIR/rsync_ui.sh ./rsync_ui.sh # Notify Bugsnag of this new deploy. From 7146405b984dc8befbbd2813938a09c90c24e1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 12 Jan 2017 16:59:55 +0100 Subject: [PATCH 5/5] Added Flamenco dependencies --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index a15d9b1..71af1a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -48,8 +48,10 @@ pyasn1==0.1.9 pyasn1-modules==0.0.8 pycparser==2.14 pycrypto==2.6.1 +pylru==1.0.4 pymongo==3.3.0 pyOpenSSL==0.15.1 +python-dateutil==2.5.3 redis==2.10.5 requests==2.9.1 requests-oauthlib==0.6.2