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

Faster redeployment for developers, skip deploy, remove version from war in dev #9959

Merged
merged 38 commits into from
Feb 23, 2024

Conversation

poikilotherm
Copy link
Contributor

@poikilotherm poikilotherm commented Sep 26, 2023

What this PR does / why we need it:
Containers provide a bad DX at the moment with editing XHTML files. This PR enables transfering modified files from the host into the running deployment inside the container.

Which issue(s) this PR closes:

Special notes for your reviewer:
Simply start the containers and, when using Netbeans, edit an XHTML file. After a page reload the change should be picked up without any manual intervention. It does not require you to run Payara from Netbeans.

Note: as this touches the base image, you will need to package this locally first and build your app image on top of it!

Suggestions on how to test this:
See above.

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?:
Nope

Additional documentation:
https://dataverse-guide--9959.org.readthedocs.build/en/9959/container/dev-usage.html

@poikilotherm poikilotherm added Component: Containers Anything related to cloudy Dataverse, shipped in containers. Feature: Container Guide labels Sep 26, 2023
@coveralls
Copy link

coveralls commented Sep 26, 2023

Coverage Status

coverage: 20.047%. remained the same when pulling 68eb59d on 9590-faster-redeploy into 5fc7b30 on develop.

By mounting the directory that contains the web application as an
exploded WAR, we can enable hot redeploys of code and XHTML.

To enable version-agnostic mounts, the output directory is configured
to not contain the version number anymore, but the WAR file is still
containing it.
@github-actions

This comment has been minimized.

This comment has been minimized.

3 similar comments

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

- Use caddy as a faster and smaller alternative to NGINX.
- Remove unnecessary pom.xml entry for container.
- Migrate config to Caddyfile in /conf instead of /modules (we do not create a new image here...)
- Add dependency on Dataverse container to proxy container
- Slight renaming of containers
It might be good to keep it available on localhost in addition to the HTTP variant on port 4848 via proxy.
With using the env var "SKIP_DEPLOY" or the Maven property "-Dapp.deploy.skip"
we can make the application server not deploy Dataverse on container start.
This is necessary to save on time and manual undeploy when using Payara IDE tools
to hot deploy changes.
@poikilotherm poikilotherm changed the title Faster redeploy - round 1 Faster redeployment Nov 8, 2023

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

set -eu

PROJECT_DIR="$1"
FILE_TO_COPY="$2"
RELATIVE_PATH="${FILE_TO_COPY#$PROJECT_DIR/}"

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Expansions inside ${..} need to be quoted separately, otherwise they match as patterns. SC2295

This comment has been minimized.

1 similar comment

This comment has been minimized.

Depending on the attachment configuration, the run configuration waits in blocking mode for more output from the container logs. The application would never be deployed, as the wait is indefinite.

We need to run the compose step and the deploy step on their own. One appears in the services tab, the other in the run tab.
This is very much Docker specific now and should be located within that folder.

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

1 similar comment

This comment has been minimized.

@pdurbin pdurbin assigned pdurbin and unassigned poikilotherm Feb 22, 2024
Maintaining these links is a maintenance burden. They should
be added programatically across all the guides instead.
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Works great. Merging.

I wasn't able to get watchers.xml imported. Not sure what I'm doing wrong.

Also, I got a weird error (below) the first time I tried to deploy but then I killed and removed all containers and tried again and it worked fine.

I've done the Info.java fast redeploy test for both Netbeans and IntelliJ now. I'm happy. Again, will merge.

Oh, and I also did a little doc cleanup along the way, especially the dev guide.

Screenshot 2024-02-23 at 3 07 28 PM

@pdurbin pdurbin merged commit 1752b46 into develop Feb 23, 2024
10 of 11 checks passed
@pdurbin pdurbin deleted the 9590-faster-redeploy branch February 23, 2024 20:25
@pdurbin pdurbin added this to the 6.2 milestone Feb 23, 2024

This comment has been minimized.

1 similar comment
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:9590-faster-redeploy
ghcr.io/gdcc/configbaker:9590-faster-redeploy

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

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. Feature: Container Guide Size: 10 A percentage of a sprint. 7 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Faster turn-around times for devs using containers
7 participants