Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derivative connector: accept an inputargs property and pass it throug… #91

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

jasonhildebrand
Copy link

@jasonhildebrand jasonhildebrand commented Oct 20, 2022

Related links

What does this Pull Request do?

It extends the derivative connector to accept an inputargs property and pass it through as a new header call X-Islandora-Input-Args.

The derivative connector does not require the inputargs property, so this change should not introduce any compatibility issues.

The linked PRs include corrsponding functionality in Houdini (to use the additional header), and in Islandora (to add a new field for these input arguments when configuring actions).

How should this be tested?

This can probably be tested most easily by using the related PRs.
Apply the Crayfish PR (houdini). New logging in that PR will show you all the headers that houdini receives from Alpaca.
Apply the Islandora PR (forthcoming - I will provide link shortly). This will allow you to pass the inputargs property from Drupal.
Apply this PR and build. I used Ubuntu 20.04, here are my notes.

Installed necessary packages:

#   newer versions of java are not compatible with gradle 5, and newer gradle versions are not comptible with alpaca 1.x due to osgi plugin which alpaca requires but is no longer available.
apt install openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk-headless

Build excluding tests (which timed out in my environment; not knowing the state of them and not being familiar with this repo, I did not spend time trying to get them running).

./gradlew -x islandora-connector-derivative:test -x islandora-indexing-fcrepo:test -x islandora-indexing-triplestore:test -x islandora-karaf:test build

Publish the packages to a "local" maven repository

./gradlew publishToMavenLocal   # this creates a directory structure at ~/.m2

Copy the packages into isle-buildkit to be included in alpaca image

mkdir ~/projects/isle-buildkit/alpaca/localm2
cp -r ~/.m2 ~/projects/isle-buildkit/alpaca/localm2/

Modify isle-buildkit/alpaca/Dockerfile to pre-seed these files into the image (so that they get picked up instead of being downloaded from remote maven repo), by adding the COPY line near the top - I'm including some context. Needs to happen before the feature:repo-add commands.

# syntax=docker/dockerfile:1.2.1
ARG repository=local
ARG tag=latest
FROM --platform=$BUILDPLATFORM ${repository}/karaf:${tag} AS download

COPY localm2/.m2 /root/.m2

# Install common features and repos
RUN bin/start && \

Build alpaca and pre-requisite images:

./gradlew download:build karaf:build alpaca:build

Now in isle-dc, update the docker-compose config so that alpaca will use the local image just built:

  alpaca:
    image: local/alpaca

Spin up isle-dc.

In Drupal, go to Configuration -> System -> Actions.
Find Image - Generate a service file from an original file and click Configure.
Assuming the Islandora PR has been applied, you should see an "Additional input arguments" field. Put in an option there. -density 288 works if your original file is a PDF.
Save the action.

Run this action on a Repository Item.
Check houdini logs (docker-compose logs -f houdini) to confirm that the X-Islandora-Input-Args header was received.

@jasonhildebrand
Copy link
Author

Let me know whether this PR needs to be re-rolled against 2.x. I am using 1.x in my environment so was the easiest route to develop and test this feature.

@jasonhildebrand jasonhildebrand changed the base branch from 1.x to 2.x August 21, 2024 22:17
@jasonhildebrand
Copy link
Author

I have updated this PR to base it against the 2.x branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants