Skip to content

Commit

Permalink
Merge pull request #129 from idealista/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sorobon authored Mar 17, 2021
2 parents 8f40d56 + b2ed7fe commit 67b51dc
Show file tree
Hide file tree
Showing 87 changed files with 14,680 additions and 435 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.yml linguist-detectable=true
*.yaml linguist-detectable=true
*.html linguist-detectable=false
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
- DOCKER_IMAGE_BASE=idealista/jdk:8u252-focal-openjdk-headless
- DOCKER_IMAGE_BASE=idealista/jdk:14.0.1-focal-openjdk-headless
script:
- pipenv run molecule test
- pipenv run molecule test --all --destroy always

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
165 changes: 86 additions & 79 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ verify_ssl = true
[dev-packages]

[packages]
ansible = "==2.8.8"
ansible = "==2.9.13"
molecule = "==3.0.4"
docker = "==4.1.0"
docker = "==4.2.0"
ansible-lint = "==4.2.0"

[requires]
Expand Down
473 changes: 256 additions & 217 deletions Pipfile.lock

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![Logo](https://raw.githubusercontent.com/idealista/solrcloud_role/master/logo.gif)
![Logo](https://raw.githubusercontent.com/idealista/solr_role/master/logo.gif)

[![Build Status](https://travis-ci.org/idealista/solrcloud_role.png)](https://travis-ci.org/idealista/solrcloud_role)
[![Build Status](https://travis-ci.com/idealista/solr_role.png)](https://travis-ci.com/idealista/solr_role)

# SolrCloud Ansible role
# Solr Ansible role

This ansible role installs a SolrCloud server in a debian environment.
This ansible role installs a Solr server in a debian environment.

- [SolrCloud Ansible role](#solrcloud-ansible-role)
- [Solr Ansible role](#Solr-ansible-role)
- [Getting Started](#getting-started)
- [Prerequisities](#prerequisities)
- [Installing](#installing)
Expand All @@ -22,7 +22,7 @@ This ansible role installs a SolrCloud server in a debian environment.

## Getting Started

These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install a [SolrCloud](https://cwiki.apache.org/confluence/display/solr/SolrCloud) server in a Debian system.
These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install a [Solr](https://cwiki.apache.org/confluence/display/solr/SolrCloud) server in a Debian system.

This role is tested on:
- Debian
Expand All @@ -43,9 +43,9 @@ For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Docker]
Create or add to your roles dependency file (e.g requirements.yml):

```
- src: idealista.solrcloud_role
- src: idealista.solr_role
version: x.x.x
name: solrcloud
name: solr
```

Install the role with ansible-galaxy command:
Expand All @@ -60,13 +60,13 @@ Use in a playbook:
---
- hosts: someserver
roles:
- { role: solrcloud }
- { role: solr }
```

Playbook example below showing how to provision from scratch a SolrCloud cluster with two nodes plus create an example (and empty) collection called `sample_techproducts_configs`, using idealista [java](https://github.com/idealista/java-role), [zookeeper](https://github.com/idealista/zookeeper-role) and [solrcloud](https://github.com/idealista/solrcloud_role) roles:
Playbook example below showing how to provision from scratch a SolrCloud cluster with two nodes plus create an example (and empty) collection called `sample_techproducts_configs`, using idealista [java](https://github.com/idealista/java-role), [zookeeper](https://github.com/idealista/zookeeper-role) and [solr](https://github.com/idealista/solr_role) roles:

**Note:** Assuming that 'solrcloud' group has two nodes (`solrcloud1` and `solrcloud2`) as is declared in [molecule.yml](https://github.com/idealista/solrcloud_role/tree/master/molecule/default/molecule.yml),
collection will have two shards, one replica and one shard per node as is declared in group vars file called [solrcloud.yml](https://github.com/idealista/solrcloud_role/tree/master/molecule/default/group_vars/solrcloud.yml)
**Note:** Assuming that 'solrcloud' group has two nodes (`solrcloud1` and `solrcloud2`) as is declared in [molecule.yml](https://github.com/idealista/solr_role/tree/master/molecule/default/molecule.yml),
collection will have two shards, one replica and one shard per node as is declared in group vars file called [solrcloud.yml](https://github.com/idealista/solr_role/tree/master/molecule/default/group_vars/solrcloud.yml)
and configuration files are stored under directory called `sample_techproducts_configs` under template directory.

> :warning: Use the example below just as a reference, requires inventory host groups `solr` and `zookeeper` to be correctly defined
Expand All @@ -88,7 +88,7 @@ and configuration files are stored under directory called `sample_techproducts_c
- hosts: solrcloud
roles:
- role: solrcloud_role
- role: solr_role
```

## Usage
Expand Down Expand Up @@ -142,9 +142,9 @@ or

http://localhost:8984/solr/#/ (node: `solrcloud2`)

<img src="https://raw.githubusercontent.com/idealista/solrcloud_role/master/assets/solr_admin_ui.png" alt="Solr Admin UI example" style="width: 600px;"/>
<img src="https://raw.githubusercontent.com/idealista/solr_role/master/assets/solr_admin_ui.png" alt="Solr Admin UI example" style="width: 600px;"/>

See [molecule.yml](https://github.com/idealista/solrcloud_role/blob/master/molecule/default/molecule.yml) to check possible testing platforms.
See [molecule.yml](https://github.com/idealista/solr_role/blob/master/molecule/default/molecule.yml) to check possible testing platforms.

## Built With

Expand All @@ -154,15 +154,15 @@ See [molecule.yml](https://github.com/idealista/solrcloud_role/blob/master/molec

## Versioning

For the versions available, see the [tags on this repository](https://github.com/idealista/solrcloud_role/tags).
For the versions available, see the [tags on this repository](https://github.com/idealista/solr_role/tags).

Additionaly you can see what change in each version in the [CHANGELOG.md](https://github.com/idealista/solrcloud_role/blob/master/CHANGELOG.md) file.
Additionaly you can see what change in each version in the [CHANGELOG.md](https://github.com/idealista/solr_role/blob/master/CHANGELOG.md) file.

## Authors

* **Idealista** - *Work with* - [idealista](https://github.com/idealista)

See also the list of [contributors](https://github.com/idealista/solrcloud_role/contributors) who participated in this project.
See also the list of [contributors](https://github.com/idealista/solr_role/contributors) who participated in this project.

## License

Expand All @@ -172,4 +172,4 @@ This project is licensed under the [Apache 2.0](https://www.apache.org/licenses/

## Contributing

Please read [CONTRIBUTING.md](https://github.com/idealista/solrcloud_role/blob/master/.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Please read [CONTRIBUTING.md](https://github.com/idealista/solr_role/blob/master/.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
15 changes: 12 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---

## General
solr_version: 8.6.0
solrcloud_install: true
solr_version: 8.8.1
solr_install: true
solr_mode: cloud # standalone|cloud

## Service options

Expand All @@ -23,8 +24,10 @@ solr_log_dir: /var/log/solr
solr_home: /var/solr
solr_data_dir: "{{ solr_home }}/data"
solr_tmp_basedir: "/usr/local/src"
solr_tmp_dest_dir: "{{ solr_tmp_basedir }}/{{ solr_cloud_package }}"
solr_tmp_dest_dir: "{{ solr_tmp_basedir }}/{{ solr_package }}"
solr_collections_config_tmp_dir: "{{ solr_tmp_basedir }}/collections"
solr_cores_config_dir: "{{ solr_data_dir }}/cores"
solr_cores_transfer_mode: copy
solr_recommended_open_files: 65550
solr_recommended_max_processes: 65550
# For a visual indication in the Admin UI of what type of environment this cluster is, configure
Expand Down Expand Up @@ -100,6 +103,12 @@ solr_wait_for_zookeeper: 30
solr_collections: {}
solr_collections_files_path: "{{ playbook_dir }}/files/collections/"
solr_collections_template_path: "{{ playbook_dir }}/templates/collections/"
solr_collections_clean_house: true

# Cores configuration
solr_cores: {}
solr_cores_files_path: "{{ playbook_dir }}/files/cores/"
solr_cores_template_path: "{{ playbook_dir }}/templates/cores/"

# External libs support
solr_external_libraries_repository_url: https://repo1.maven.org/maven2
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: restart SolrCloud
- name: restart Solr
systemd:
name: solr
state: restarted
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
galaxy_info:
company: Idealista S.A.U
author: idealista
description: SolrCloud role
description: Solr role
min_ansible_version: 2.8.6
license: Apache 2.0
platforms:
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
hosts: solrcloud
serial: 100%
roles:
- role: solrcloud_role
- role: solr_role
5 changes: 4 additions & 1 deletion molecule/default/group_vars/solrcloud/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ solr_collections:
shards: 2
replicas: 1
shards_per_node: 1
auto_add_replicas: false

solr_agents_required_libs:
- unzip
- apt-transport-https

solr_agents_config:
- name: "newrelic"
version: "5.11.1"
version: "6.4.2"
download_url: "http://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip"
vm_opts:
- '-javaagent:{{ solr_installation_dir }}/newrelic/newrelic.jar'
Expand All @@ -41,3 +42,5 @@ solr_agents_config:
}

solr_environment_ui: "test,label=Molecule+test,color=green"
solr_mode: cloud
solr_collections_clean_house: false
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ platforms:

- name: solrcloud1
hostname: solrcloud1
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:8u252-stretch-openjdk-headless}
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:11.0.7-buster-openjdk-headless}
privileged: false
capabilities:
- SYS_ADMIN
Expand All @@ -54,7 +54,7 @@ platforms:

- name: solrcloud2
hostname: solrcloud2
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:8u252-stretch-openjdk-headless}
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:11.0.7-buster-openjdk-headless}
privileged: false
capabilities:
- SYS_ADMIN
Expand Down
15 changes: 15 additions & 0 deletions molecule/standalone/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y -q python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-lxml && \
apt-get clean

STOPSIGNAL SIGRTMIN+3
RUN systemctl set-default multi-user.target
7 changes: 7 additions & 0 deletions molecule/standalone/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- name: Converge
hosts: solr
serial: 100%
roles:
- role: solr_role
67 changes: 67 additions & 0 deletions molecule/standalone/files/cores/mail/conf/currency.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- Example exchange rates file for CurrencyField type named "currency" in example schema -->

<currencyConfig version="1.0">
<rates>
<!-- Updated from http://www.exchangerate.com/ at 2011-09-27 -->
<rate from="USD" to="ARS" rate="4.333871" comment="ARGENTINA Peso" />
<rate from="USD" to="AUD" rate="1.025768" comment="AUSTRALIA Dollar" />
<rate from="USD" to="EUR" rate="0.743676" comment="European Euro" />
<rate from="USD" to="BRL" rate="1.881093" comment="BRAZIL Real" />
<rate from="USD" to="CAD" rate="1.030815" comment="CANADA Dollar" />
<rate from="USD" to="CLP" rate="519.0996" comment="CHILE Peso" />
<rate from="USD" to="CNY" rate="6.387310" comment="CHINA Yuan" />
<rate from="USD" to="CZK" rate="18.47134" comment="CZECH REP. Koruna" />
<rate from="USD" to="DKK" rate="5.515436" comment="DENMARK Krone" />
<rate from="USD" to="HKD" rate="7.801922" comment="HONG KONG Dollar" />
<rate from="USD" to="HUF" rate="215.6169" comment="HUNGARY Forint" />
<rate from="USD" to="ISK" rate="118.1280" comment="ICELAND Krona" />
<rate from="USD" to="INR" rate="49.49088" comment="INDIA Rupee" />
<rate from="USD" to="XDR" rate="0.641358" comment="INTNL MON. FUND SDR" />
<rate from="USD" to="ILS" rate="3.709739" comment="ISRAEL Sheqel" />
<rate from="USD" to="JPY" rate="76.32419" comment="JAPAN Yen" />
<rate from="USD" to="KRW" rate="1169.173" comment="KOREA (SOUTH) Won" />
<rate from="USD" to="KWD" rate="0.275142" comment="KUWAIT Dinar" />
<rate from="USD" to="MXN" rate="13.85895" comment="MEXICO Peso" />
<rate from="USD" to="NZD" rate="1.285159" comment="NEW ZEALAND Dollar" />
<rate from="USD" to="NOK" rate="5.859035" comment="NORWAY Krone" />
<rate from="USD" to="PKR" rate="87.57007" comment="PAKISTAN Rupee" />
<rate from="USD" to="PEN" rate="2.730683" comment="PERU Sol" />
<rate from="USD" to="PHP" rate="43.62039" comment="PHILIPPINES Peso" />
<rate from="USD" to="PLN" rate="3.310139" comment="POLAND Zloty" />
<rate from="USD" to="RON" rate="3.100932" comment="ROMANIA Leu" />
<rate from="USD" to="RUB" rate="32.14663" comment="RUSSIA Ruble" />
<rate from="USD" to="SAR" rate="3.750465" comment="SAUDI ARABIA Riyal" />
<rate from="USD" to="SGD" rate="1.299352" comment="SINGAPORE Dollar" />
<rate from="USD" to="ZAR" rate="8.329761" comment="SOUTH AFRICA Rand" />
<rate from="USD" to="SEK" rate="6.883442" comment="SWEDEN Krona" />
<rate from="USD" to="CHF" rate="0.906035" comment="SWITZERLAND Franc" />
<rate from="USD" to="TWD" rate="30.40283" comment="TAIWAN Dollar" />
<rate from="USD" to="THB" rate="30.89487" comment="THAILAND Baht" />
<rate from="USD" to="AED" rate="3.672955" comment="U.A.E. Dirham" />
<rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
<rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />

<!-- Cross-rates for some common currencies -->
<rate from="EUR" to="GBP" rate="0.869914" />
<rate from="EUR" to="NOK" rate="7.800095" />
<rate from="GBP" to="NOK" rate="8.966508" />
</rates>
</currencyConfig>
42 changes: 42 additions & 0 deletions molecule/standalone/files/cores/mail/conf/elevate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- If this file is found in the config directory, it will only be
loaded once at startup. If it is found in Solr's data
directory, it will be re-loaded every commit.
See http://wiki.apache.org/solr/QueryElevationComponent for more info
-->
<elevate>
<!-- Query elevation examples
<query text="foo bar">
<doc id="1" />
<doc id="2" />
<doc id="3" />
</query>
for use with techproducts example
<query text="ipod">
<doc id="MA147LL/A" /> put the actual ipod at the top
<doc id="IW-02" exclude="true" /> exclude this cable
</query>
-->

</elevate>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set of Catalan contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
l
m
n
s
t
15 changes: 15 additions & 0 deletions molecule/standalone/files/cores/mail/conf/lang/contractions_fr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set of French contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
l
m
t
qu
n
s
j
d
c
jusqu
quoiqu
lorsqu
puisqu
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set of Irish contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
m
b
Loading

0 comments on commit 67b51dc

Please sign in to comment.