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(docker): error around missing requirements/base.txt #27608

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Mar 21, 2024

SUMMARY

I'm unclear on why exactly CI succeeded while this was an issue running
locally. I'm guessing it has to do with --mount and how it works
around caching, so I'm moving to a COPY-based approach, which is more
standard and easy to reason about. It also leaves a useful artefact on
the machine as to how it was built. It does add a tiny layer and payload
on the image, but it's super cheap for the utility/introspection it provides.

Closes #27606


I found the issue as to why this defect in the dockerfile wasn't caught in CI, it's because the --preset dev parameter was not getting passed down properly, and resulting in targeting the lean layer, avoid that issue altogether. I fixed supersetbot, added unit tests and published a new version on npm.

TESTING/VALIDATION

tested docker-compose up and validated that CI is now building the right target as opposed to always be building the lean target.

Closes #27606

I'm unclear on why exactly CI succeeded while this was an issue running
locally. I'm guessing it has to do with `--mount` and how it works
around caching, so I'm moving to a COPY-based approach, which is more
standard and easy to reason about. It also leaves a useful artefact on
the machine as to how it was built. It does add a tiny layer and payload
on the image, but it's super cheap for the utility/introspection it provides.
Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

I'll admit I had GPT walk me through some of this, but it seems like it all ought to be fine from what I/we can tell.

@mistercrunch mistercrunch merged commit 6f3afab into master Mar 21, 2024
26 checks passed
@mistercrunch mistercrunch deleted the fix_docker_base branch March 21, 2024 19:23
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@guizsantos
Copy link

I think the issue here was that requirements/development.txt references requirements/base.txt and since base.txt is mounted during runtime, it is not available when the second pip install is running. I believe adding --mount=type=bind,target=./requirements/base.txt,src=./requirements/base.txt \ in addition to the development.txt mount fixes the issue. I liked the mount base approach, much prefer it over the COPY-based one.

@mistercrunch
Copy link
Member Author

Oh right, totally, that was the issue.

Originally in my PR I was confused as to why CI didn't fail / catch this issue in the first place which I found along the way and commented on the PR body ->

I found the issue as to why this defect in the dockerfile wasn't caught in CI, it's because the --preset dev parameter was not getting passed down properly, and resulting in targeting the lean layer, avoid that issue altogether. I fixed supersetbot, added unit tests and published a new version on npm.

@xyy94813
Copy link

Hi,
I want to confirm if this PR fixes follow bug in CI of my PR??

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements/testing.txt'

https://github.com/apache/superset/actions/runs/8235126931/job/22862070545?pr=26180

@mistercrunch
Copy link
Member Author

@xyy94813 rebase and you should be fine

EandrewJones pushed a commit to UMD-ARLIS/superset that referenced this pull request Apr 5, 2024
EnxDev pushed a commit to EnxDev/superset that referenced this pull request Apr 12, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io size/M 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem Building dev Docker image
4 participants