-
Notifications
You must be signed in to change notification settings - Fork 93
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
Move to docker_compose_v2 action #240
Conversation
The docker_compose (v1) action has been deprecated, and the v2 version includes important bug fixes.
I see that PR #237 already has the change to |
Are there any backwards compatibility issues with the v2 method on older versions of Python/docker-compose (EX, those on LTS releases)? This needs more consideration, I think. (Find the RHEL guy 😅) |
Good question, I was wondering this myself. If I get a chance I'll try it out on a VM or something. I would expect the risk to be low, however, since the community.docker project as a whole is moving forward on the v2 method and apparently not fixing Python compatibility issues in the deprecated v1 method. |
Here's the deprecation commit, by the way: ansible-collections/community.docker@30faf0b Looks like they're aiming at removing it in the 4.0.0 release, and since it's currently at 3.9.0 it sounds like v1 will go away completely soon. |
I want to ensure this doesn't break our existing compatibility matrix. If it does, we should re-evaluate how this is approached instead of mindlessly updating the usage. It could break the usage for most installations that are not running the latest release of the supported distributions. We need to be less flippant. |
Digging a little more, it looks like the problem was in |
I can find some time tonight to test against the normal spread of distributions/versions to see if this is a breaking change or not. My concern is we have no testing on these playbooks, so it's very easy to break them for other people while fixing them for your specific distribution/version. Until we can get some Molecule magic going (I had some issues with docker-in-docker and testing these playbooks last year..), we need to be more diligent in these kinds of changes. |
I'm with you on ensuring backward compatibility, and I was just noting that the |
I apologize! I wasn't calling you flippant. I said "we" to refer to every contributor, as we're all guilty of it. We've been trying to clean up everything this past year, so I'm cautious not to take two steps back accidentally. We are very merge happy. We NEED and WANT all of the contributors possible! TL;DR Thank you, and you're not wrong; I'm just an asshole 😁. |
It looks like the root@cody-foss-test:~# cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)" TASK [Start docker-compose] ***************************************************************************
[WARNING]: /srv/lemmy/foss.ly/docker-compose.yml: `version` is obsolete
[WARNING]: Cannot parse event from line: 'error getting credentials - err: exit status 1, out:
`GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not
provided by any .service files`'. Please report this at https://github.com/ansible-
collections/community.docker/issues/new?assignees=&labels=&projects=&template=bug_report.md
fatal: [foss.ly]: FAILED! => {"actions": [{"id": "pictrs", "status": "Pulling", "what": "service"}, {"id": "lemmy-ui", "status": "Pulling", "what": "service"}, {"id": "proxy", "status": "Pulling", "what": "service"}, {"id": "lemmy", "status": "Pulling", "what": "service"}, {"id": "postgres", "status": "Pulling", "what": "service"}, {"id": "postfix", "status": "Pulling", "what": "service"}], "changed": false, "cmd": "/usr/bin/docker compose --ansi never --progress plain --project-directory /srv/lemmy/foss.ly up --detach --no-color --quiet-pull --pull always --remove-orphans --", "containers": [], "images": [], "msg": "Return code 1 is non-zero", "rc": 1, "stderr": "time=\"2024-05-08T01:41:57Z\" level=warning msg=\"/srv/lemmy/foss.ly/docker-compose.yml: `version` is obsolete\"\n pictrs Pulling \n lemmy-ui Pulling \n proxy Pulling \n lemmy Pulling \n postgres Pulling \n postfix Pulling \nerror getting credentials - err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files`\n", "stderr_lines": ["time=\"2024-05-08T01:41:57Z\" level=warning msg=\"/srv/lemmy/foss.ly/docker-compose.yml: `version` is obsolete\"", " pictrs Pulling ", " lemmy-ui Pulling ", " proxy Pulling ", " lemmy Pulling ", " postgres Pulling ", " postfix Pulling ", "error getting credentials - err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files`"], "stdout": "", "stdout_lines": []} I wouldn't put a lot of money on there being a lot of users using these playbooks on Debian 10. We could probably drop support for this pretty painlessly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to merge this sooner rather than later, we should probably drop support for Debian 10 as it is a breaking change, and I don't think we realistically need to support it any longer.
If everyone is okay with that, would you mind updating the README.md
to drop Debian 10
from the support matrix (https://github.com/LemmyNet/lemmy-ansible/blob/main/README.md?plain=1#L22)?
@ticoombs @dessalines @Nutomic Are you folks aware of any operators using Debian 10
(or even 11
, for that matter)?
I dont know anything about OS versions people are using. Anyway Debian 10 was released in 2019 and hasnt received security updates since 2022, so it sounds fine to discontinue support. |
Absolutely not, if anything I most likely misread you. And at this moment in time anyone of any conscience is, to put it extremely mildly, rather "on edge"... well, best not get distracted when we have work to do. |
@jlandahl would you mind updating this PR to remove Debian 10 from the README? We can then safely merge this, I believe. |
Will do. |
Quick question. My new install was on Ubuntu 24.04, and with the |
Considering it’s the latest version of Ubuntu LTS, it’s not going anywhere and will likely be the primary distribution people install this on down the road. The containers are doing the heavy lifting, so I don’t think there are any concerns on my end. I’d be in favor of adding official support for 24.04. |
Just throwing in my opinion, replacing
|
I'd be happy to work through these issues. My Ansible knowledge is rusty, but I used to use it extensively years ago so I should be able to catch up. I installed it recently via I'll add a section in the readme on Ansible itself with a brief word on what it is, why it's useful, and notes on installation. I think this would be helpful anyway, since it would give important context to people wanting to setup Lemmy that are unfamiliar with Ansible and why it's being used as a layer above Docker Compose. |
On fixing Woodpecker, I see it's currently installing Ansible via |
this isn't entirely accurate. debian is an LTS distro, and there is a separate team taking care of security updates beyond the regular lifecycle: https://wiki.debian.org/LTS debian 10 still receives LTS security updates for a few more months, until June 30th, 2024. this would only be cutting support short by less than 2 months though, so i don't think this should be an issue. |
That should be sufficient.
Similar to CentOS 7--the EOL is around the same time 😁. I think this is fine to discontinue support on. |
Woodpecker is happy now, but there are some warnings that look a little suspicious. Could someone more familiar with things take a look at this?
|
.woodpecker.yml
Outdated
- apk add pipx | ||
- pipx install --include-deps ansible | ||
- export PATH=/root/.local/bin:$${PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- apk add pipx | |
- pipx install --include-deps ansible | |
- export PATH=/root/.local/bin:$${PATH} | |
- export PATH=/root/.local/bin:$${PATH} | |
- apk add pipx | |
- pipx install --include-deps ansible |
this just gets rid of the warning during pipx install
about the bin path not being in $PATH
, but it doesn't really affect the outcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I had considered this at some point, but then didn't get to it.
.woodpecker.yml
Outdated
- apk add pipx | ||
- pipx install --include-deps ansible ansible-lint | ||
- export PATH=/root/.local/bin:$${PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- apk add pipx | |
- pipx install --include-deps ansible ansible-lint | |
- export PATH=/root/.local/bin:$${PATH} | |
- export PATH=/root/.local/bin:$${PATH} | |
- apk add pipx | |
- pipx install --include-deps ansible | |
- pipx inject --include-deps ansible ansible-lint |
same as above, moving $PATH
to the start gets rid of the warning during pipx install
about the bin path not being in $PATH
, but it doesn't really affect the outcome.
the main change is not installing both ansible
and ansible-lint
in the same pipx
execution.
I haven't used pipx before, but using it this way creates a venv for every package. this results in the ansible-lint
venv not having the packages that exist in the ansible
venv. pipx inject
seems to be just what we are looking for for this to install ansible-lint
into the same venv as ansible
.
the result is a clean woodpecker test: https://wpci.lem.rocks/repos/3/pipeline/19/5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, once @codyro takes a look, we can merge.
it's not good to merge, only the part that didn't affect the actual test was applied from my suggestions. |
@Nothing4You could you do either a PR to this one, or possibly a separate PR to main? |
both options are available now: |
Thx @Nothing4You ! We can close this as its functionality is merged now in #244 |
As detailed in #239, the
community.docker.docker_compose
action from the community.docker Ansible collection has been deprecated in favor ofcommunity.docker.docker_compose_v2
.This was discovered while debugging a problem running the
lemmy.yml
playbook on an Ubuntu 24.04 system with Python 3.12, which broke during thedocker_compose
step due to an incompatibility with a newer version ofurllib3
(docker/docker-py#3113). The problem was fixed, but apparently only in thedocker_compose_v2
action. The result is that the deprecateddocker_compose
action doesn't work with newer versions of Python, butdocker_compose_v2
does.This PR is a simple change to
lemmy.yml
to usedocker_compose_v2
. One minor incompatibility is addressed by changing thepull
parameter fromtrue
toalways
, sincev2
changed it from a boolean to a string with the possible values of "always", "missing", "never", and "policy" (documented here). The value "missing" might be fine as well, but "always" seemed like a safe value to use.