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

Create vivo/home on application start-up #192

Merged
merged 9 commits into from
Feb 5, 2021

Conversation

awoods
Copy link
Member

@awoods awoods commented Oct 17, 2020

  • Add logic for untarring vivo-home

See details on related PR: vivo-project/VIVO#197

Related to: https://jira.lyrasis.org/browse/VIVO-1443

Interested parties

@VIVO-project/vivo-committers

ghost
ghost previously approved these changes Dec 18, 2020
Base automatically changed from master to main January 20, 2021 17:29
@ghost ghost requested review from a user and removed request for a user January 26, 2021 16:46
* Upgrade Jena version to 3.16.0 (vivo-project#196)

Related to: https://jira.lyrasis.org/browse/VIVO-1943

* remove example-settings.xml
* update home directory untar non-destructive
* checksum digest to retain modified files
* compare checksum from digest with existing file
* overwrite files that have not changed
* add command to manually generate checksum digest
* simplify parsing checksum digest using pattern

Co-authored-by: Andrew Woods <awoods@lyrasis.org>
Co-authored-by: Andrew Woods <awoods@duraspace.org>
@gneissone
Copy link
Member

@wwelling Testing out the new digest logic. Seems like

  • VIVO explodes tar every startup
  • VIVO deploys all files in tar, except those that have been modified directly in vivo-home.
    -> Thus updates made directly to vivo-home supercede updates made in the custom-webapp

I think this is the expected behavior, though it is a reversal (fix?) of the prevailing pattern in VIVO where if you mvn install'd it would overwrite the file in vivo-home, regardless if it had been updated.

Can we avoid deploying all the unchanged files, too? I.e., only execute the deploy logic if vivo-home has changed between two subsequent starts? Is that tracked in digest.md or would it require a second checksum?

@awoods
Copy link
Member Author

awoods commented Feb 3, 2021

@gneissone, can you be more specific with your expected behavior? I am not exactly sure I understand what you would like with the suggestion:

only execute the deploy logic if vivo-home has changed between two subsequent starts

@gneissone
Copy link
Member

It seems superfluous for VIVO to overwrite files in vivo home if they are exactly the same between the tar'd up home and the vivo home as it was in the previous startup. I can tell they are being overwritten because the 'Date Modified' date changes on every startup.

@ghost
Copy link

ghost commented Feb 3, 2021

@gneissone the digest is the original checksums of the untarred home directory after the first startup. In subsequent startups, the files are untarred and first checked to see if they already exist in the home directory. If they do, it checks to see if the digest checksum matches the checksum of the current file in the home directory. This is essentially determining if the file in the home directory has changed since the last time the digest was generated.

If we do not want to overwrite with a newly untarred file that already exists in the home directory and has not changed, we would have to do another checksum comparison between the newly untarred file and the existing file. We do not currently do this check and just assume to overwrite. We do already perform the checksum and could easily add this logic. It would be the exact same results just without new timestamps.

@ghost
Copy link

ghost commented Feb 4, 2021

I will update PR shortly to not overwrite file with exact same file. Otherwise, @gneissone was there anything else not working as expected or not doing something is should?

@ghost
Copy link

ghost commented Feb 4, 2021

awoods#3

* Upgrade Jena version to 3.16.0 (vivo-project#196)

Related to: https://jira.lyrasis.org/browse/VIVO-1943

* remove example-settings.xml
* update home directory untar non-destructive
* checksum digest to retain modified files
* compare checksum from digest with existing file
* overwrite files that have not changed
* add command to manually generate checksum digest
* simplify parsing checksum digest using pattern
* do not overwrite file if same as already exists

Co-authored-by: Andrew Woods <awoods@lyrasis.org>
Co-authored-by: Andrew Woods <awoods@duraspace.org>
@awoods
Copy link
Member Author

awoods commented Feb 4, 2021

We will want to squash the commits in this PR when merging into main.

@gneissone
Copy link
Member

Tested latest iteration and it works as expected. A couple small requests to the log behavior: awoods#4

@roflinn roflinn self-requested a review February 5, 2021 16:58
@roflinn roflinn merged commit 8b9a748 into vivo-project:main Feb 5, 2021
@awoods awoods deleted the vivo-1443 branch February 5, 2021 17:02
ghost pushed a commit that referenced this pull request Feb 23, 2023
ghost pushed a commit that referenced this pull request Feb 23, 2023
ghost pushed a commit that referenced this pull request Feb 23, 2023
ghost pushed a commit that referenced this pull request Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants