Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions 01-personal-api-tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ You should a `permission denied` message:

In this tutorial we used `docker run` with an environment variable pointing to a [provisioning script](./provisioning.yaml) stored externally.

This [provisioning script](./provisioning.yaml) uses three different commands:

- `installModule` to install a Jahia module.
- `startModule` to start a Jahia module. This command is useful to pause execution of the script until the module was started,
allowing further command using that module to be used in the script.
If you didn't need to use the module as part of Jahia provisioning, you could simply use `installModule` with the `autoStart` parameter.
- `executeScript` to execute a script (groovy or GraphQL). In our example the script is located in a remote location, but we could also execute a script on Jahia filesystem.
This [provisioning script](./provisioning.yaml) contains an `executeScript` that will executed a Groovy script or GraphQL query present at the provided location.

## Next

Expand Down
2 changes: 1 addition & 1 deletion 02-luxe-mariadb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To get started, execute the following commands:
```bash
cd ~
git clone https://github.com/Jahia/provisioning-tutorials.git
cd provisioning-tutorials/02-luxe-mariadb
cd ./provisioning-tutorials/02-luxe-mariadb
docker compose up --renew-anon-volumes
```

Expand Down
1 change: 0 additions & 1 deletion 02-luxe-mariadb/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
mariadb:
image: library/mariadb:10-focal
Expand Down
21 changes: 15 additions & 6 deletions 03-augmented-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,30 @@ To get started, execute the following commands:
```bash
cd ~
git clone https://github.com/Jahia/provisioning-tutorials.git
cd provisioning-tutorials/03-augmented-search
docker compose up --renew-anon-volumes -d
sleep 10
cd ./provisioning-tutorials/03-augmented-search

# Start ElasticSearch container
docker compose up --renew-anon-volumes --wait elasticsearch

# Install required plugins for ElasticSearch
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-icu
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-stempel
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-kuromoji

# Restart ElasticSearch container (required after plugins installation)
docker compose restart elasticsearch

# Start other docker-compose services; wait for services healthcheck to complete
docker compose up --wait

# Watch out Jahia log
docker logs -f jahia
```

While the elasticsearch cluster is starting, you will first see the MariaDB container booting up and Jahia creating the necessary tables and continue with its startup.
Here during the last steps, MariaDB and Elasticsearch containers will be started first, and once their healthchecks report a successful status, Jahia will start booting up. It might take a while for the docker-compose project to be ready due to the many provisioning and indexing operations being performed.

## After startup

At the end of startup (give it a minute or two), open a browser to Luxe's home page at http://localhost:8080 and navigate to the "Search" menu.
At the end of startup (*give it a minute or two for the reindexing to complete*), open a browser to Luxe's home page at http://localhost:8080 and navigate to the "Search" menu.

<img width="800" alt="Augmented Search UI and Luxe" src="./as-in-luxe.png">

Expand Down
23 changes: 22 additions & 1 deletion 03-augmented-search/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ services:
MYSQL_DATABASE: jahia
MYSQL_USER: jahia
MYSQL_PASSWORD: jahia
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:9.3.1
Expand All @@ -31,13 +37,22 @@ services:
- 9200:9200
networks:
stack:
healthcheck:
test: ["CMD-SHELL", "curl -k -u elastic:$$ELASTIC_PASSWORD 'http://localhost:9200/_cluster/health?wait_for_status=green&timeout=5s' || exit 1"]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
jahia:
container_name: jahia
image: jahia/jahia-ee:8.2
networks:
- stack
depends_on:
- mariadb
mariadb:
condition: service_healthy
elasticsearch:
condition: service_healthy
ports:
- 8080:8080
deploy:
Expand All @@ -54,5 +69,11 @@ services:
PROCESSING_SERVER: "true"
MAX_RAM_PERCENTAGE: 95
EXECUTE_PROVISIONING_SCRIPT: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/provisioning.yaml"
healthcheck:
test: ["CMD-SHELL", "curl -k 'http://localhost:8080/start' || exit 1"]
interval: 10s
timeout: 10s
retries: 60
start_period: 600s
networks:
stack:
9 changes: 5 additions & 4 deletions 03-augmented-search/provisioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Augmented-Search dependencies are only available from Jahia store
# So we're adding a new repository to be able to resolve these dependencies
- addMavenRepository: "https://devtools.jahia.com/nexus/content/repositories/jahia-public-app-store/@id=JahiaStore"
- addMavenRepository: "https://devtools.jahia.com/nexus/content/repositories/jahia-public-app-store/@id=JahiaPublicAppStore"

# Install and start Modules for Augmented Search
- installModule:
Expand All @@ -24,19 +24,20 @@
elasticsearchConnector.password: "8gFk4F7r3nRz+yHBf7i+/oeEdHoPU0S8" # Encrypted version of "password" (see docker-compose.yml)
elasticsearchConnector.useXPackSecurity: "true"
elasticsearchConnector.useEncryption: "false"
elasticsearchConnector.additionalHostAddresses[0]: "elasticsearch:9210"

# Enable Augmented Search sample UI on Luxe
- enable: "augmented-search-ui"
site: "luxe"

# Configure Augmented Search and Luxe and start indexation
# Configure Augmented Search and Luxe
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/as-add-luxe.graphql"
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/as-index-luxe.graphql"

# Create a new menu entry in Luxe and add Augmented Search UI
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/asui-add-page.graphql"
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/asui-add-main-node.graphql"
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/asui-add-as-node.graphql"
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/asui-publish-page.graphql"
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/asui-publish-node.graphql"

# Trigger indexation
- executeScript: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/03-augmented-search/as-index-luxe.graphql"
2 changes: 1 addition & 1 deletion 04-jexperience/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAXMIND_KEY=CHANGEME
JCUSTOMER_MAXMIND_GEOIP2_CITY_DATABASE_URL=https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=CHANGEME&suffix=tar.gz
JAHIA_IMAGE=jahia/jahia-ee:8.2
UNOMI_IMAGE=jahia/jcustomer:3
ELASTICSEARCH_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:9.3.1
Expand Down
2 changes: 1 addition & 1 deletion 04-jexperience/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To get started, execute the following commands:
```bash
cd ~
git clone https://github.com/Jahia/provisioning-tutorials.git
cd provisioning-tutorials/04-jexperience
cd ./provisioning-tutorials/04-jexperience
```

This tutorial is a bit more cumbersome when compared to the previous ones as it requires you to obtain a [GeoLite license key from maxmind](https://dev.maxmind.com/geoip/geoip2/geolite2/). This is used by Unomi to associate IP addresses with their geolocation.
Expand Down
33 changes: 31 additions & 2 deletions 04-jexperience/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ services:
MYSQL_DATABASE: jahia
MYSQL_USER: jahia
MYSQL_PASSWORD: jahia
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
elasticsearch:
container_name: elasticsearch
image: ${ELASTICSEARCH_IMAGE}
Expand All @@ -25,6 +31,12 @@ services:
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
healthcheck:
test: ["CMD-SHELL", "curl -k -u elastic:$$ELASTIC_PASSWORD 'http://localhost:9200/_cluster/health?wait_for_status=green&timeout=5s' || exit 1"]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
ports:
- 9200:9200
deploy:
Expand All @@ -35,7 +47,12 @@ services:
container_name: jahia
image: ${JAHIA_IMAGE}
depends_on:
- mariadb
mariadb:
condition: service_healthy
elasticsearch:
condition: service_healthy
jcustomer:
condition: service_healthy
ports:
- 8080:8080
mem_limit: 8gb
Expand All @@ -52,6 +69,12 @@ services:
PROCESSING_SERVER: "true"
MAX_RAM_PERCENTAGE: 95
EXECUTE_PROVISIONING_SCRIPT: "https://raw.githubusercontent.com/Jahia/provisioning-tutorials/main/04-jexperience/provisioning.yaml"
healthcheck:
test: ["CMD-SHELL", "curl -k 'http://localhost:8080/start' || exit 1"]
interval: 10s
timeout: 10s
retries: 60
start_period: 600s
jcustomer:
container_name: jcustomer
image: ${UNOMI_IMAGE}
Expand All @@ -75,8 +98,14 @@ services:
- 9443:9443
- 8181:8181
- 8102:8102
healthcheck:
test: ["CMD-SHELL", "curl -k -u karaf:$$UNOMI_ROOT_PASSWORD 'http://localhost:8181/cxs/cluster' || exit 1"]
interval: 10s
timeout: 5s
retries: 10
depends_on:
- elasticsearch
elasticsearch:
condition: service_healthy
networks:
stack:
driver: bridge
Expand Down
3 changes: 2 additions & 1 deletion 04-jexperience/provisioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

# Install and start Modules for Forms and jExperience
- installModule:
- "mvn:org.jahia.modules/font-awesome/6.1.5"
- "mvn:org.jahia.modules/forms-core/3.17.0"
- "mvn:org.jahia.modules/forms-extended-inputs/2.2.0"
- "mvn:org.jahia.modules/forms-extended-inputs/2.3.0"
- "mvn:org.jahia.modules/forms-nocss-theme/2.1.0"
- "mvn:org.jahia.modules/forms-prefill/2.1.0"
- "mvn:org.jahia.modules/forms-snippets-extension/3.3.0"
Expand Down
18 changes: 10 additions & 8 deletions 04-jexperience/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ source .env

docker compose up -d --renew-anon-volumes --remove-orphans --force-recreate elasticsearch

echo "$(date +'%d %B %Y - %k:%M') - Installing Elasticsearch plugins"
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-icu
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-stempel
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-kuromoji
docker compose restart elasticsearch

echo "$(date +'%d %B %Y - %k:%M') - Waiting for Elasticsearch to startup"
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://elastic:${ELASTIC_PASSWORD}@localhost:9200/_security/user)" != "200" ]];
do sleep 5;
Expand All @@ -17,17 +23,13 @@ while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://elastic:${ELASTIC_PA
do sleep 5;
done

echo "\n$(date +'%d %B %Y - %k:%M') - Set jcustomer user in ES"
echo "$(date +'%d %B %Y - %k:%M') - Set jcustomer user in ES"
curl -X POST http://elastic:${ELASTIC_PASSWORD}@localhost:9200/_security/user/jcustomer?refresh=wait_for --header "Content-Type: application/json" -d "{ \
\"password\" : \"${ELASTIC_PASSWORD}\",\
\"roles\" : [ \"jcustomer\" ] \
}"

echo "\n$(date +'%d %B %Y - %k:%M') - Installing Elasticsearch plugins"
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-icu
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-stempel
docker exec --tty elasticsearch /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-kuromoji
docker compose restart elasticsearch
echo "$(date +'%d %B %Y - %k:%M') - Starting remaining services"
docker-compose up --wait

echo "\n$(date +'%d %B %Y - %k:%M') - Starting remaining services"
docker-compose up -d
docker logs -f jahia