How do we manage versions of apps? #34
Labels
No Label
abra
abra-gandi
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
democracy
design
documentation
duplicate
enhancement
finance
funding
good first issue
help wanted
installer
kadabra
performance
proposal
question
recipes.coopcloud.tech
security
test
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/organising#34
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now that https://git.autonomic.zone/coop-cloud/organising/issues/33 is out, I'd like to see that we have a version field in the package.yml or whatever it will be. How do we deal with that?
Do we maintain our own version number? Or do we rely on the version of the docker image? We'll probably be hacking away furiously on the app configs, so I think maintaining our own semver makes sense. Then somehow tagging the stack when deployed? Abra can then do a compare later to check if an upgrade is needed?
Thoughts?
Pro-posal:
${UPSTREAM_VERSION}_${OUR_VERSION}
, e.g. Wordpress5.5.1_0.1
? Fine with just using our own version tho.Yeah good plan, unsure the best way to do store stack-level metadata, will research unless you get there first.
We ran into this with TSA: coop-cloud/nextcloud had updated so we ended up with an unexpected upgrade when we ran
abra app nextcloud.third... deploy
. This also highlighted that we didn't get notified of the available Nextcloud update before.I think we should manually add the image tag to the
abra.sh
for the app version. So, for mediawiki, we've addexport APP_VERSION=1.35.1
. Then abra can look that up and compare with the deployed container image tag and show a difference. We can also just use the latest commit of the app repo too to keep things simple. So, when you ask for a version of an app, you get the image tag and the commit.Also, I have a suspicion that the images are getting overwritten by some upstreams. So, it would be good know which hash as well as the image tag we are deploying. Sometimes you think you are deploying the same tag but the upstream has overwritten it and things can break. We need to warn in those cases.
Some notes from the chat:
I've been thinking about it. wondering if whacking
ABRA_TYPE_VERSION=<upstream_tag>_<short upstream hash>_<our version>
might be a good start?we could use https://docs.docker.com/engine/reference/commandline/tag/ to create that scheme when deploying? Then pull it apart when we want to show it on the CLI via abra maybe enough to have deploy make a version check with an existing tagged container and current state to-be-deployed and then make a warning. The warning could be chill if we see some commit bump in the app or pretty critical when we see a major upgrade on the image tag
I could get the two values out fairly easily:
git rev-parse --short HEAD
docker image inspect $(docker image ls -q -f reference=mediawiki) --format "{{ .Config.Image }}"
But as for the upstream tag, it seems that when I run
docker image ls
, none of my local images have tags! Some of them do, but mostly not. I guess that isn't something we can rely on then. It seems to be sometimes available from the running container but we won't always have a running container. We might have to manually specify this then ourselves.(I haven't really looked into this before so if anyone sees a way, please shout)
Thinking to maybe just manually specify everything on the image for now! Probably the most reliable. So, we might have a diff like this for the Gitea app then.
Which I ripped from https://hub.docker.com/layers/gitea/gitea/1.13.2/images/sha256-2f0fdcfc5131f390cf88dad3ea8e1c98432e4514963383dae6964b98196ffada?context=explore.
My only doubt at this point is that with the
COMMIT
value, the end-user can't tell if we're doing a breaking update from the actual app repo config files. For example, if we change an env var name or something. So, I am thinking of doing semver for that also. Which will be manually controlled also.I think each app will need a changelog as well, which is fine. So the end-user will see two versions, the upstream tag and repo semver. We'll tuck the digest of the image into the implementation details and only do warnings when we suspect something.
I'll try to implement this for the Gitea repo is complicated enough to test it.
Looking at YunoHost again, I see they just use the actual shipped app version as their own version so maybe we should just do that also because they have thousands of users and that seems to work for them. See
ee18542f4b/manifest.json (L9)
.I'll just go with the tag and the digest then. For breaking changes in the app repo we can just rely on the change log and document this heavily.
I seem to have misunderstood tags, we need to instead use labels to add metadata on the containers https://docs.docker.com/config/labels-custom-metadata/. We can deploy the stack and then run a
docker service update --label-add
on the_app
service to mark it. We apparently need to use some reverse DNS convention likecoop-cloud.gitea.1.35.1.2f0fdcf
where it goes like<project>.<app-type>.<app-version>.<app-digest>
Progress! So, we can just use the existing label mechanism in the compose file.
Then, when you deploy that app, you can run:
And this will show a whole bunch of stuff, but mainly:
Where
"coop-cloud.gitea.version": "1.35.1.2f0fdcf"
is what we need.You can get that out directly with the following:
🚀
OK, so, I think the answer to this is basically do
c145440355/compose.yml (L59)
for all the apps and that is how we will do versioning! I'm gonna open up tickets for further support for thisabra
and close this off.If any future travellers get stuck at the same place I did -- to add
ABRA_TYPE_VERSION
andABRA_TYPE_DIGEST
:ABRA_TYPE_VERSION
DOCKER_CONTEXT
):docker image ls
docker image inspect <imageid> -f "{{ .Id }}"
Then use the first 8 characters of that hash.