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

Sandbox, Import/Export tool, and Syn toggling #95

Merged
merged 24 commits into from
Mar 16, 2021
Merged

Conversation

dannylamb
Copy link
Member

@dannylamb dannylamb commented Dec 8, 2020

Does the above^^

Plus it guts the startup script and I'm pushing that stuff into the Makefile in isle-dc. Will link PR when it's ready.

@@ -33,7 +33,7 @@ multisubstitute
define DB_USER "drupal_default"
define EMAIL "webmaster@localhost.com"
define INSTALL "true"
define INSTALL_EXISTING_CONFIG "false"
define INSTALL_EXISTING_CONFIG "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe override it in the demo image as there is no configuration in the base Drupal image.

demo/Dockerfile Outdated
/var/www/drupal \
&& \
# Get the Drupal codebase
git clone https://github.com/dannylamb/islandora-sandbox && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a helper https://github.com/Islandora-Devops/isle-buildkit/blob/main/crayfish/Dockerfile#L8 git-clone-cached.sh which might be helpful in reducing build times.

@noahwsmith
Copy link
Contributor

The only thing I found is that GEMINI needs to be remove here:

https://github.com/Islandora-Devops/isle-buildkit/blob/post-sprint-4/drupal/rootfs/etc/islandora/utilities.sh#L80

@dannylamb
Copy link
Member Author

🙇‍♂️ Thx for the commit.

I think it's time this becomes a real pull request.

@dannylamb dannylamb marked this pull request as ready for review February 22, 2021 15:01
@dannylamb
Copy link
Member Author

Missed a default. I've confirmed this works with and without secrets now.

@noahwsmith
Copy link
Contributor

Pulling all the images into our work, this seems to work well without secrets. I must have missed something in my merge because secrets don't work anymore with all of this merged into our work. But they seem to work independently...

@dannylamb
Copy link
Member Author

@noahwsmith I think I changed one of the secrets from being Fedora specific to Tomcat specific. Maybe it's that? I'm pretty sure I can revert that and we can test.

Copy link
Contributor

@nigelgbanks nigelgbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot had changed since the last time I gave a look so I thought I would look in again, it looks like it has come along way. I just mainly had some concerns around the environment variables and what looks like potential issues with defaults.

@@ -76,3 +75,5 @@ ENV \
JAVA_OPTS="-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx8g"

COPY rootfs /

# bin/client -r 10 -d 5 "feature:install fcrepo-indexing-triplestore" && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bit of dead code to be removed?

}

# After enabling and importing features a number of configurations need to be updated.
function configure_islandora_default_module {
if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q islandora_defaults; then
echo "islandora_defaults is not installed. Skipping configuration"
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤓 to be pedantic inconsistent indents (feel free to ignore).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, i'll fix 'em. dang tabs...

@@ -403,9 +404,13 @@ function configure_search_api_solr_module {

# Enables and sets carapace as the default theme.
function set_carapace_default_theme {
if ! drush pm-list --pipe --type=theme --status=enabled --no-core | grep -q carapace; then
echo "carapace is not available. Skipping configuration."
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤓 to be pedantic inconsistent indents (feel free to ignore).

@@ -452,20 +457,29 @@ function create_solr_core_with_default_config {

# Install matomo and configure.
function configure_matomo_module {
if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q matomo; then
echo "matomo is not installed. Skipping configuration"
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤓 to be pedantic inconsistent indents (feel free to ignore).

@@ -27,18 +33,19 @@ ENV \
FCREPO_ACTIVEMQ_QUEUE=fedora \
FCREPO_ACTIVEMQ_TOPIC=fedora \
FCREPO_BINARYSTORAGE_TYPE=file \
FCREPO_DB_MYSQL_HOST=mariadb \
FCREPO_DB_MYSQL_PORT=3306 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are still in use and provide defaults when choosing a driver. See the references that exist in a confd template here:

"connectionUrl": "jdbc:mysql://{{ getv "/db/mysql/host" (getenv "FCREPO_DB_MYSQL_HOST") }}:{{ getv "/db/mysql/port" (getenv "FCREPO_DB_MYSQL_PORT") }}/{{ getv "/db/name" (getenv "FCREPO_DB_NAME") }}?createDatabaseIfNotExist=true",

What should probably be changed instead is the usage in 03-fcrepo-setup.sh from:

function execute_sql_file {
    execute-sql-file.sh \
        --driver "${FCREPO_PERSISTENCE_TYPE}" \
        --host "${FCREPO_DB_HOST}" \
        --port "${FCREPO_DB_PORT}" \
        --user "${FCREPO_DB_ROOT_USER}" \
        --password "${FCREPO_DB_ROOT_PASSWORD}" \
        "${@}"
}

To

function execute_sql_file {
    local FCREPO_DB_HOST=""
    local FCREPO_DB_PORT=""
    if [[ "${FCREPO_PERSISTENCE_TYPE}" == "mysql" ]]; then
        FCREPO_DB_HOST="${FCREPO_DB_MYSQL_HOST}"
        FCREPO_DB_PORT="${FCREPO_DB_MYSQL_PORT}"
    else
        FCREPO_DB_HOST="${FCREPO_DB_POSTGRESQL_HOST}"
        FCREPO_DB_PORT="${FCREPO_DB_POSTGRESQL_PORT}"
    fi
    execute-sql-file.sh \
        --driver "${FCREPO_PERSISTENCE_TYPE}" \
        --host "${FCREPO_DB_HOST}" \
        --port "${FCREPO_DB_PORT}" \
        --user "${FCREPO_DB_ROOT_USER}" \
        --password "${FCREPO_DB_ROOT_PASSWORD}" \
        "${@}"
}

and remove FCREPO_DB_HOST and FCREPO_DB_PORT from the Dockerfile and README.md

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may have been my problem- Fedora couldn't find its database when I was using secrets.

@@ -4,5 +4,7 @@
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
{{ if eq (getv "/disable/syn" "false") "false" }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be:

{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "false" }}

export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" (getenv "FCREPO_DB_PASSWORD") }}"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml"
{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "true" }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above it doesn't need to be a template.

export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml"
if [[ "${FCREPO_DISABLE_SYN}" == "true" ]]; then
  export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed"
fi

| FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | |
| FCREPO_CATALINA_OPTS | /fcrepo/catalina/opts | | |
| FCREPO_DB_HOST | /fcrepo/db/host | mariadb | |
| FCREPO_DB_NAME | /fcrepo/db/name | fcrepo | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See notes above about environment variables.


function execute_sql_file {
execute-sql-file.sh \
--driver "${FCREPO_PERSISTENCE_TYPE}" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See notes above for fcrepo4, May or may not be relevant to this since repository.json is no longer in use.

export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistence/type" (getenv "FCREPO_PERSISTENCE_TYPE") }}://{{ getv "/db/host" (getenv "FCREPO_DB_HOST") }}:{{ getv "/db/port" (getenv "FCREPO_DB_PORT") }}/fcrepo"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is no repository.json in fcrepo6 seems like the defaults here would cause problems? Like the default for FCREPO_PERSISTENCE_TYPE is file?

@dannylamb
Copy link
Member Author

Thanks for the feedback @nigelgbanks . I agree, the defaults are problematic for fcrepo6, but I wasn't sure how best to handle that, as well as splitting apart the mysql vs postgres variables. I could've sworn I grepped for their usage and came up short, which is why I just straight up overwrote them, but I guess not. One of those bad decisions made during "make it work" mode.

I'll make another pass at this and try to re-work things... I"m 🤦 'ing hard just looking at those templates which need not be templates....

@nigelgbanks
Copy link
Contributor

You probably had them as templates before the rebase and changes to the confd system which makes sense.

Pulling the sandbox in as a demo makes a lot of sense, let me know if/when you want me to setup default_content in https://github.com/dannylamb/islandora-sandbox.

@nigelgbanks
Copy link
Contributor

@dannylamb I merged main into your branch to unblock @zacanbot and his work on Kubernetes.

@@ -29,7 +29,6 @@ RUN bin/start && \

# Triple indexing
RUN bin/start && \
bin/client -r 10 -d 5 "feature:install fcrepo-indexing-triplestore" && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This service is keeping me from being able to run on Arm for some reason I cannot sort out (Karaf makes me wanna pull my hair out), is it not needed on main either?

@dannylamb
Copy link
Member Author

Ok, I've finally wrapped up all the code/test stuff for our php code and can circle back to this. Thank you for your patience 🙇 . We'll get there.

@dannylamb
Copy link
Member Author

@nigelgbanks @noahwsmith I've made another pass. Any 👀 on this would be appreciated.

@noahwsmith
Copy link
Contributor

Hi Danny - I'm pretty deep underwater at the moment, but can test over the weekend if this is still open.

@nigelgbanks nigelgbanks merged commit 18a6631 into main Mar 16, 2021
@nigelgbanks
Copy link
Contributor

Changes look good, and everything appears to work for me locally

@nigelgbanks nigelgbanks deleted the post-sprint-4 branch March 19, 2021 11:22
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.

3 participants