Skip to content

Instantly share code, notes, and snippets.

@attiks
Last active January 30, 2020 07:38
Show Gist options
  • Save attiks/96b4e0802130b6876f1cfee466f6f3d7 to your computer and use it in GitHub Desktop.
Save attiks/96b4e0802130b6876f1cfee466f6f3d7 to your computer and use it in GitHub Desktop.
Islandora docker
diff --git a/docker/ansible/Dockerfile b/docker/ansible/Dockerfile
index 1ab5c73..281a536 100644
--- a/docker/ansible/Dockerfile
+++ b/docker/ansible/Dockerfile
@@ -6,7 +6,9 @@ ENV ISLANDORA_DISTRO="centos/7" \
WORKDIR /root/playbook
RUN yum -y install epel-release && \
- yum -y install git ansible openssh-clients
+ yum -y install git openssh-clients && \
+ yum -y install python-pip python-dev && \
+ pip install ansible==2.7.10
COPY entrypoint.sh /bin/
diff --git a/inventory/docker/group_vars/webserver/drupal.yml b/inventory/docker/group_vars/webserver/drupal.yml
index 80018b3..62f1ab0 100644
--- a/inventory/docker/group_vars/webserver/drupal.yml
+++ b/inventory/docker/group_vars/webserver/drupal.yml
@@ -6,7 +6,9 @@ drupal_core_owner: "{{ ansible_user }}"
drupal_composer_dependencies:
- "zaporylie/composer-drupal-optimizations:^1.0"
- "drupal/console:~1.0"
+ - "drush/drush:^9.0"
- "drupal/devel:^2.0"
+ - "drupal/features:^3.8"
- "drupal/rdfui:^1.0-beta1"
- "drupal/restui:^1.16"
- "drupal/search_api_solr:^2.0"
@@ -14,9 +16,12 @@ drupal_composer_dependencies:
- "drupal/content_browser:^1.0@alpha"
- "drupal/matomo:^1.7"
- "drupal/pdf:1.x-dev"
+ - "islandora/openseadragon:dev-8.x-1.x"
+ - "islandora/islandora:dev-8.x-1.x"
+ - "islandora/islandora_defaults:dev-8.x-1.x"
+ - "islandora/controlled_access_terms:dev-8.x-1.x"
- "islandora/carapace:1.0.0"
- - "islandora/islandora_defaults:1.0.0"
-drupal_composer_project_package: "islandora/drupal-project:8.6.10"
+drupal_composer_project_package: "islandora/drupal-project:dev-8.x-1.x"
drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction"
drupal_core_path: "{{ drupal_composer_install_dir }}/web"
drupal_db_user: drupal8
@@ -28,6 +33,7 @@ drupal_site_name: "Islandora 8"
drupal_install_profile: standard
drupal_account_name: admin
drupal_enable_modules:
+ - features
- rdf
- responsive_image
- syslog
@@ -43,8 +49,9 @@ drupal_enable_modules:
- content_browser
- matomo
- pdf
- - islandora_core_feature
- controlled_access_terms_defaults
+ - controlled_access_terms
+ - islandora_core_feature
drupal_trusted_hosts:
- ^localhost$
drupal_trusted_hosts_file: "{{ drupal_core_path }}/sites/default/settings.php"
diff --git a/inventory/vagrant/group_vars/webserver/drupal.yml b/inventory/vagrant/group_vars/webserver/drupal.yml
index 80018b3..f412053 100644
--- a/inventory/vagrant/group_vars/webserver/drupal.yml
+++ b/inventory/vagrant/group_vars/webserver/drupal.yml
@@ -6,7 +6,9 @@ drupal_core_owner: "{{ ansible_user }}"
drupal_composer_dependencies:
- "zaporylie/composer-drupal-optimizations:^1.0"
- "drupal/console:~1.0"
+ - "drush/drush:^9.0"
- "drupal/devel:^2.0"
+ - "drupal/features:^3.8"
- "drupal/rdfui:^1.0-beta1"
- "drupal/restui:^1.16"
- "drupal/search_api_solr:^2.0"
@@ -14,9 +16,12 @@ drupal_composer_dependencies:
- "drupal/content_browser:^1.0@alpha"
- "drupal/matomo:^1.7"
- "drupal/pdf:1.x-dev"
+ - "islandora/openseadragon:dev-8.x-1.x"
+ - "islandora/islandora:dev-8.x-1.x
+ - "islandora/islandora_defaults:dev-8.x-1.x"
+ - "islandora/controlled_access_terms:dev-8.x-1.x"
- "islandora/carapace:1.0.0"
- - "islandora/islandora_defaults:1.0.0"
-drupal_composer_project_package: "islandora/drupal-project:8.6.10"
+drupal_composer_project_package: "islandora/drupal-project:dev-8.x-1.x"
drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction"
drupal_core_path: "{{ drupal_composer_install_dir }}/web"
drupal_db_user: drupal8
@@ -28,6 +33,7 @@ drupal_site_name: "Islandora 8"
drupal_install_profile: standard
drupal_account_name: admin
drupal_enable_modules:
+ - features
- rdf
- responsive_image
- syslog
@@ -43,8 +49,9 @@ drupal_enable_modules:
- content_browser
- matomo
- pdf
- - islandora_core_feature
- controlled_access_terms_defaults
+ - controlled_access_terms
+ - islandora_core_feature
drupal_trusted_hosts:
- ^localhost$
drupal_trusted_hosts_file: "{{ drupal_core_path }}/sites/default/settings.php"
diff --git a/roles/internal/webserver-app/tasks/drupal.yml b/roles/internal/webserver-app/tasks/drupal.yml
index 608b035..067412f 100644
--- a/roles/internal/webserver-app/tasks/drupal.yml
+++ b/roles/internal/webserver-app/tasks/drupal.yml
@@ -60,7 +60,7 @@
group: "{{ webserver_app_user }}"
- name: Import features
- command: "{{ drush_path }} --root {{ drupal_core_path }} -y fim islandora_core_feature,controlled_access_terms_defaults"
+ command: "{{ drush_path }} --root {{ drupal_core_path }} -y fim islandora_core_feature"
# masonry library is required by content_browser and not installed by composer due to issue 2971165.
- name: Create drupal library directory.
@@ -82,17 +82,6 @@
args:
creates: "{{ drupal_external_libraries_directory }}/masonry"
-# Set Matomo Settings
-- name: Set Matomo site id.
- command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set matomo.settings site_id 1"
- register: set_search_api_config
- changed_when: "'Do you want to update site_id' in set_search_api_config.stdout"
-
-- name: Set Matmo sever url.
- command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set matomo.settings url_http http://localhost:8000/matomo/"
- register: set_search_api_config
- changed_when: "'Do you want to update site_id' in set_search_api_config.stdout"
-
# pdf.js library
- name: ensure pdf.js directory exists
file:
diff --git a/roles/internal/webserver-app/tasks/solr.yml b/roles/internal/webserver-app/tasks/solr.yml
index cae8a22..66fb78a 100644
--- a/roles/internal/webserver-app/tasks/solr.yml
+++ b/roles/internal/webserver-app/tasks/solr.yml
@@ -1,9 +1,9 @@
---
-- name: Set default solr server to point to CLAW core
- command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set search_api.server.default_solr_server backend_config.connector_config.core CLAW"
- register: set_search_api_config
- changed_when: "'Do you want to update' in set_search_api_config.stdout"
+#- name: Set default solr server to point to CLAW core
+# command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set search_api.server.default_solr_server backend_config.connector_config.core CLAW"
+# register: set_search_api_config
+# changed_when: "'Do you want to update' in set_search_api_config.stdout"
- name: Get solr config files to copy
command: "find {{ webserver_document_root }}/drupal/web/modules/contrib/search_api_solr/solr-conf/7.x -type f"
diff --git a/webserver.yml b/webserver.yml
index f799879..6288785 100644
--- a/webserver.yml
+++ b/webserver.yml
@@ -5,6 +5,7 @@
vars:
php_version: "7.2"
+ php_memory_limit: "2G"
roles:
- name: geerlingguy.repo-remi
---
# Install Drush Launcher.
drush_launcher_install: yes
drush_launcher_version: "0.6.0"
drush_launcher_phar_url: https://github.com/drush-ops/drush-launcher/releases/download/{{ drush_launcher_version }}/drush.phar
drush_launcher_path: /usr/local/bin/drush
# Install Drush via Composer globally.
drush_composer_global_install: no
drush_composer_version: "~9.0"
drush_composer_update: no
drush_composer_path: /usr/local/bin/drush
# Install from source (git clone + composer-based install).
drush_install_from_source: yes
drush_source_install_bin_path: /usr/local/bin/drush
drush_source_install_path: /usr/local/share/drush
drush_source_install_version: "9.x"
drush_keep_updated: no
drush_force_update: no
drush_force_composer_install: no
drush_composer_cli_options: "--prefer-dist --no-interaction"
drush_clone_depth: 1
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>{{ alpaca_local_mvn_path }}</localRepository>
<profiles>
<profile>
<id>maven-https</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>maven-https</activeProfile>
</activeProfiles>
</settings>
---
- name: Download blazegraph war
get_url:
url: https://repo1.maven.org/maven2/com/blazegraph/bigdata-war/{{ blazegraph_version }}/bigdata-war-{{ blazegraph_version }}.war
dest: "{{ blazegraph_war_path }}"
owner: "{{ blazegraph_user }}"
group: "{{ blazegraph_user }}"
register: blazegraph_war_download
---
openseadragon_drush_path: /usr/local/bin/drush
openseadragon_composer_item: "islandora/openseadragon:dev-8.x-1.x"
openseadragon_composer_root: "/var/www/html/drupal"
openseadragon_sites:
- default
openseadragon_version: 2.2.1
openseadragon_temp_folder: /tmp
openseadragon_iiiv_set_var: false
openseadragon_iiiv_server:
@attiks
Copy link
Author

attiks commented Jan 26, 2020

Fails when Drush 10 is installed

Call to undefined function Drupal\\features\\Commands\\drush_get_context() in Drupal\\features\\Commands\\FeaturesCommands->import() (line 723 of /var/www/html/drupal/web/modules/contrib/features/src/Commands/FeaturesCommands.php).

Installed by https://github.com/Islandora/drupal-project/blob/8.x-1.x/composer.json#L26

sh-4.2# cat /tmp/composer-project/composer.json | grep drush/drush
        "drush/drush": "^9.7.1 | ^10.0.0",

Fixed by adding https://gist.github.com/attiks/96b4e0802130b6876f1cfee466f6f3d7#file-diff-patch-L24

@attiks
Copy link
Author

attiks commented Jan 26, 2020

Last fail

ansible    | TASK [Islandora-Devops.alpaca : Add Alpaca Repos] ******************************
ansible    | Sunday 26 January 2020  14:52:46 +0000 (0:00:00.049)       0:33:12.606 ******** 
ansible    | failed: [default] (item=mvn:org.apache.camel.karaf/apache-camel/2.20.4/xml/features) => {"changed": false, "item": "mvn:org.apache.camel.karaf/apache-camel/2.20.4/xml/features", "msg": "client: Ignoring predefined value for KARAF_HOME\nAdding feature url mvn:org.apache.camel.karaf/apache-camel/2.20.4/xml/features\nError executing command: Error resolving artifact org.apache.camel.karaf:apache-camel:xml:features:2.20.4: [Could not transfer artifact org.apache.camel.karaf:apache-camel:xml:features:2.20.4 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file: http://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/2.20.4/apache-camel-2.20.4-features.xml. Return code is: 501 , ReasonPhrase:HTTPS Required., Could not find artifact org.apache.camel.karaf:apache-camel:xml:features:2.20.4 in spring.ebr.release (http://repository.springsource.com/maven/bundles/release/), Could not find artifact org.apache.camel.karaf:apache-camel:xml:features:2.20.4 in spring.ebr.external (http://repository.springsource.com/maven/bundles/external/), Could not transfer artifact org.apache.camel.karaf:apache-camel:xml:features:2.20.4 from/to gemini (http://zodiac.springsource.com/maven/bundles/release/): zodiac.springsource.com: Name or service not known] : mvn:org.apache.camel.karaf/apache-camel/2.20.4/xml/features\n"}
ansible    | failed: [default] (item=mvn:org.apache.activemq/activemq-karaf/5.15.0/xml/features) => {"changed": false, "item": "mvn:org.apache.activemq/activemq-karaf/5.15.0/xml/features", "msg": "client: Ignoring predefined value for KARAF_HOME\nAdding feature url mvn:org.apache.activemq/activemq-karaf/5.15.0/xml/features\nError executing command: Error resolving artifact org.apache.activemq:activemq-karaf:xml:features:5.15.0: [Could not transfer artifact org.apache.activemq:activemq-karaf:xml:features:5.15.0 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file: http://repo1.maven.org/maven2/org/apache/activemq/activemq-karaf/5.15.0/activemq-karaf-5.15.0-features.xml. Return code is: 501 , ReasonPhrase:HTTPS Required., Could not find artifact org.apache.activemq:activemq-karaf:xml:features:5.15.0 in spring.ebr.release (http://repository.springsource.com/maven/bundles/release/), Could not find artifact org.apache.activemq:activemq-karaf:xml:features:5.15.0 in spring.ebr.external (http://repository.springsource.com/maven/bundles/external/), Could not transfer artifact org.apache.activemq:activemq-karaf:xml:features:5.15.0 from/to gemini (http://zodiac.springsource.com/maven/bundles/release/): zodiac.springsource.com] : mvn:org.apache.activemq/activemq-karaf/5.15.0/xml/features\n"}
ansible    | failed: [default] (item=mvn:ca.islandora.alpaca/islandora-karaf/1.0.1/xml/features) => {"changed": false, "item": "mvn:ca.islandora.alpaca/islandora-karaf/1.0.1/xml/features", "msg": "client: Ignoring predefined value for KARAF_HOME\nAdding feature url mvn:ca.islandora.alpaca/islandora-karaf/1.0.1/xml/features\nError executing command: Error resolving artifact ca.islandora.alpaca:islandora-karaf:xml:features:1.0.1: [Could not transfer artifact ca.islandora.alpaca:islandora-karaf:xml:features:1.0.1 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file: http://repo1.maven.org/maven2/ca/islandora/alpaca/islandora-karaf/1.0.1/islandora-karaf-1.0.1-features.xml. Return code is: 501 , ReasonPhrase:HTTPS Required., Could not find artifact ca.islandora.alpaca:islandora-karaf:xml:features:1.0.1 in spring.ebr.release (http://repository.springsource.com/maven/bundles/release/), Could not find artifact ca.islandora.alpaca:islandora-karaf:xml:features:1.0.1 in spring.ebr.external (http://repository.springsource.com/maven/bundles/external/), Could not transfer artifact ca.islandora.alpaca:islandora-karaf:xml:features:1.0.1 from/to gemini (http://zodiac.springsource.com/maven/bundles/release/): zodiac.springsource.com] : mvn:ca.islandora.alpaca/islandora-karaf/1.0.1/xml/features\n"}
ansible    | 	to retry, use: --limit @/root/playbook/playbook.retry

@cafuego
Copy link

cafuego commented Jan 30, 2020

I got mine a bit further today, by bumping the ansible roles for blazegraph, openseadragon and karaf from 1.0.0 to master and prefixing their url with git+, then setting karaf_version: 4.0.10 in inventory/docker/group_vars/all/main.yml (karaf 4.2.x did not work, I've not tried 4.1.x yet)

Currently my build is falling on

ansible    | TASK [Islandora-Devops.karaf : Start Karaf service] ****************************
ansible    | Thursday 30 January 2020  07:15:30 +0000 (0:00:00.330)       0:13:07.153 ****** 
ansible    | fatal: [default]: FAILED! => {"changed": false, "msg": "Unable to start service karaf: Warning: karaf.service changed on disk. Run 'systemctl daemon-reload' to reload units.\nJob for karaf.service failed because a timeout was exceeded. See \"systemctl status karaf.service\" and \"journalctl -xe\" for details.\n"}
ansible    | 	to retry, use: --limit @/root/playbook/playbook.retry

The issue appears to be that karaf tries to write to the pid file, which is created as root:root by systemd, fails, and exits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment