Skip to content

Commit

Permalink
Merge branch 'main' into st-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rosiel authored Jun 5, 2024
2 parents 41f4f57 + 12ca931 commit e7abb5e
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/contributing/testing-a-pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
If you are testing a pull request, or for other reasons need to replace the
"official" code with code that's in a PR, or a different branch or fork, this
page offers three methods: using Composer Patches, using Composer to
require the branch and/or fork or installing source repositories with Composer.
require the branch and/or fork, or installing source repositories with Composer.

This documentation applies to Drupal modules, themes, and recipes, or any
other project that is managed by Composer.
Expand Down
48 changes: 48 additions & 0 deletions docs/installation/docker/site-template/docker-modifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Docker Modifications

ISLE Site Template provides you with a `docker-compose.yml` file that allows you to get an Islandora site running quickly, but it makes some assumptions about how the site will run, and which containers you will use. Once you have your site running you may want to make some modifications to the default setup that the Site Template uses.

## Adding / Editing Environment Variables

Islandora Buildkit provides several environment variables that can be modified when creating containers.

Please see the README for the different buildkit images to see what is available:

- [ActiveMQ](https://github.com/Islandora-Devops/isle-buildkit/tree/main/activemq)
- [Alpaca](https://github.com/Islandora-Devops/isle-buildkit/tree/main/alpaca)
- [Blazegraph](https://github.com/Islandora-Devops/isle-buildkit/tree/main/blazegraph)
- [Cantaloupe](https://github.com/Islandora-Devops/isle-buildkit/tree/main/cantaloupe)
- [Code Server](https://github.com/Islandora-Devops/isle-buildkit/tree/main/code-server)
- [Crayfits](https://github.com/Islandora-Devops/isle-buildkit/tree/main/crayfits)
- [Drupal](https://github.com/Islandora-Devops/isle-buildkit/tree/main/drupal)
- [Fedora](https://github.com/Islandora-Devops/isle-buildkit/tree/main/fcrepo6)
- [Fits](https://github.com/Islandora-Devops/isle-buildkit/tree/main/fits)
- [Homarus](https://github.com/Islandora-Devops/isle-buildkit/tree/main/homarus)
- [Houdini](https://github.com/Islandora-Devops/isle-buildkit/tree/main/houdini)
- [Hypercube](https://github.com/Islandora-Devops/isle-buildkit/tree/main/hypercube)
- [MariaDB](https://github.com/Islandora-Devops/isle-buildkit/tree/main/mariadb)
- [Milliner](https://github.com/Islandora-Devops/isle-buildkit/tree/main/milliner)
- [Solr](https://github.com/Islandora-Devops/isle-buildkit/tree/main/solr)

You can add these environment variables to your docker-compose.yml in order to change their values. For example, if you want to increase the PHP memory limit in your production Drupal container, you can do so like this:

```
drupal-prod:
<<: [*prod, *drupal]
Environment:
PHP_MEMORY_LIMIT: 1G
```


## Removing Services

You may not want to use all the images that are included in the Site Template’s `docker-compose.yml`. You can remove containers by deleting their sections in the docker-compose.yml file.

For example, to remove Fedora, you would delete the services called fcrepo-dev and fcrepo-prod.

Depending on the container you are removing, you may need to delete references to it as well. For example, some containers are referenced by others in the `depends_on` field. You will need to also delete these references, so if you delete the `fedora-dev` service, you will need to remove the rule that `traefik-dev` depends on it.

If you are removing a container which is referenced by Drupal, ensure that you update Drupal as well (e.g. if removing Fedora, ensure your Media's files are not writing to the Fedora filesystem).

After doing `docker compose down`, run `docker compose up -d --remove-orphans` to remove the containers you removed from the docker-compose.yml file.

105 changes: 105 additions & 0 deletions docs/installation/docker/site-template/updating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Updating

The following sections describe how to keep your Islandora install up to date with current versions of Drupal modules and Docker images.

## Updating Isle Buildkit (Islandora Docker Images)

Updating to a new version of Isle Buildkit is done by setting the ISLANDORA_TAG variable in your .env file. Once you have updated the .env file, you need to pull the new Islandora images, and rebuild your custom Drupal image from the specified Drupal image.

For example, to upgrade from Buildkit 2.0.0 to 3.0.0 you would do the following steps:

1. Change your .env file to say ISLANDORA_TAG=3.0.0

2. Stop your Docker containers

`docker compose --profile dev down`

3. Pull the new Docker images (except the Drupal image)

`docker compose --profile dev pull --ignore-buildable --ignore-pull-failures`

4. Build your custom Drupal image

`docker compose --profile dev build`

5. Start your containers from the new images

`docker compose --profile dev up -d`

Once you have upgraded your images, you may need to perform extra steps for Solr and Mariadb, depending on whether these have new versions in the new images.

!!! note "Production Sites"

Upgrading a production site works the same way, just replace `dev` with `prod` in the above instructions.

### Solr

You may need to regenerate your Solr configs if Solr has been updated to a new version, or when the Search API Solr Drupal module has been updated. If you visit /admin/config/search/search-api/server/default_solr_server on your Islandora site it will tell you if the configs need to be updated.

To generate new configs perform the following steps:

1. Remove existing solr configs

`docker compose exec -T solr-dev with-contenv bash -lc 'rm -r server/solr/default/*'`

2. Recreate solr configs for new solr versions

`docker compose exec -T drupal-dev with-contenv bash -lc "for_all_sites create_solr_core_with_default_config"`

3. Reindex Solr through the admin page or via Drush

### MariaDB

After updating MariaDB, you may need to run [mariadb-upgrade](https://mariadb.com/kb/en/mariadb-upgrade/) inside your MariaDB container, to update your system tables. This should be safe to run any time, but it is a good idea to back up your database first, just in case.

You can run this with

`docker compose exec mariadb-dev mariadb-upgrade`

## Updating Traefik

Traefik is not updated with the other buildkit images. It is recommended that you periodically update Traefik by changing the image version in your docker-compose.yml file to the [current version in use by Isle Site Template](https://github.com/Islandora-Devops/isle-site-template/blob/main/docker-compose.yml)

## Updating Drupal Modules

Drupal updates are performed through composer on your development site. Once the modules have been added/removed/updated, your `composer.json` and `composer.lock` files can be checked into your git repository and you can rebuild your production Drupal container with the new files.

### Development

Composer commands need to [run in your Drupal container](/documentation/installation/docker/site-template/containers.md). For example:

​​`docker compose exec drupal-dev composer update -W`

Or

`docker compose exec drupal-dev composer require 'drupal/islandora:^2.11'`

Running database updates is also done in the container like this:

`docker compose exec drupal-dev drush updb`

!!! note

You should backup your database before running database updates

If you are enabling or uninstalling modules, you will also need to export your Drupal configuration.

Once you have finished your composer changes you can commit and push your repository with the new `composer.json` and `composer.lock` changes.

### Production

First you will `git pull` to get the `composer.json` and `composer.lock` changes you made in development.

Next you build your Drupal image again, which will install the modules specified in those files:

`docker compose --profile prod build`

Then you stop and start your containers to get the new image:

`docker compose --profile prod down`

`docker compose --profile prod up -d`

And if necessary, run database updates:

`docker compose exec drupal-prod drush updb`
12 changes: 6 additions & 6 deletions docs/technical-documentation/running-automated-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Before you can use phpunit, you must first install the following:

In ISLE, you need to make the database port available to PHPUnit. To do that, edit `docker-compose.yml` and find the section including `image: islandora/mariadb[version number]`. Shortly below is a `labels:` heading; set the value of the `traefik.enable: ` to `"true"`. Apply the changes made to the `docker_compose.yml` using `docker compose up -d`.

Follow the `Configure PHPUnit` and `Create a directory for HTML output` sections in [Drupal Documentation on running phpunit tests](https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-phpunit-tests) to make a `phpunit.xml` file.
Follow the `Configure PHPUnit` and `Create a directory for HTML output` sections in [Drupal Documentation on running phpunit tests](https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-phpunit-tests) to make a `phpunit.xml` file. Note that:

If you place the `phpunit.xml` file in any directory other than `[drupal root]/web/core`, you need to change the 'bootstrap' in the `<phpunit>` tag near the top of the file to point to the relative or absolute location of the `[drupal root]/web/core` folder.
* If you place the `phpunit.xml` file in any directory other than `[drupal root]/web/core`, you need to change the 'bootstrap' in the `<phpunit>` tag near the top of the file to point to the relative or absolute location of the `[drupal root]/web/core` folder.

When setting the `SIMPLETEST_DB` database credentials in ISLE,
* the default username and db_name are `drupal_default`
* your db_password can be found in `codebase/web/sites/default/settings.php`
* When setting the `SIMPLETEST_DB` database credentials in ISLE,
* the default username and db_name are `drupal_default`
* your db_password can be found in `codebase/web/sites/default/settings.php`

Unless you changed the default values, just swap out [password] for your actual db password in the following:
* Unless you changed the default values, just swap out [password] for your actual db password in the following:

```
mysql://drupal_default:[password]@islandora.traefik.me:3306/drupal_default`.
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ nav:
- 'ISLE Site Template':
- 'Introduction to Site Template': 'installation/docker/site-template/site-template.md'
- 'Creating Your Site': 'installation/docker/site-template/setup.md'
- 'Docker Modifications': 'installation/docker/site-template/docker-modifications.md'
- 'Updating': 'installation/docker/site-template/updating.md'
- 'Ansible Playbook': 'installation/playbook.md'
- Manual Installation:
- 'Introduction': 'installation/manual/introduction.md'
Expand Down

0 comments on commit e7abb5e

Please sign in to comment.