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

Feature: Sparse checkout for repositories #2531

Open
jguay opened this issue Nov 11, 2024 · 0 comments
Open

Feature: Sparse checkout for repositories #2531

jguay opened this issue Nov 11, 2024 · 0 comments
Labels

Comments

@jguay
Copy link

jguay commented Nov 11, 2024

Related to

Database

Impact

nice to have

Missing Feature

At the moment when 2 task template uses a repository with a specific bash file and specific semaphore folder, the entire repository is pulled twice causing significant waste of disk space :

docker exec semaphore01 semaphore version
v2.10.32-f33944e-1729509436
$ docker exec semaphore01 bash -c "cd /tmp/semaphore && du -hd 1" 
12.0K	./.terraform.d
195.4M	./repository_1_6
195.4M	./repository_1_8
2.7M	./.config

Note this is an extreme example - obviously this repository has more than scripts used for semaphore currently... But at scale I'm looking at few hundreds users (one project per user so every user can create and delete GCE/GKE instances/cluster using terraform||opentofu including some ansible scripts) - multiplied by potentially tens of task templates... If I am only using one bash script in a task template the idea is we don't need to clone the entire repository parse checkout only that file would be enough

Implementation

Use sparse checkout to only pull the information in the path mentioned in task template

Design

  • add the directory path or filename from task template for go-git sparse checkout (example shows the library supports sparse checkout)
@jguay jguay added the feature label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant