diff --git a/.env.sample b/.env.sample index 3b94306..e2ffc4e 100644 --- a/.env.sample +++ b/.env.sample @@ -51,38 +51,24 @@ CONSISTENCY=delegated # locally you can continue to rely on "islandora", CI/DC will override this # variable though. # -# This should match image.isle.repository value in the Helm chart. -# PHP 8.1 ISLE_REPOSITORY=islandora -# PHP 8.1 local registry (i.e., isle-buildkit images built locally) +# Local registry (i.e., isle-buildkit images built locally) # ISLE_REPOSITORY=islandora.dev # The version of the isle-buildkit images to use. # # This should match image.isle.tag value in the Helm chart. -# PHP 8.1 remote registry -ISLE_TAG=3.2.4 -# PHP 8.1 local registry (i.e., isle-buildkit images built locally) -# ISLE_TAG=latest - -# The repository for images produced by this repository. -# -# The base path calincs/cwrc/leaf/leaf-base-i8 is included as it is shared -# across all images. -# -# This requires logging in: -# -# `docker login gitlab.com` -# -# This should match image.repsoitory value in the Helm chart. -REPOSITORY=registry.gitlab.com/calincs/cwrc/leaf/leaf-base-i8 - -# This should match image.tag value in the Helm chart. -TAG=local +# remote registry +ISLE_TAG=3.4.0 +# local registry (i.e., isle-buildkit images built locally) +# ISLE_TAG=local ##################################################################### -# Config: General +# Config: General ##################################################################### -#DOMAIN=v2.cwrc.ca DOMAIN=islandora.dev SITE=https://${DOMAIN} + +# The repository for images produced by this repository. +BAGGER_TAG=local +BAGGER_REPOSITORY=ghcr.io/cwrc \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d7cddb7..6213cfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN --mount=type=cache,id=bagger-apk-${TARGETARCH},sharing=locked,target=/var/ca && \ echo '' > /root/.ash_history -# PHP 8.1 +# ARG BAGGER_COMMIT="14661df7867af47bb86187f0f94a067e5aa91fd2" ARG BAGGER_FILE=${BAGGER_COMMIT}.tar.gz ARG BAGGER_URL="https://github.com/cwrc/islandora_bagger/archive/${BAGGER_FILE}" diff --git a/README.md b/README.md index 9cb6211..cc2845e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Bagger -Docker image for [Islandora Bagger](https://github.com/mjordan/islandora_bagger). +Container image for [Islandora Bagger](https://github.com/mjordan/islandora_bagger). + +The application repository contains the documentation [Islandora Bagger](https://github.com/mjordan/islandora_bagger), this is likely a good place to start for learning how to use the application and how to use. Produces archival information packages, [Bags](https://en.wikipedia.org/wiki/BagIt), for objects using Islandora's REST interface. For more information see [Islandora Bagger] @@ -59,31 +61,23 @@ This container makes several opinionated assumptions about how one installs and * Turn on the ability to register preservation bag creation with Drupal/Islandora (https://github.com/mjordan/islandora_bagger_integration/pull/31) via `BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA` * Make no assumptions about setup infrastructure: assume a proxy or edge router (see warnings about setup in [Islandora Bagger]) -## Test - -ToDo: revise - -* permissions wrong (if `APP_ENV` is set to prod) -* automate the build of a list of resources to preserve and pass to islandora_bagger (rough idea: gather Drupal resources by their modified date and compare against the modified dates (or hash?) in the islandora_bagger_integration bag log and if differ then add to a list to preserve ) -* post-bag plugin to upload archival packages to OLRC -* automate OCI image generation and upload to an image repository - -ToDo: Test further +## Setup Drupal -* Test: Drupal Context that sends requests to the Bagger REST API to queue a preservation request -* test if per bag config can override location in the per config/services.yml. Also set in the crontab to override any overrides in the per bag -* convert yaml_path to an env (where the per bag configuration is stored on web requests for preservation - https://github.com/mjordan/islandora_bagger/blob/1b4973023d0ace40633c79340077980b3be7c947/src/Controller/IslandoraBaggerController.php#L26) -* `delete_settings_file`: problems arise if the resource is added to the queue multiple times before being preserved. The resource is added to the preservation queue multiple times but the settings file is only stored on the filesystem once thus the first preservation will delete the settings file and subsequent queued items may cause a missing settings file error. +See [Islandora Bagger] for the Drupal setup requirements. `getjwtonlogin` and `islandora_bagger_integration` are required. A quick way to add: -## Setup Drupal +Add to composer.json "repositories" key in your Drupal project -See [Islandora Bagger] for the Drupal setup requirements. `getjwtonlogin` and `islandora_bagger_integration` are required. A quick way to add (note: should use composer, this is a temporary kluge): +``` yaml + { + "type": "git", + "url": "https://github.com/cwrc/islandora_bagger_integration.git", + "no-api": true + }, +``` ``` bash -composer require 'drupal/getjwtonlogin:^2.0' -cd web/modules/contrib/ -git clone https://github.com/mjordan/islandora_bagger_integration.git -cd /var/www/drupal +cd ${DRUPAL_HOME} +composer require -d /var/www/drupal 'drupal/getjwtonlogin:^2.0' 'mjordan/islandora_bagger_integration' drush en -y getjwtonlogin drush en -y islandora_bagger_integration composer install @@ -170,6 +164,25 @@ BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA=true * add `build/certs/rootCA.pem` to the containers `/etc/ssl/certs/ca-certificates.crt` file otherwise an SSL exception will occur * note: this is not automatic at the moment +* Add additional Bagger properties to the `.env`, as needed. + +## Test and future work + +ToDo: revise + +* permissions wrong (if `APP_ENV` is set to prod) +* automate the build of a list of resources to preserve and pass to islandora_bagger (rough idea: gather Drupal resources by their modified date and compare against the modified dates (or hash?) in the islandora_bagger_integration bag log and if differ then add to a list to preserve ) +* post-bag plugin to upload archival packages to OLRC +* automate OCI image generation and upload to an image repository + +ToDo: Test further + +* Test: Drupal Context that sends requests to the Bagger REST API to queue a preservation request +* test if per bag config can override location in the per config/services.yml. Also set in the crontab to override any overrides in the per bag +* convert yaml_path to an env (where the per bag configuration is stored on web requests for preservation - https://github.com/mjordan/islandora_bagger/blob/1b4973023d0ace40633c79340077980b3be7c947/src/Controller/IslandoraBaggerController.php#L26) +* `delete_settings_file`: problems arise if the resource is added to the queue multiple times before being preserved. The resource is added to the preservation queue multiple times but the settings file is only stored on the filesystem once thus the first preservation will delete the settings file and subsequent queued items may cause a missing settings file error. + + ## References [Islandora Bagger]: https://github.com/mjordan/islandora_bagger diff --git a/docker-compose.bagger.yml b/docker-compose.bagger.yml index 2ada486..b2aa440 100644 --- a/docker-compose.bagger.yml +++ b/docker-compose.bagger.yml @@ -6,8 +6,8 @@ # COMPOSE_PATH_SEPARATOR=: # COMPOSE_FILE=docker-compose.yml:docker-compose.bagger.yml # # Environment for the Islandora Bagger container -# BAGGER_REPOSITORY=cwrc -# BAGGER_TAG=latest +# BAGGER_REPOSITORY=ghcr.io/cwrc +# BAGGER_TAG=local # BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA=true # # * copy this file into the repo @@ -51,7 +51,7 @@ services: <<: *dev restart: "no" environment: - BAGGER_DRUPAL_URL: ${SITE:-"https://islandora.dev"} + BAGGER_DRUPAL_URL: ${SITE:-"https://islandora.dev"} BAGGER_CROND_ENABLE_SERVICE: ${BAGGER_CROND_ENABLE_SERVICE:-"true"} BAGGER_CROND_SCHEDULE: ${BAGGER_CROND_SCHEDULE:-1 2 * * *} BAGGER_CROND_LOG_LEVEL: ${BAGGER_CROND_LOG_LEVEL:-"8"} diff --git a/docker-compose.yml b/docker-compose.yml index f9e16b5..36b967b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,6 @@ ## secrets: - UID: - file: ./custom/secrets/UID - GID: - file: ./custom/secrets/UID BAGGER_DRUPAL_DEFAULT_ACCOUNT_PASSWORD: file: ./custom/secrets/DRUPAL_DEFAULT_ACCOUNT_PASSWORD @@ -53,13 +49,13 @@ services: BAGGER_DEFAULT_PER_BAG_LOG_BAG_CREATION: ${BAGGER_DEFAULT_PER_BAG_LOG_BAG_CREATION:-"true"} BAGGER_DEFAULT_PER_BAG_LOG_BAG_LOCATION: ${BAGGER_DEFAULT_PER_BAG_LOG_BAG_LOCATION:-"false"} BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA: ${BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA:-"false"} - image: ${REPOSITORY}/cwrc/isle-bagger:${TAG} - ports: + image: ${BAGGER_REPOSITORY}/isle-bagger:${BAGGER_TAG} + ports: - 9856:8000 - # secrets: + secrets: # - source: UID # - source: GID - # - source: BAGGER_DRUPAL_DEFAULT_ACCOUNT_PASSWORD + - source: BAGGER_DRUPAL_DEFAULT_ACCOUNT_PASSWORD volumes: - bagger-data:/var/www/bagger/var - bagger-aip:${BAGGER_OUTPUT_DIR:-/data/aip}