Commit 45a4239b363d90763202f269adc38d2720dce0cc
Exists in
master
and in
39 other branches
Merge branch 'update_puppet' of https://github.com/colab-community/colab into update_puppet
Showing
3 changed files
with
31 additions
and
5 deletions
Show diff stats
fabfile.py
@@ -261,5 +261,27 @@ def deploy(noprovision=False): | @@ -261,5 +261,27 @@ def deploy(noprovision=False): | ||
261 | sudo('supervisorctl start all') | 261 | sudo('supervisorctl start all') |
262 | 262 | ||
263 | 263 | ||
264 | +@task | ||
265 | +def install_solr(): | ||
266 | + """Install Solr""" | ||
267 | + if not exists('~/solr-4.6.1'): | ||
268 | + link = 'https://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1.tgz' | ||
269 | + run('wget {} -O /tmp/solr-4.6.1.tgz'.format(link)) | ||
270 | + run('tar xzf /tmp/solr-4.6.1.tgz -C /tmp/') | ||
271 | + run('cp -rf /tmp/solr-4.6.1 ~/solr-4.6.1') | ||
272 | + run('mv ~/solr-4.6.1/example ~/solr-4.6.1/colab') | ||
273 | + run('chmod +x ~/solr-4.6.1/colab/start.jar') | ||
274 | + run('rm /tmp/solr-4.6.1') | ||
275 | + | ||
276 | + with cd('~/solr-4.6.1/colab/solr/collection1/conf/'): | ||
277 | + if not exists('stopwords_en.txt'): | ||
278 | + run('cp stopwords.txt stopwords_en.txt') | ||
279 | + | ||
280 | + | ||
281 | +@task | ||
282 | +def solr(port=8983): | ||
283 | + """Start Solr""" | ||
284 | + with cd('~/solr-4.6.1/colab'), settings(user='colab'): | ||
285 | + run('java -jar start.jar -Djetty.port={}'.format(port)) | ||
264 | # Main | 286 | # Main |
265 | environment() | 287 | environment() |
puppet/bootstrap.py
@@ -17,6 +17,9 @@ except ImportError: | @@ -17,6 +17,9 @@ except ImportError: | ||
17 | pkg_res = ['apt-get', 'install', 'python-pkg-resources', '-y'] | 17 | pkg_res = ['apt-get', 'install', 'python-pkg-resources', '-y'] |
18 | subprocess.call(pkg_res) | 18 | subprocess.call(pkg_res) |
19 | from pkg_resources import parse_requirements | 19 | from pkg_resources import parse_requirements |
20 | +finally: | ||
21 | + from pkg_resources import to_filename | ||
22 | + | ||
20 | 23 | ||
21 | PUPPET_TARGET_VERSION = "3.6.2" | 24 | PUPPET_TARGET_VERSION = "3.6.2" |
22 | PUPPET_DIR = os.path.join(os.path.dirname(__file__)) | 25 | PUPPET_DIR = os.path.join(os.path.dirname(__file__)) |
@@ -102,11 +105,12 @@ def install_puppet_modules(): | @@ -102,11 +105,12 @@ def install_puppet_modules(): | ||
102 | 105 | ||
103 | for module in parse_requirements(modules_requirements): | 106 | for module in parse_requirements(modules_requirements): |
104 | current_cmd, compare, version, version_comparison = '', '', '', None | 107 | current_cmd, compare, version, version_comparison = '', '', '', None |
105 | - if module.project_name in modules_installed: | 108 | + module_name = to_filename(module.project_name).replace('_', '-', 1) |
109 | + if module_name in modules_installed: | ||
106 | if module.specs: | 110 | if module.specs: |
107 | compare, version = module.specs[0] | 111 | compare, version = module.specs[0] |
108 | 112 | ||
109 | - tmp_version = modules_installed[module.project_name] | 113 | + tmp_version = modules_installed[module_name] |
110 | installed_version = StrictVersion(tmp_version) | 114 | installed_version = StrictVersion(tmp_version) |
111 | required_version = StrictVersion(version) | 115 | required_version = StrictVersion(version) |
112 | 116 | ||
@@ -127,10 +131,10 @@ def install_puppet_modules(): | @@ -127,10 +131,10 @@ def install_puppet_modules(): | ||
127 | current_cmd = 'install' | 131 | current_cmd = 'install' |
128 | 132 | ||
129 | if version and compare and '>' not in compare: | 133 | if version and compare and '>' not in compare: |
130 | - run(current_cmd, module.project_name, version) | 134 | + run(current_cmd, module_name, version) |
131 | else: | 135 | else: |
132 | if not version_comparison or version_comparison < 0: | 136 | if not version_comparison or version_comparison < 0: |
133 | - run(current_cmd, module.project_name) | 137 | + run(current_cmd, module_name) |
134 | 138 | ||
135 | 139 | ||
136 | def iscentos(distro): | 140 | def iscentos(distro): |
puppet/modules.txt