Docker support - #14
Conversation
…teagent-pkg into docker-support merging socket changes to new pipeline feature
| curl -LO https://github.com/aktin/docker-aktin-dwh/releases/latest/download/compose.yml | ||
| sudo docker compose pull | ||
| sudo docker compose up -d | ||
| #sudo docker image prune -f |
There was a problem hiding this comment.
Why is this line commented out but still in the file?
There was a problem hiding this comment.
This line is declared optional inside our manual. I was not sure if we should automate the pruning of the old images, especially if the update fails and we are forced to fall back on the older images. What is your opinion about this?
There was a problem hiding this comment.
Commented-out code should be removed. No execptions
| SocketUser=wildfly | ||
| SocketGroup=wildfly |
There was a problem hiding this comment.
Whats the reason to remove the user wildfly here??
There was a problem hiding this comment.
With the wildfly user set, the update agent depends on the wildfly user existing, when creating the sockets, which happens in the postinstall step. Say we install update agent on a host only containing docker DWHs, there exists no user called wildfly on the host. Therefore update agent install terminates early with an error.
I opened another issue on that #7
| log_success "Wildfly permissions set successfully" | ||
| #save_array() { | ||
| # local arr="$1" | ||
| # local var_name="$2" |
There was a problem hiding this comment.
never leave commented out code in the pr
| CLEANUP=false | ||
| SKIP_BUILD=false | ||
| FULL_CLEAN=false | ||
| update_dir="/var/lib/aktin/update" |
There was a problem hiding this comment.
globals uppercase and readonly if immutable
| exit 1 | ||
| fi | ||
|
|
||
| cat <<EOF > "summary_aktin-updateagent_preinstall.txt" |
There was a problem hiding this comment.
This summary file is broken in three ways:
- The heredoc lines are indented and quoted, so the file contains
"debian_installed=0"literally. Sourcing it later producescommand not foundinstead of a variable assignment. - It is written to a relative path, so it lands in dpkg's working directory (usually
/) and is never cleaned up. - An exit status of 0 means installed, so the file records
debian_installed=0for an installed DWH, which reads as false.
| log_info "debian dwh status: $debian_status" | ||
| log_info "docker dwh status: $docker_status" | ||
|
|
||
| if ! is_installed_debian && ! is_installed_docker; then |
There was a problem hiding this comment.
Two issues here:
- Aborting installation contradicts the README, which states the base package installs without a DWH instance. It also breaks apt install ordering, installing the agent before the DWH becomes impossible. Failing preinst on a missing runtime environment is against Debian packaging practice. I would keep the package installable and no-op instead.
is_installed_debianandis_installed_dockerare called a second time here even though their results were already captured indebian_statusanddocker_statusabove
|
|
||
| # Requirement: Any kind of dwh has to be installed | ||
| is_installed_debian() { | ||
| if systemctl list-unit-files | grep -q "wildfly"; then |
There was a problem hiding this comment.
grep -q "wildfly" matches any unit whose name contains the substring. DEBIAN_SERVICE is declared on line 17 but never used...
| sudo apt-get install -f # Install missing dependencies if any | ||
| ``` | ||
|
|
||
| The base package installs without requiring an AKTIN DWH instance. Instance-specific runtime setup is handled separately: |
There was a problem hiding this comment.
This section contradicts the implementation in three places:
- It says the base package installs without a DWH instance, but preinst aborts in exactly that case.
- It says
socket-setup configureis a separate manual step, but postinst calls it automatically. - It says the helper applies wildfly ownership, but that code is commented out.
| - `info`: Contains current and candidate version information | ||
| - `log`: Update execution logs | ||
| - `result`: Update execution results with success status | ||
| - `docker-info`: Placeholder output for Docker version information |
There was a problem hiding this comment.
docker-info and docker-result do not match the implementation, the docker services write info and result into the docker volume's update directory.
| curl -LO https://github.com/aktin/docker-aktin-dwh/releases/latest/download/compose.yml | ||
| sudo docker compose pull | ||
| sudo docker compose up -d | ||
| #sudo docker image prune -f |
There was a problem hiding this comment.
Commented-out code should be removed. No execptions
| docker_wait_for_deployment "$wildfly_container" | ||
| successful="$(docker_post_update_validation $wildfly_container $update_dir)" | ||
|
|
||
| $(journalctl -u 'aktin-notaufnahme-updateagent-docker*' -f) > $update_dir/log |
There was a problem hiding this comment.
Additionally, the unit name is hardcoded instead of using __PACKAGE_NAME__
| # require_wildfly_user | ||
| # require_systemd |
AKTIN update agent supports upgrading docker DWHs. Mainly added 2 new sockets for update requests from the new DWH backend aktin/dwh-admin@master...docker-update-extension. These sockets are called over an internal Gateway added to the compose.yml file in this PR: aktin/docker-aktin-dwh@main...docker-update-extension