You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "alekseyolg (via GitHub)" <gi...@apache.org> on 2023/09/26 17:40:21 UTC
[GitHub] [superset] alekseyolg opened a new pull request, #25422: feat(docker): speed up your build using caching
alekseyolg opened a new pull request, #25422:
URL: https://github.com/apache/superset/pull/25422
### SUMMARY
Speed up your build using caching. Caching will prevent you from rebuilding all the layers that are already in Dockerhub.
https://docs.docker.com/engine/reference/commandline/buildx_build/
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341572149
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
The new cache will only be uploaded to Dockerhub after the doc is added to the master branch. Tests for pull requests will be collected much faster due to the presence of a cache, since only what has changed will need to be collected. Thus, this will significantly increase the speed of building the image and will allow you to use the ARM64 architecture for supersets in the future, as I tried and the current image based on the ARM64 architecture takes more than an hour to build due to the fact that many libraries need to be compiled, unlike AMD64. Or we switch to using the arm64 architecture and wait for all tests to complete for approximately 1.25 hours, which in my opinion is too long.
Actually, because of this, I came up with the idea of giving the superset to use the cache for assembly.
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
The new cache will only be uploaded to Dockerhub after the doc is added to the master branch. Tests for pull requests will be collected much faster due to the presence of a cache, since only what has changed will need to be collected. Thus, this will significantly increase the speed of building the image and will allow you to use the ARM64 architecture for supersets in the future, as I tried and the current image based on the ARM64 architecture takes more than an hour to build due to the fact that many libraries need to be compiled, unlike AMD64. Or we switch to using the arm64 architecture and wait for all tests to complete for approximately 1.25 hours, which in my opinion is too long.
Actually, because of this, I came up with the idea of giving the superset to use the cache for assembly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341917762
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
@craig-rueda It is possible to parallelize the build process, but this will need to be done step by step, since various problems may arise during the build. To begin with, I plan to separate the assembly of the superset itself, websocket and dockerize. After adding a code proposal to the master branch, you can try to assemble the ARM 64 and AMD 64 architecture in parallel.
@sebastianliebscher Personally, for me it makes no difference where to load the cache for the build, I just need an example that can be used to build the Superset. Then I can configure the build, and you can check the quality of my code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] craig-rueda commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "craig-rueda (via GitHub)" <gi...@apache.org>.
craig-rueda commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341586479
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
Understood, and this is great! I just think that it would be better to have a dedicated "cache" registry instead of conflating the "main" registry's contents. We can raise this in the next community meeting to see how folks are thinking around this area. I think that for now, using a local cache will probably suffice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341757023
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
The ephemeral env uses an AWS image registry (I think sponsored by Preset?). Maybe this could be used instead of Dockerhub.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] craig-rueda commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "craig-rueda (via GitHub)" <gi...@apache.org>.
craig-rueda commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341598193
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
Yep, sounds good. I think that we can still build both versions, just without pushing to the main registry. If you don't mind switching back to the local cache, I'm happy to approve/merge this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(docker): speed up your build using caching [superset]
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg closed pull request #25422: feat(docker): speed up your build using caching
URL: https://github.com/apache/superset/pull/25422
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] craig-rueda commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "craig-rueda (via GitHub)" <gi...@apache.org>.
craig-rueda commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341533304
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
This will cruft up the `apache/superset` registry and will clobber the tag with each branch build. Let's just leave the local `cache-to` for now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341602294
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
Let's then try to build both architectures with a local cache, but I repeat - then with each code proposal you will have to wait more than an hour.
And we can return to the current issue after the group meeting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1340377139
##########
.github/workflows/docker_build_push.sh:
##########
@@ -47,13 +47,13 @@ if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
- DOCKER_ARGS="--load"
+ DOCKER_ARGS="--load --cache-from=type=registry,ref=apache/superset:cache"
ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
- DOCKER_ARGS="--push"
+ DOCKER_ARGS="--push --cache-from=type=registry,ref=apache/superset:cache --cache-to type=registry,ref=apache/superset:cache,mode=max"
Review Comment:
I am just curious. Doesn't this always overwrite the same image cache during a single build if using the same `--cache-to` arg for every image? E.g. `superset:websocket` overwrites `superset:py310`. And right after that, `superset:dockerize` overwrtites `superset:websocket` etc?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1340377139
##########
.github/workflows/docker_build_push.sh:
##########
@@ -47,13 +47,13 @@ if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
- DOCKER_ARGS="--load"
+ DOCKER_ARGS="--load --cache-from=type=registry,ref=apache/superset:cache"
ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
- DOCKER_ARGS="--push"
+ DOCKER_ARGS="--push --cache-from=type=registry,ref=apache/superset:cache --cache-to type=registry,ref=apache/superset:cache,mode=max"
Review Comment:
I am just curious. Doesn't this always overwrite the same image cache during a single build? E.g. `superset:websocket` overwrites `superset:py310`. And `superset:dockerize` overwrtites `superset:websocket` etc?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1340377139
##########
.github/workflows/docker_build_push.sh:
##########
@@ -47,13 +47,13 @@ if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
- DOCKER_ARGS="--load"
+ DOCKER_ARGS="--load --cache-from=type=registry,ref=apache/superset:cache"
ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
- DOCKER_ARGS="--push"
+ DOCKER_ARGS="--push --cache-from=type=registry,ref=apache/superset:cache --cache-to type=registry,ref=apache/superset:cache,mode=max"
Review Comment:
I am just curious. Doesn't this always overwrite the same image cache during a single build? E.g. `superset:websocket` overwrites `superset:py310`. And right after that, `superset:dockerize` overwrtites `superset:websocket` etc?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1340571129
##########
.github/workflows/docker_build_push.sh:
##########
@@ -47,13 +47,13 @@ if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
- DOCKER_ARGS="--load"
+ DOCKER_ARGS="--load --cache-from=type=registry,ref=apache/superset:cache"
ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
- DOCKER_ARGS="--push"
+ DOCKER_ARGS="--push --cache-from=type=registry,ref=apache/superset:cache --cache-to type=registry,ref=apache/superset:cache,mode=max"
Review Comment:
@sebastianliebscher Thanks for your comment, you were completely right. I did what you said and got the cache overwritten by the new cache.
I eliminated this oversight and now everything should work fine in my opinion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on PR #25422:
URL: https://github.com/apache/superset/pull/25422#issuecomment-1737735904
@craig-rueda Please look at my code proposal, it should greatly help speed up the build of images.
Thus, we are gradually moving towards supporting image architecture ARM64.
I'd love to hear your thoughts on this code proposal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] alekseyolg commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "alekseyolg (via GitHub)" <gi...@apache.org>.
alekseyolg commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341593954
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
I will be ready to help if necessary, this way we will quickly come to the possibility of building both the AMD 64 and ARM 64 versions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on PR #25422:
URL: https://github.com/apache/superset/pull/25422#issuecomment-1739605124
Nice improvements!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sebastianliebscher commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "sebastianliebscher (via GitHub)" <gi...@apache.org>.
sebastianliebscher commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1340377139
##########
.github/workflows/docker_build_push.sh:
##########
@@ -47,13 +47,13 @@ if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
- DOCKER_ARGS="--load"
+ DOCKER_ARGS="--load --cache-from=type=registry,ref=apache/superset:cache"
ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
- DOCKER_ARGS="--push"
+ DOCKER_ARGS="--push --cache-from=type=registry,ref=apache/superset:cache --cache-to type=registry,ref=apache/superset:cache,mode=max"
Review Comment:
I am just curious. Doesn't this always overwrite the same image cache during a single build if using the same `--cache-to` arg for every image? E.g. `superset:websocket` overwrites `superset:py310` cache. And right after that, `superset:dockerize` overwrtites `superset:websocket` cache etc?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] craig-rueda commented on a diff in pull request #25422: feat(docker): speed up your build using caching
Posted by "craig-rueda (via GitHub)" <gi...@apache.org>.
craig-rueda commented on code in PR #25422:
URL: https://github.com/apache/superset/pull/25422#discussion_r1341647016
##########
.github/workflows/docker_build_push.sh:
##########
@@ -43,29 +43,35 @@ cat<<EOF
- ${REPO_NAME}:${LATEST_TAG}
EOF
+CACHE_FROM="--cache-from=type=registry,ref=apache/superset:cache"
if [ -z "${DOCKERHUB_TOKEN}" ]; then
# Skip if secrets aren't populated -- they're only visible for actions running in the repo (not on forks)
echo "Skipping Docker push"
# By default load it back
DOCKER_ARGS="--load"
- ARCHITECTURE_FOR_BUILD="linux/amd64 linux/arm64"
else
# Login and push
docker logout
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}"
DOCKER_ARGS="--push"
- ARCHITECTURE_FOR_BUILD="linux/amd64,linux/arm64"
+ CACHE_TO="--cache-to type=registry,mode=max,ref=apache/superset:cache"
Review Comment:
Would it be possible to speed this up by parallelizing the builds? It looks like the current setup is just running each CMD in a serial fashion. we would probably benefit from breaking this workflow up per platform/image
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org