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

fix(dockerfile): podman compose compatibility with BUILDPLATFORM #31489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nktnet1
Copy link

@nktnet1 nktnet1 commented Dec 17, 2024

SUMMARY

Fixes #31488.

Using a different variable, TARGET_BUILDPLATFORM, inside the Dockerfile to avoid name conflict/redefining BUILDPLATFORM which is an issue in podman.

ARG TARGET_BUILDPLATFORM=${BUILDPLATFORM:-amd64}

TESTING INSTRUCTIONS

Run the command

podman compose -f docker-compose-non-dev.yml up --build

and observe that the error

Error: reading multiple stages: attempted to redefine "BUILDPLATFORM": invalid argument

Is no longer there.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@nktnet1 nktnet1 changed the title fix: podman compose compatibility with BUILDPLATFORM fix(dockerfile): podman compose compatibility with BUILDPLATFORM Dec 17, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@sfirke
Copy link
Member

sfirke commented Dec 17, 2024

This looks good to me, thanks for contributing it! Is there a risk / what size risk of breaking changes for someone who uses the current variable name in a workflow? If significant, I would say let's merge this during the upcoming breaking window (I think it would be excessive to say this requires a vote). If not, we can merge now IMO.

@@ -21,12 +21,12 @@
ARG PY_VER=3.10-slim-bookworm

# If BUILDPLATFORM is null, set it to 'amd64' (or leave as is otherwise).
ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64}
ARG TARGET_BUILDPLATFORM=${BUILDPLATFORM:-amd64}
Copy link
Member

Choose a reason for hiding this comment

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

would ARG TARGET_BUILDPLATFORM=${TARGET_BUILDPLATFORM:-${BUILDPLATFORM:-amd64}} be better? - haven't tested it?

I think it would provide a default if somehow both TARGET_BUILDPLATFORM and BUILDPLATFORM are not in context.

Copy link
Author

@nktnet1 nktnet1 Dec 17, 2024

Choose a reason for hiding this comment

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

Thanks @mistercrunch - I can confirm that it does work, although I'm not sure if it's necessary. TARGET_BUILDPLATFORM was just a name I made up with the sole reason being that it's a different name to BUILDPLATFORM. Apologies if I've misunderstood though. Happy to make the change regardless

Copy link
Member

Choose a reason for hiding this comment

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

oh why can't you use BUILDPLATFORM?

Copy link
Author

@nktnet1 nktnet1 Dec 19, 2024

Choose a reason for hiding this comment

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

From #31488 - podman gives this error:

image

@mistercrunch
Copy link
Member

I did a bit of research and this should not be an issue AFAICT. Especially if BUILDPLATFORM is always in context.

Looked a bit into podman, seems interesting but not sure whether it'd be beneficial for us to use as our build engine.

@mistercrunch
Copy link
Member

Still on the fence but would require a line in UPDATING.md to notify release managers.

@nktnet1
Copy link
Author

nktnet1 commented Dec 19, 2024

Thanks @mistercrunch (and @sfirke) - it doesn't look like podman is that widely used by users of apache/superset anyway (I only found 1-2 posts on it) so I'm happy to let this sit until more users are using podman + running into the issue (or just close the PR) and work off a fork.

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

Successfully merging this pull request may close these issues.

[Bug] redefining BUILDPLATFORM when using Podman
3 participants