Closed Arthurvdv closed 1 month ago
@Arthurvdv
We run into a simular problem, which I have solved by adding the workspace: clean: resources to the job. The disadvantage is that the fetch from git takes slighthly longer, but it saves us about 15-20 minutes for our most used repository.
If I'm not mistaken we already have this in place (but with the setting to all instead of resources).
- stage: TestStage
displayName: 'Test'
dependsOn: BuildStage
condition: succeeded()
jobs:
- job: TestJob
displayName: 'Test'
pool: '${{ parameters.build_pool }}'
workspace:
clean: all
steps:
After sleeping a night I think I have have a better approach on this. Can we use the mount functionality of docker, instead of the Compress, Transfer and Expand steps?
https://docs.docker.com/storage/bind-mounts/
I believe this could simply the steps of the ALOpsDockerWait@1 and improve performance at the same time? In this way we expose the folder directly to the container, without the need of transferring files.
We'll try to foresee an option (extra parameter) to exclude the .git folder from the copy.
It can take a while though, since we have to redo our zip-procedure completely. And we obviously don't want to break anything.. .
We found a way to do this. Setting will be exclude_git_folder
.
Works perfectly, thank you for supporting this!
Thanks for the suggestion - it was a very good idea ;-)
Is your feature request related to a problem? Please describe. For some projects the duration of the ALOpsDockerWait@1 step takes 8 minutes and 30 seconds, where the Copy Working folder to Docker Container action takes up almost all the time (8 minutes).
The reason for this is that it compress and copies over 2,2 GB from the Build.SourcesDirectory/System.DefaultWorkingDirectory to the container. Over time on a number of projects the .git folder has increased to a significant size. In this example the .git folder is a whopping 2,1 GB for a project of 80 MB.
Describe the solution you'd like In our pipelines we don't use any git commands inside the container itself. With this in mind, it would be helpful if we could exclude the .git folder from this step.
Describe alternatives you've considered
fetchDepth: 1
on the checkout step (1,88 GB instead of 2,2 GB)git repack -a -d -f --depth=250 --window=250
on my local machine of the project results in (398 MB instead of 2,2 GB). If it is somehow possible to do this in a safe way on the remote VSO repo I would love to learn more about this.Additional context