-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
feat: docker-compose to work off repo Dockerfile #27434
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset:${TAG:-latest} | ||
x-superset-depends-on: &superset-depends-on | ||
- db | ||
- redis | ||
|
@@ -23,6 +22,12 @@ x-superset-volumes: | |
- ./docker:/app/docker | ||
- superset_home:/app/superset_home | ||
|
||
x-common-build: &common-build | ||
context: . | ||
target: dev | ||
cache_from: | ||
- apache/superset-cache:3.9-slim-bookworm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I was not aware of this, what process pushes to it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anything that uses Docker-compose can piggy backing on this cache here that should really speed up the builds since in most case most layers can be re-used from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. side note - one thing I noticed is cache doesn't always seem to hit when I think it should, I'm guessing that we have some limits / intelligent cache pruning that's preventing cache hit from always working .... cache hit rate is still pretty decent, and build times not awful either when missing the cache |
||
|
||
version: "3.7" | ||
services: | ||
redis: | ||
|
@@ -43,7 +48,8 @@ services: | |
|
||
superset: | ||
env_file: docker/.env-non-dev | ||
image: *superset-image | ||
build: | ||
<<: *common-build | ||
container_name: superset_app | ||
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"] | ||
user: "root" | ||
|
@@ -54,8 +60,9 @@ services: | |
volumes: *superset-volumes | ||
|
||
superset-init: | ||
image: *superset-image | ||
container_name: superset_init | ||
build: | ||
<<: *common-build | ||
command: ["/app/docker/docker-init.sh"] | ||
env_file: docker/.env-non-dev | ||
depends_on: *superset-depends-on | ||
|
@@ -65,7 +72,8 @@ services: | |
disable: true | ||
|
||
superset-worker: | ||
image: *superset-image | ||
build: | ||
<<: *common-build | ||
container_name: superset_worker | ||
command: ["/app/docker/docker-bootstrap.sh", "worker"] | ||
env_file: docker/.env-non-dev | ||
|
@@ -81,7 +89,8 @@ services: | |
] | ||
|
||
superset-worker-beat: | ||
image: *superset-image | ||
build: | ||
<<: *common-build | ||
container_name: superset_worker_beat | ||
command: ["/app/docker/docker-bootstrap.sh", "beat"] | ||
env_file: docker/.env-non-dev | ||
|
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.
I personally think it's kind of cool to have
non-dev
point to a pre built image TAG, also this docker-compose does not mount current code into the container likedocker-compose.yaml
does, so non deterministic cases probably do not apply on this case.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.
About this, I think both use cases are valid. To me if I'm in a repo and on a specific ref (a branch, a release tag, or my own little branch with a feature), and I run some docker-related thing (whether it's
docker build
or adocker-compose
related thing) I'm assuming that what I'm building is the particular ref I'm into right now.I think the 2 options I want to provide here are really just "interactive" where we mount the code, and "non-interactive" where it's just immutable set of dockers that get me a fully working testable cluster that is lined up with the branch.
Now maybe we should ADD a new way to do
docker-compose-any-image.yml
that would work along with a TAG env var.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.
fine by me! makes sense
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.
ok, I'm making a bunch of changes here and re-writing the docs too...