Skip to content

configbaker container - #9574

Merged
kcondon merged 37 commits into
IQSS:developfrom
poikilotherm:9573-configbaker
Jun 1, 2023
Merged

kcondon merged 37 commits into
IQSS:developfrom
poikilotherm:9573-configbaker

Conversation

@poikilotherm

@poikilotherm poikilotherm commented May 4, 2023 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

This pull request will add a new container to be built and pushed alongside the application itself, but as a standalone thing to pull from a registry. This image contains lots of tools and scripts necessary to successfully start and configure a Dataverse instance to a) avoid repeating these instructions in different flavors over and over again plus b) encapsulate the Linux scripts in a container so it can be executed on any platform.

Which issue(s) this PR closes:

Special notes for your reviewer:
None yet. This is a WIP.

Suggestions on how to test this:
docker run -it --rm gdcc/configbaker:unstable

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Nope.

Is there a release notes update needed for this change?:
Ahem. Dunno. Maybe.

Additional documentation:
None yet.

@poikilotherm poikilotherm added the Component: Containers Anything related to cloudy Dataverse, shipped in containers. label May 4, 2023
@poikilotherm poikilotherm self-assigned this May 4, 2023

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some initial feedback. I ran it with no arguments and got the help ok.

Comment thread modules/container-configbaker/scripts/fix-fs-permissions.sh
Comment thread modules/container-configbaker/README.md Outdated
Comment thread modules/container-configbaker/Dockerfile Outdated
Comment thread modules/container-configbaker/Dockerfile Outdated
Comment thread modules/container-configbaker/scripts/fix-fs-permissions.sh
Comment thread modules/container-configbaker/scripts/help.sh Outdated
Comment thread modules/container-configbaker/Dockerfile
Comment thread modules/container-configbaker/scripts/help.sh
To make use of the setup scripts inside containers, the target URL must be
configurable and not hardcoded to localhost:8080. This commit
simply creates a variable and uses the old static URL as default if
it has not been set by the environment before.
This commit enhances any reference to other files (scripts or data)
to be relative to the script currently running instead of the
working directory from where the script is called from.

This removes the requirement to change into the directory with
setup-all.sh first.

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine but I haven't tested it.

Comment thread scripts/api/setup-all.sh
export DATAVERSE_URL
SOLR_URL=${SOLR_URL:-"http://localhost:8983"}

SCRIPT_PATH="$(dirname "$0")"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
SCRIPT_PATH="$(dirname "$0")"
# scripts/api when called from the root of the source tree
SCRIPT_PATH="$(dirname "$0")"

Copying the default configset of the requested Solr version
and adding our schema and config creates a marvelous template.
To be reused during execution of a vanilla Solr image.
By building the image at the same time as the application,
we can ensure both match. It also keeps compatibility
between the compose file to start things and the Maven build.
With adding bootstrap.sh, a Dataverse instance may now be
initialized. Using the changed setup scripts, we can reach
out to a Dataverse container and set it up.

By using a concept of personas, it is easy to add and select
other initializations as necessary. This will be extended in
the future.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage: 20.138% (-0.03%) from 20.171% when pulling 051d132 on poikilotherm:9573-configbaker into 58dac8d on IQSS:develop.

Now an instance can be bootstrapped automatically.

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a quick question.

Comment thread scripts/api/setup-all.sh
echo "deleting all data from Solr"
curl http://localhost:8983/solr/collection1/update/json?commit=true -H "Content-type: application/json" -X POST -d "{\"delete\": { \"query\":\"*:*\"}}"

SERVER=http://localhost:8080/api

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it strictly necessary to remove the hard coded 8080 in this and other setup scripts?

@poikilotherm poikilotherm May 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm awfully sorry me lad, but yes it is.

When you run this script inside a container which is not the application server itself, localhost is that container and not the app server. It's like a different machine. If you run this on the host, this works because of the mapped ports, but this will not work on a Windows host.

Sorry, hardcoding it never was a good idea, same as the paths not being relative to the script location.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BTW Jenkins made it to the end, so I'm pretty sure I didn't break the scripts 😄

@pdurbin

pdurbin commented May 10, 2023

Copy link
Copy Markdown
Member

I tried this as of 36a43ac and it worked great!

It's now literally a one liner to spin up a Dataverse dev environment:

mvn -Pct clean package docker:run

Great work, @poikilotherm! 🎉 🚀

@pdurbin pdurbin added the Size: 3 A percentage of a sprint. 2.1 hours. label May 10, 2023
Comment thread scripts/api/setup-all.sh Outdated
Comment thread modules/container-configbaker/Dockerfile
@pdurbin pdurbin changed the title 9573 configbaker container configbaker container May 25, 2023
@pdurbin pdurbin self-assigned this May 25, 2023
@poikilotherm

Copy link
Copy Markdown
Contributor Author

/push-image

Test what happens with the configbaker image...?

@github-actions

Copy link
Copy Markdown

📦 Could not push preview image 😞. See log for details.

@poikilotherm

Copy link
Copy Markdown
Contributor Author

/push-image

Try again to push the images after fixing the registry target in develop.

@github-actions

Copy link
Copy Markdown

📦 Pushed preview application image as

ghcr.io/gdcc/dataverse:9573-configbaker

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@poikilotherm
poikilotherm marked this pull request as ready for review May 31, 2023 14:14

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

As I mentioned in standup, setup-all has been updated but I'm not too worried because it is exercised by Jenkins.

@kcondon kcondon self-assigned this Jun 1, 2023
@kcondon
kcondon merged commit 30e9ef5 into IQSS:develop Jun 1, 2023
@pdurbin pdurbin added this to the 5.14 milestone Jun 1, 2023
@poikilotherm
poikilotherm deleted the 9573-configbaker branch October 2, 2024 06:38
@cmbz cmbz added FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) and removed FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) labels Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Containers Anything related to cloudy Dataverse, shipped in containers. Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

configurator image for container setup Configurable server-port-number for the containerized Dataverse

6 participants