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

Docker: add support for a patchlevel version upgrade #203

Closed
bschmalhofer opened this issue Jul 13, 2020 · 6 comments
Closed

Docker: add support for a patchlevel version upgrade #203

bschmalhofer opened this issue Jul 13, 2020 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

Currently one can't simply upgrade the otobo docker image as runtime data is stored in /opt/otobo. Examples are the dirs Custom and var and the files ZZZAAuto,pm and Config.pm. Runtime and code data should be separated. Also investigate which cases are handled in https://hub.docker.com/r/juanluisbaptiste/otrs.

@bschmalhofer bschmalhofer added the enhancement New feature or request label Jul 13, 2020
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Jul 13, 2020
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Jul 23, 2020

I checked how
See the functions upgrade_minor_version, upgrade, and check_host_mount_dirin https://github.com/juanluisbaptiste/docker-otrs/blob/master/otrs/functions.sh.

@bschmalhofer bschmalhofer changed the title Docker: make the docker image upgradeable Docker: add support for minor version upgrade Jul 23, 2020
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Jul 24, 2020

For this isssue lets take a very simple simple approach.

  • In the image stash OTOBO in /var/otobo/otobo_next

  • Use /var/otobo/entrypoint.sh as entry point

  • use /var/otobo/otobo_next/docker_first_time as a guard for a restarted container. This might happen when a container is saved and started again.

  • Copy otobo_next when /opt/otobo is empty

  • Maybe backup of /opt/otobo, Decision: maybe in 10.0.3

  • Or overwrite /opt/otobo when the version is incremented

  • Reinstall packages

@bschmalhofer bschmalhofer changed the title Docker: add support for minor version upgrade Docker: add support for a patchlevel version upgrade Jul 24, 2020
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 10.0.2 Jul 24, 2020
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Jul 24, 2020

Here are some testcases:

  • start with empty volume /opt/otobo. Expected: upgraded, Result: OK

  • new container with same RELEASE number. Expected: not upgraded, Result: OK

  • new container with lower release Number. Expected: not upgraded, Result OK

  • new container with higher release Number. Expected: upgraded

  • in all cases: first time was handled

  • /var/otobo/entrypoint.sh is updated

  • Daemon starts reliably, after the next 5 minute mark is ok when image is upgraded

@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Jul 24, 2020

More issues:

  • ReInstallAllPackages gives an access denied for the DB user otobob. Solution: installer.pl was not run in that case

  • version sorting with letters in version number. What is the policy on the RELEASE file ? Solution: The release is set in the commit with the release tag

  • add command for forcing a patchlevel upgrade

  • Simplify the Dockerfile by moving funtionality into set_permissions.pl

  • Document how to do the upgrade Solution: README.md was enhanced

  • /var/otobo/ is confusing. Let's try /opt/otobo_install

  • Start the OTOBO Daemon only when /opt/otobo_install/otobo_next/docker_firsttime is handled

  • No automatic upgrades when the version contains something besided digits and dots

bschmalhofer added a commit that referenced this issue Jul 24, 2020
Also use exec consistently.
Also support fallback for running other commands.
bschmalhofer added a commit that referenced this issue Jul 27, 2020
Act more like the Perl cmp operator.
Requires that none of the versions match [^0-9.].
bschmalhofer added a commit that referenced this issue Jul 27, 2020
Avoid the unnessary step of copying from /opt/otobo/ to /var/otobo/otobo_next.
set_permissions.pl now takes the param '--dir' with the default '.'.
No need to use FindBin.
Rename some vars.
Put some vars into a tighter scope.
bschmalhofer added a commit that referenced this issue Jul 27, 2020
In the end use /opt/otobo as working dir again.
bschmalhofer added a commit that referenced this issue Jul 27, 2020
bschmalhofer added a commit that referenced this issue Jul 27, 2020
Just a sentiment that working as root should be minimised.
bschmalhofer added a commit that referenced this issue Jul 27, 2020
Avoid duplicated code.
bschmalhofer added a commit that referenced this issue Jul 27, 2020
/var/otobo looks to much like data that must be kept
@bschmalhofer
Copy link
Contributor Author

Looks mostly fine now. More testing does not hurt.

bschmalhofer added a commit that referenced this issue Jul 28, 2020
Issue #203: ignore hidden file when checking whether /opt/otobo is empty
@bschmalhofer
Copy link
Contributor Author

Tested again by creating an image with version number 11.0.1. Worked as expected. Closing.

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

No branches or pull requests

1 participant