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

ci: Disable docker cache temporarily #4523

Merged
merged 4 commits into from
Oct 26, 2020
Merged

Conversation

boydc2014
Copy link
Contributor

@boydc2014 boydc2014 commented Oct 26, 2020

After taking #4516, our docker pipeline fails in last post caching step because of no enough space. Seems like a normal issue and no easy way to increase space unless switching to a custom runner (non-trivial work).
image
image

After digging into more, i found the cache step is taking about 4GB but seems not benefiting the build step.

So, disable the docker cache temporarily will save 4G space for now, before we switch a custom runner or any other ideas.

#minor

@coveralls
Copy link

coveralls commented Oct 26, 2020

Coverage Status

Coverage remained the same at 55.046% when pulling 345a7af on donglei/disable-docker-cache into a075963 on main.

@cdonke
Copy link
Contributor

cdonke commented Oct 26, 2020

@boydc2014 the default action for docker build uses the buildx as template... but it still marked as Experimental Preview...

Since building the image is not so current (many times a day, I mean), wouldn't it be better to use plain docker commands and skip the buildx template?

@boydc2014
Copy link
Contributor Author

boydc2014 commented Oct 26, 2020

@boydc2014 the default action for docker build uses the buildx as template... but it still marked as Experimental Preview...

Since building the image is not so current (many times a day, I mean), wouldn't it be better to use plain docker commands and skip the buildx template?

Will buildx taking lots of space and using plain docker command will save significant disk space for us? The error i see is no space left, and i searched around, many people encountered this also and looks like the default disk size is 16GB. And from the log of this cache restore step, i saw ~4GB cache restored + when i looked into the build step, i didn't any step says "from cache" if you look at recent PR, so i thought it might be a good idea of not using this cache. What do you think?

@cdonke
Copy link
Contributor

cdonke commented Oct 26, 2020

@boydc2014 the default action for docker build uses the buildx as template... but it still marked as Experimental Preview...
Since building the image is not so current (many times a day, I mean), wouldn't it be better to use plain docker commands and skip the buildx template?

Will buildx taking lots of space and using plain docker command will save significant disk space for us? The error i see is no space left, and i searched around, many people encountered this also and looks like the default disk size is 16GB. And from the log of this cache restore step, i saw ~4GB cache restored + when i looked into the build step, i didn't any step says "from cache" if you look at recent PR, so i thought it might be a good idea of not using this cache. What do you think?

Cache is load on lines 37/38 of Dockerfile.

each stage on dockerfile (4 stages) will be new image..
With plain docker cmds we can add the --rm that will remove the intermediate images when done...
I could not find this option on buildx.

buildx runs a new container (on the --use cmd)... This image has ~85Mb.. And the build is ran in it...
Without it, we would be using all the capabilities of the host.. I could not find any size limitations, besides the 14Gb SSD.

The benefits of using buildx is for scoping (dev and testing, for instance)... Also, for building for multiple environments (Windows, Linux and Mac)... Both I don't see it being used...

IMHO, buildx and Caching is overhead.

@boydc2014
Copy link
Contributor Author

boydc2014 commented Oct 26, 2020

@boydc2014 the default action for docker build uses the buildx as template... but it still marked as Experimental Preview...
Since building the image is not so current (many times a day, I mean), wouldn't it be better to use plain docker commands and skip the buildx template?

Will buildx taking lots of space and using plain docker command will save significant disk space for us? The error i see is no space left, and i searched around, many people encountered this also and looks like the default disk size is 16GB. And from the log of this cache restore step, i saw ~4GB cache restored + when i looked into the build step, i didn't any step says "from cache" if you look at recent PR, so i thought it might be a good idea of not using this cache. What do you think?

Cache is load on lines 37/38 of Dockerfile.

each stage on dockerfile (4 stages) will be new image..
With plain docker cmds we can add the --rm that will remove the intermediate images when done...
I could not find this option on buildx.

buildx runs a new container (on the --use cmd)... This image has ~85Mb.. And the build is ran in it...
Without it, we would be using all the capabilities of the host.. I could not find any size limitations, besides the 14Gb SSD.

The benefits of using buildx is for scoping (dev and testing, for instance)... Also, for building for multiple environments (Windows, Linux and Mac)... Both I don't see it being used...

IMHO, buildx and Caching is overhead.

Thanks, buildx and caching is overhead to me as well. And disable cache is probably a easier way to fix this at least for now.

The 37/38 line in docker.yml of cache loading replying the cache downloaded in line 25, right? That's the reason i ignore the downloading in this PR. I saw from the log, in this step,~4GB cache is downloaded into /tmp/.buildx-cache. By commenting out this, it should save us those spaces for sure. So that's the first thing i'd try.

And yes, it's a multi-stage build which we can clean timely if using plain docker command instead of buildx. But actually buildx don't block us to clean it later, we can also clean in last step with docker prune or something else right?

The previous log shows that the out of disk space issue is not in the middle of build, it happens in the post build steps. So i guess we probably do need to clean the image right after one stage.

So i will propose disable the cache first at least to unblock other PRs at least for now, does this make sense to you? While at the same time, we can experiment with other optimization like using plain docker command instead of buildx to do finer-grain control.

@a-b-r-o-w-n a-b-r-o-w-n merged commit c48021e into main Oct 26, 2020
@a-b-r-o-w-n a-b-r-o-w-n deleted the donglei/disable-docker-cache branch October 26, 2020 16:36
@cwhitten cwhitten mentioned this pull request Nov 13, 2020
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* Disable docker cache for now

* remove buildx from docker workflow

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants