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

git post-receive template should use archive, not clone #367

Open
jyaworski opened this issue Mar 17, 2016 · 6 comments
Open

git post-receive template should use archive, not clone #367

jyaworski opened this issue Mar 17, 2016 · 6 comments

Comments

@jyaworski
Copy link
Contributor

Currently, the post-receive template uses git clone to populate environments. Using git archive would greatly reduce the space used, as it's close to svn export. Using my checkout of this repo:

joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % du -hs .
8.8M    .
joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % git archive --format tar --prefix export/ HEAD | tar -x
joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % du -sh export 
464K    export

Are there concerns using archive rather than clone?

Edit:
To check out a specific branch to a specific dir:

git archive --format tar --prefix branchname/ branchname: | tar -x -C /etc/puppet/environments
@ekohl
Copy link
Member

ekohl commented Mar 17, 2016

I believe git clone on a local filesystem uses hardlinks so I wonder how much it actually uses.

@jyaworski
Copy link
Contributor Author

Earlier, cloning from a local filesystem using the existing template, the first du (including the .git) was around 151M or so, with the .git being something like 80M of that.

@jyaworski
Copy link
Contributor Author

I have actual stats now:

This is doing a traditional git clone from an upstream not on the machine.

[root@puppet1 ~]# du -sh /etc/puppet/environments/production/
148M    /etc/puppet/environments/production/
[root@puppet1 ~]# du -sh /etc/puppet/environments/production/.git
85M     /etc/puppet/environments/production/.git

This is cloning from the local /opt/puppet.git.

[root@puppet1 ~]# du -sh /etc/puppet/environments/testpostgres/
404M    /etc/puppet/environments/testpostgres/
[root@puppet1 ~]# du -sh /etc/puppet/environments/testpostgres/.git
340M    /etc/puppet/environments/testpostgres/.git

@ekohl
Copy link
Member

ekohl commented Aug 24, 2017

This didn't get that much attention. I'm wondering if we should look at supporting r10k out of the box, but there are no packages for that on most distros. Thoughts?

@jyaworski
Copy link
Contributor Author

@ekohl we could. Add a dependency on puppet-r10k. https://forge.puppet.com/puppet/r10k

@jcpunk
Copy link
Contributor

jcpunk commented Jan 10, 2023

To try and limp towards r10k support, I've opened #853. It is not a perfect solution, but it gets what I need out of the integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants