Merge lp:~elopio/u1-test-utils/musicsearch into lp:u1-test-utils

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 79
Merged at revision: 74
Proposed branch: lp:~elopio/u1-test-utils/musicsearch
Merge into: lp:u1-test-utils
Diff against target: 205 lines (+127/-4)
5 files modified
setup_vm/NOTES (+2/-1)
setup_vm/u1/install (+94/-0)
setup_vm/u1/run-music-search (+18/-0)
setup_vm/unity/install-sources (+3/-0)
setup_vm/vms.conf (+10/-3)
To merge this branch: bzr merge lp:~elopio/u1-test-utils/musicsearch
Reviewer Review Type Date Requested Status
Vincent Ladeuil (community) Approve
Review via email: mp+164741@code.launchpad.net

Commit message

Added the recipe to start a cerati music search server.

Description of the change

The cerati server is the missing point for our in dash payments.
With this branch, we add a known and small catalogue of songs that will appear on the dash and will redirect us to our local servers for more details and purchase.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

\o/

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup_vm/NOTES'
2--- setup_vm/NOTES 2013-04-23 15:22:48 +0000
3+++ setup_vm/NOTES 2013-05-27 15:15:33 +0000
4@@ -99,7 +99,8 @@
5
6 13. Set up the Music Search server:
7
8- TODO. Do we need it?
9+ # This server runs on the same U1 server machine.
10+ $ ssh ubuntu@u1.local ~/bin/run-music-search
11
12 13. Install the CurucĂș server (Only needed for Smart Scopes tests):
13
14
15=== modified file 'setup_vm/u1/install'
16--- setup_vm/u1/install 2013-05-11 23:44:48 +0000
17+++ setup_vm/u1/install 2013-05-27 15:15:33 +0000
18@@ -38,6 +38,11 @@
19
20 [url]
21 openid_sso_server: {sso.url}
22+u1ms_search_base: {music_search.url}/v1/search
23+
24+[musicsearch]
25+host: {music_search.address}
26+port: {music_search.port}
27
28 EOF
29 # XXX The secrets file is overlayed, so we can't use the config file.
30@@ -78,3 +83,92 @@
31 # TODO ask on #u1-ops if there's a better way.
32 sed -i 's/development-lazr.conf/local.conf/g' utilities/supervisor-dev.conf.tpl
33 sed -i 's/development-appserver-lazr.conf/local.conf/g' utilities/supervisor-dev.conf.tpl
34+
35+# Create the music search catalogue.
36+# The import script will get the full catalogue since last monday, and updates for the rest of the days.
37+today=`date +%a`
38+if [ "$today" = "Mon" ]
39+then
40+ monday=`date +%Y%m%d`
41+else
42+ monday=`date -dlast-monday +%Y%m%d`
43+fi
44+# 496 is the id of the world shop. The other ids can be found on the cerati branch, cerati/parameters.py:MUSIC_PROVIDER_SHOP_IDS.
45+# TODO should we add them? --elopio - 20130520
46+monday_shop_dir=working_dir/$monday/shop-496
47+mkdir -p $monday_shop_dir
48+cat <<EOF >$monday_shop_dir/artist-full.csv
49+artistId,name,popularity,tags,image,url
50+32,Jimi Hendrix,0.63,"rock,world,spanish,pop-rock,1990s,1960s,2000s",http://cdn.7static.com/static/img/artistimages/00/000/000/0000000032_<\$size\$>.jpg,http://www.7digital.com/artist/jimi-hendrix/
51+
52+EOF
53+gzip $monday_shop_dir/artist-full.csv
54+
55+cat <<EOF >$monday_shop_dir/artist-updates.csv
56+action,artistId,name,popularity,tags,image,url
57+
58+EOF
59+gzip $monday_shop_dir/artist-updates.csv
60+
61+cat <<EOF >$monday_shop_dir/release-full.csv
62+releaseId,title,version,artistId,artistAppearsAs,barcode,type,year,explicitContent,trackCount,duration,tags,licensorId,image,dateAdded,releaseDate,labelId,labelName,formats,price,rrp,url
63+1541733,Jimi Hendrix,,32,Jimi Hendrix,8718011752963,Album,2007,false,22,6906,rock,335,http://cdn.7static.com/static/img/sleeveart/00/015/417/0001541733_<\$size\$>.jpg,2012-01-06T10:58:52.093Z,2007-12-10T00:00:00Z,92464,Weton,"17,33,",9.99,9.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix
64+
65+EOF
66+gzip $monday_shop_dir/release-full.csv
67+
68+cat <<EOF >$monday_shop_dir/release-updates.csv
69+action,releaseId,title,version,artistId,artistAppearsAs,barcode,type,year,explicitContent,trackCount,duration,tags,licensorId,image,dateAdded,releaseDate,labelId,labelName,formats,price,rrp,url
70+
71+EOF
72+gzip $monday_shop_dir/release-updates.csv
73+
74+cat <<EOF >$monday_shop_dir/track-full.csv
75+trackId,title,version,type,isrc,explicitContent,trackNumber,discNumber,artistId,artistAppearsAs,releaseId,duration,formats,price,rrp,url,popularity,streamingReleaseDate
76+16997880,Foxy Lady,,Audio,NLHR50913714,false,1,1,32,The Jimi Hendrix Experience,1541733,366,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=01,0.35,2007-12-10T00:00:00Z
77+16997882,Sunshine Of Your Love,,Audio,NLHR50913719,false,2,1,32,The Jimi Hendrix Experience,1541733,409,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=02,0.27,2007-12-10T00:00:00Z
78+16997884,Room Full Of Mirrors,,Audio,NLHR50913727,false,3,1,32,The Jimi Hendrix Experience,1541733,174,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=03,0.3,2007-12-10T00:00:00Z
79+16997906,Fire,,Audio,NLHR50913721,false,7,1,32,The Jimi Hendrix Experience,1541733,234,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=07,0.32,2007-12-10T00:00:00Z
80+16997913,Outside Woman Blues,,Audio,NLHR50913711,false,9,1,32,Jimi Hendrix,1541733,466,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=09,0.27,2007-12-10T00:00:00Z
81+16997921,Purple Haze,,Audio,NLHR50913717,false,11,1,32,The Jimi Hendrix Experience,1541733,181,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=11,0.33,2007-12-10T00:00:00Z
82+16997923,Voodoo Chile (Slight Return),,Audio,NLHR50913722,false,12,1,32,The Jimi Hendrix Experience,1541733,549,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=12,0.35,2007-12-10T00:00:00Z
83+16997927,Bleeding Heart (Blues In C Sharp),,Audio,NLHR50913726,false,13,1,32,The Jimi Hendrix Experience,1541733,319,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=13,0.3,2007-12-10T00:00:00Z
84+16997941,Morrison's Lament,,Audio,NLHR50913709,false,15,1,32,Jimi Hendrix,1541733,485,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=15,0.27,2007-12-10T00:00:00Z
85+16997949,Little Wing,,Audio,NLHR50913731,false,17,1,32,The Jimi Hendrix Experience,1541733,194,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=17,0.32,2007-12-10T00:00:00Z
86+16997953,Wild Thing,,Audio,NLHR50913710,false,18,1,32,The Jimi Hendrix Experience,1541733,215,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=18,0.27,2007-12-10T00:00:00Z
87+16997958,Wake Up This Morning And Found Yourself Dead,,Audio,NLHR50913720,false,19,1,32,Jimi Hendrix,1541733,478,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=19,0.27,2007-12-10T00:00:00Z
88+16997966,Tomorrow Never Knows / Uranus Rock,,Audio,NLHR50913729,false,21,1,32,Jimi Hendrix,1541733,493,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=21,0.32,2007-12-10T00:00:00Z
89+16997971,Red House,,Audio,NLHR50913730,false,22,1,32,Jimi Hendrix,1541733,636,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=22,0.23,2007-12-10T00:00:00Z
90+16997886,Hot Trigger (A.k.a. Not Trigger Walking With Bessie Mae),,Audio,NLHR50913716,false,4,1,1195740,Lonnie Youngblood And The So-Called Jimi Hendrix Tapes,1541733,233,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=04,0.27,2007-12-10T00:00:00Z
91+16997898,Let The Good Times Roll,,Audio,NLHR50913725,false,6,1,1195740,Lonnie Youngblood And The So-Called Jimi Hendrix Tapes,1541733,365,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=06,0.27,2007-12-10T00:00:00Z
92+16997912,Freedom And You,,Audio,NLHR50913715,false,8,1,1195740,Lonnie Youngblood And The So-Called Jimi Hendrix Tapes,1541733,145,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=08,0.27,2007-12-10T00:00:00Z
93+16997946,Good Feeling,,Audio,NLHR50913724,false,16,1,1195740,Lonnie Youngblood And The So-Called Jimi Hendrix Tapes,1541733,255,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=16,0.27,2007-12-10T00:00:00Z
94+16997892,Wipe The Sweat Part 2,,Audio,NLHR50913728,false,5,1,1195742,Jimi Hendrix feat. Lonnie Youngblood,1541733,169,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=05,0.27,2007-12-10T00:00:00Z
95+16997918,Soul Food (That's What I Like),,Audio,NLHR50913713,false,10,1,1195742,Jimi Hendrix feat. Lonnie Youngblood,1541733,210,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=10,0.27,2007-12-10T00:00:00Z
96+16997933,She's A Fox,,Audio,NLHR50913732,false,14,1,1195742,Jimi Hendrix feat. Lonnie Youngblood,1541733,160,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=14,0.3,2007-12-10T00:00:00Z
97+16997963,Go Go Shoes,,Audio,NLHR50913718,false,20,1,1195742,Jimi Hendrix feat. Lonnie Youngblood,1541733,170,"17,33",0.99,0.99,http://xw.7digital.com/artist/jimi-hendrix/release/jimi-hendrix?h=20,0.27,2007-12-10T00:00:00Z
98+
99+EOF
100+gzip $monday_shop_dir/track-full.csv
101+
102+cat <<EOF >$monday_shop_dir/track-updates.csv
103+action,trackId,title,version,type,isrc,explicitContent,trackNumber,discNumber,artistId,artistAppearsAs,releaseId,duration,formats,price,rrp,url,popularity,streamingReleaseDate
104+
105+EOF
106+gzip $monday_shop_dir/track-updates.csv
107+
108+# Install the music search server.
109+cd ~
110+# Get the branch.
111+bzr branch lp:cerati {music_search.src_dir}
112+# Setup the environment.
113+cd {music_search.src_dir}
114+cat <<EOF > configs/local-lazr.conf
115+[general]
116+environment_name: development
117+base_url: {music_search.url}
118+web_music_store_url: {u1.url}
119+
120+EOF
121+
122+SOURCEDEPS_DIR=../ubunet-sourcedeps/ make
123
124=== added file 'setup_vm/u1/run-music-search'
125--- setup_vm/u1/run-music-search 1970-01-01 00:00:00 +0000
126+++ setup_vm/u1/run-music-search 2013-05-27 15:15:33 +0000
127@@ -0,0 +1,18 @@
128+#!/bin/sh -ex
129+
130+cd ~/{u1.src_dir}
131+make start-solr
132+# Import the 7digital catalog.
133+today=`date +%a`
134+if [ "$today" = "Mon" ]
135+then
136+ monday=`date +%Y%m%d`
137+else
138+ monday=`date -dlast-monday +%Y%m%d`
139+fi
140+# 496 is the id of the world shop. The other ids can be found on the cerati branch, cerati/parameters.py:MUSIC_PROVIDER_SHOP_IDS.
141+# TODO should we add them? --elopio - 20130520
142+./utilities/seven_digital/manage.py import_7d_to_solr canonical {music_search.token} --shop-ids 496 --solr-port `ps fax | grep jetty.port | tail -n 1 | sed 's/.*jetty.port=\([0-9]*\).*/\1/'` --limit 1000 --date $monday
143+cd ~/{music_search.src_dir}
144+echo `ps fax | grep jetty.port | tail -n 1 | sed 's/.*jetty.port=\([0-9]*\).*/\1/'` > tmp/jetty.port
145+PYTHONPATH=.:lib:$PYTHONPATH U1CONFIG=configs/local-lazr.conf gunicorn cerati.views:app -b 0.0.0.0:{music_search.port}
146
147=== modified file 'setup_vm/unity/install-sources'
148--- setup_vm/unity/install-sources 2013-05-11 02:05:59 +0000
149+++ setup_vm/unity/install-sources 2013-05-27 15:15:33 +0000
150@@ -38,5 +38,8 @@
151
152 [ubuntuone]
153 ubuntuone_server_url = {u1.url}
154+
155+[musicsearch]
156+musicsearch_server_url = {music_search.url}
157
158 EOF
159
160=== modified file 'setup_vm/vms.conf'
161--- setup_vm/vms.conf 2013-05-17 17:08:15 +0000
162+++ setup_vm/vms.conf 2013-05-27 15:15:33 +0000
163@@ -2,6 +2,8 @@
164 # sso.address=sso.local
165 # pay.address=pay.local
166 # u1.address=u1.local
167+# The token is stored on the cerati branch, cerati/parameters.py:MUSIC_PROVIDER_OAUTH_CONSUMER_SECRET
168+# music_search.token=the-7digital-token
169 # ppa.ubuntuone-hackers.password
170
171 sso.src_dir=canonical-identity-provider
172@@ -20,6 +22,11 @@
173 u1.port=8003
174 u1.url=http://{u1.address}:{u1.port}
175
176+music_search.src_dir=cerati
177+music_search.port=8004
178+music_search.address={u1.address}
179+music_search.url=http://{music_search.address}:{music_search.port}
180+
181 [precise-server-pristine]
182 vm.name=precise-server-pristine
183 vm.release=precise
184@@ -49,10 +56,10 @@
185 vm.release=precise
186 vm.backing=precise-server-pristine.qcow2
187 vm.apt_sources={ppa.ubuntuone_hackers}
188-vm.packages=openjdk-7-jre,ubuntuone-developer-dependencies
189+vm.packages=openjdk-7-jre, ubuntuone-developer-dependencies, jetty, libjetty-extra-java, solr-jetty, gunicorn
190 vm.ubuntu_script=u1/install
191 vm.update=True
192-vm.uploaded_scripts=u1/run
193+vm.uploaded_scripts=u1/run, u1/run-music-search
194
195 [raring-desktop-pristine]
196 vm.name=raring-desktop-pristine
197@@ -70,7 +77,7 @@
198 vm.release=raring
199 vm.backing=raring-desktop-pristine.qcow2
200 vm.apt_sources=deb http://ppa.launchpad.net/ubuntuone/dashpurchase-testing/ubuntu {vm.release} main|4BD0ECAE,deb http://ppa.launchpad.net/vila/selenium/ubuntu {vm.release} main|5703355D,ppa:ubuntuone/nightlies
201-vm.packages=python-selenium, python-sst, ubuntuone-dev-tools, libautopilot-qt, python-requests, python-mock, python-django, python-django-configglue, python-piston-mini-client, xvfb
202+vm.packages=python-selenium, python-sst, ubuntuone-dev-tools, libautopilot-qt, python-requests, python-mock, python-django, python-django-configglue, python-piston-mini-client, python-dateutil, xvfb
203 vm.uploaded_scripts=unity/run-sso-client, unity/run-unity-lens-music
204 # TODO unity/run-syncdaemon. We don't yet have the hermetic filesync server.
205 vm.update=True

Subscribers

People subscribed via source and target branches

to all changes: