gramineproject / gsc

Gramine Shielded Containers (Docker integration)
BSD 3-Clause "New" or "Revised" License
43 stars 34 forks source link

Add multiprocessing lock in prune Docker images #208

Closed adarshan-intel closed 2 months ago

adarshan-intel commented 2 months ago

Description of the changes

This PR adds a lock to the Docker image pruning process to prevent race conditions and breaking the code

How to test this PR?

To test this PR, create a script that signs multiple images in parallel in background using &. Then, attempt to trigger the race condition while performing the gsc sign operation. This should help you encounter the issue. Example script Link

image

Adding locking mechanism should fix the issue.


This change is Reviewable

mkow commented 2 months ago

Third, please never paste text as screenshots of it...

aneessahib commented 2 months ago

@dimakuv - A customer has reported an issue where their build system is designed to execute multiple jobs concurrently to generate several independent GSC images. Although this approach will result in a sequential process, I believe it serves as an effective temporary solution to resolve their current situation.