Skip to content

feat(install): Adds support for podman(compose) #3673

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

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

DuncanConroy
Copy link

Adds support for podman(compose), while maintaining compatibility with docker

Introduces a new script to detect podman vs. docker. Distinguishes between docker and podman minimum versions and substitutes uses of docker with a variable instead.

Closes #369

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite surprised (positively!) that the changes needed are so few! Added a few comments and on top of those, we definitely should have a test using podman now to make sure this actually works and does not break in the future (can help with this if you need me).

Thanks so much for taking the effort!

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry meant the require changes 😅

@BYK
Copy link
Member

BYK commented Apr 22, 2025

FYI tests failed with the following error:

Detecting Docker platform
FAIL: Unsupported docker architecture amd64.

@DuncanConroy
Copy link
Author

Quite surprised (positively!) that the changes needed are so few! Added a few comments and on top of those, we definitely should have a test using podman now to make sure this actually works and does not break in the future (can help with this if you need me).

Thanks so much for taking the effort!

I agree that having a test would be great. In the best case, we can run the whole suite for both docker and podman. I'm just unsure about the environment this is run on and would welcome your input and ideas very much!

@DuncanConroy DuncanConroy marked this pull request as draft April 23, 2025 13:03
@DuncanConroy
Copy link
Author

Have converted back to draft, as there are some tweaks to make, still.

@aldy505
Copy link
Collaborator

aldy505 commented Apr 23, 2025

@DuncanConroy Let us know if you need help in terms of anything, we'd be happy to help you. Having this PR really made us happy :)

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are run on GitHub Actions. I'm happy to add a new job that installs and runs with podman once the PR is stable in terms of API

@@ -29,6 +29,8 @@ Options:
--no-report-self-hosted-issues
Do not report error and performance data about your
self-hosted instance upstream to Sentry.
--container-engine-podman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: how about this just being --container-engine with a default value of docker?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand your intent. This was thought as a switch to activate podman over docker. We can surely remove the autodetection and completely rely on this switch. I'd still keep it --container-engine-podman, because just using --container-engine would possibly be misleading?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DuncanConroy sorry for not being clearer. What I had in mind was making --container-engine a flag to pass in a custom value as in --container-engine <engine> where we default to docker (so when the flag is not passed, we will assume docker).

Although we would only support podman and docker at start, this should keep the API unchanged if we ever add new engines like runc or similar.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to do this with bash, tbh. :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see what I can do about this 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is quite simple... unless you want to validate argument :)
Something like

  case "$1" in

<...>

  --container-engine) CONTAINER_ENGINE="$2"; shift ;;

Copy link
Collaborator

@aminvakil aminvakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

sentry-admin.sh file needs to be fixed as well, I guess adding source install/detect-container-engine.sh suffices.

@BYK
Copy link
Member

BYK commented May 7, 2025

Okay, now we need to make the tests aware of Podman

@doc-sheet
Copy link
Contributor

If podman-comose compatible enough podman-docker package could help.
It creates system-wide alias docker -> podman

@aldy505
Copy link
Collaborator

aldy505 commented Jun 11, 2025

Okay, now we need to make the tests aware of Podman

@BYK do you still remember what you mean by this?

@BYK
Copy link
Member

BYK commented Jun 11, 2025

@aldy505 the tests written in Python assume everything with Docker and Docker Compose. They now need to be aware of what technology we're using. See the fail here: https://github.com/getsentry/self-hosted/actions/runs/14893466765/job/41831036774?pr=3673#step:4:2280

@aldy505
Copy link
Collaborator

aldy505 commented Jun 13, 2025

@DuncanConroy FYI, I'll revisit this after 25.6.0 release, since it has too much big changes already 😆

@doc-sheet
Copy link
Contributor

doc-sheet commented Jun 22, 2025

UPD. Nevermind it's incomplete yet

Hi!
Here is rough workaround for tests https://github.com/doc-sheet/self-hosted/compare/podman-tests-base...doc-sheet:self-hosted:podman-tests?expand=1#files

Since podman works without root privileges

  • it requires nofile ulimits for current user higher then limits declared for containers
  • chown don't work

Additional notes for future me:

  • separate caches
  • conflicting ports

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

@doc-sheet do you wanna work on the tests? We can merge this PR first, then when it's on master you can submit your PR for podman tests.

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

Why is this broken..

Ensuring correct permissions on profiles directory ...

Executing external compose provider "podman-compose". Please refer to the documentation for details. <<<<

WARNING:podman_compose:missing services [vroom]
Error: executing podman-compose --no-ansi --env-file .env --in-pod=false run --rm --no-deps --entrypoint /bin/bash --user root vroom -c chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles: exit status 1
Error in install/ensure-correct-permissions-profiles-dir.sh:6.
'$dcr --no-deps --entrypoint /bin/bash --user root vroom -c 'chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles'' exited with status 1
yes: standard output: Broken pipe
yes: standard output: Broken pipe
-> ./install.sh:main:41
--> install/ensure-correct-permissions-profiles-dir.sh:source:6

@doc-sheet
Copy link
Contributor

Why is this broken..

because podman is rootless, :U is a workaround which works with docker-compose too I suppose

do you wanna work on the tests? We can merge this PR first, then when it's on master you can submit your PR for podman tests.

well I'm trying to make tests pass, but don't have much time this days to research.
I'm stuck with nofile restriction and can't figure it out how to increase limit in github action runner.

I don't think it is ready to be merged because of new changes like chown.
But if install works and it is ok to skip podman tests until complete fix I'm totally fine with it.

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

Interesting, it didn't try to pull vroom at all

>>>> Executing external compose provider "podman-compose". Please refer to the documentation for details. <<<<
  Resolving "nginx" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/library/nginx:1.25.4-alpine...
  Trying to pull registry.gitlab.com/egos-tech/smtp:latest...
  Resolving "memcached" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/library/memcached:1.6.26-alpine...
  Resolving "getsentry/symbolicator" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/getsentry/symbolicator:nightly...
  Resolving "getsentry/snuba" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/getsentry/snuba:nightly...
  Resolving "confluentinc/cp-kafka" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/confluentinc/cp-kafka:7.6.1...
  Resolving "getsentry/taskbroker" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/getsentry/taskbroker:nightly...
  Resolving "postgres" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/library/postgres:14.11...
  Trying to pull docker.io/getsentry/relay:nightly...
  Resolving "redis" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/library/redis:6.2.14-alpine...
  ...truncated...
  Resolving "getsentry/sentry" using unqualified-search registries (/etc/containers/registries.conf)
  Trying to pull docker.io/getsentry/sentry:nightly...
  ...truncated...

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

do you wanna work on the tests? We can merge this PR first, then when it's on master you can submit your PR for podman tests.

well I'm trying to make tests pass, but don't have much time this days to research. I'm stuck with nofile restriction and can't figure it out how to increase limit in github action runner.

what is "nofile restriction"?

I don't think it is ready to be merged because of new changes like chown. But if install works and it is ok to skip podman tests until complete fix I'm totally fine with it.

okay 👍

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

do you wanna work on the tests? We can merge this PR first, then when it's on master you can submit your PR for podman tests.

well I'm trying to make tests pass, but don't have much time this days to research. I'm stuck with nofile restriction and can't figure it out how to increase limit in github action runner.

what is "nofile restriction"?

ah you mean nofile limits on linux..

@aldy505
Copy link
Collaborator

aldy505 commented Jun 25, 2025

Ah I see the problem now. vroom is behind feature-complete profiles, yet podman only supports passing in the --profile arg. Setting the environment variables does nothing basically. Refer to this PR containers/podman-compose#592

@doc-sheet
Copy link
Contributor

Another bug in podman-compose containers/podman-compose#1118 I stepped on.

@aldy505
Copy link
Collaborator

aldy505 commented Jun 26, 2025

ughh I wanna skip the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Support Podman (and Podman Compose)
5 participants