# Best way to install from tarballs?

**URL:** <https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365>\
**Category:** Chef Infra (archive)\
**Created:** [January 20, 2012, 2:28pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365 "2012-01-20T14:28:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Van\_Fossan\_Randy](https://avatars.discourse-cdn.com/v4/letter/v/8797f3/32.png) [@Van\_Fossan\_Randy](https://discourse.chef.io/u/Van_Fossan_Randy)\
**Post date:** [January 20, 2012, 2:28pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/1 "2012-01-20T14:28:13Z")

</div>

How is the best way to handle installations from tarballs? Currently,  
we have several tarballs that we use to deploy software. These tarballs  
are just extracted to the correct directory and the software is  
installed.

I want the software installation to be idempotent and not have the  
recipe do any more work than necessary. I also want the recipe to  
replace a file that may have been overwritten by someone or some other  
process. I do not want to have to extract the tarball on every run .  
I considered extracting the tarball into the file portion of the  
cookbook, but it is in many cases several thousand files that is in  
these tarballs.

Anyone have any ideas?

Randy

---

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [January 20, 2012, 2:31pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/2 "2012-01-20T14:31:18Z")

</div>

I created the java\_ark lwrp exactly for this use case. While it is in the  
java cookbook, it is not actually specific to java

> <https://github.com/bryanwb/cookbooks/blob/master/java/README.md>

On Fri, Jan 20, 2012 at 3:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org) wrote:

> How is the best way to handle installations from tarballs? Currently, we  
> have several tarballs that we use to deploy software. These tarballs are  
> just extracted to the correct directory and the software is installed.\*\*\*\*
> 
> * * *
> 
> I want the software installation to be idempotent and not have the recipe  
> do any more work than necessary. I also want the recipe to replace a file  
> that may have been overwritten by someone or some other process. I do  
> not want to have to extract the tarball on every run . I considered  
> extracting the tarball into the file portion of the cookbook, but it is in  
> many cases several thousand files that is in these tarballs.\*\*\*\*
> 
> * * *
> 
> Anyone have any ideas?\*\*\*\*
> 
> * * *
> 
> Randy\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Ranjib\_Dey](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Ranjib\_Dey](https://discourse.chef.io/u/Ranjib_Dey)\
**Post date:** [January 20, 2012, 2:41pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/3 "2012-01-20T14:41:46Z")

</div>

serve the tar ball via file resource or remote file resource,( specify  
checksum to make it idempotent), notify an un-tar execute resource from  
the earlier file/remote file resource. you should not check for individual  
file content/permission check if the number of files are in thousands. You  
might want to use tar against the uncompressed directory and then verify  
the checksum .

On Fri, Jan 20, 2012 at 8:01 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com) wrote:

> I created the java\_ark lwrp exactly for this use case. While it is in the  
> java cookbook, it is not actually specific to java
> 
> [cookbooks/java/README.md at master · bryanwb/cookbooks · GitHub](https://github.com/bryanwb/cookbooks/blob/master/java/README.md)
> 
> On Fri, Jan 20, 2012 at 3:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org)wrote:
> 
> > How is the best way to handle installations from tarballs? Currently, we  
> > have several tarballs that we use to deploy software. These tarballs are  
> > just extracted to the correct directory and the software is installed.\*\*\*  
> > \*
> > 
> > * * *
> > 
> > I want the software installation to be idempotent and not have the recipe  
> > do any more work than necessary. I also want the recipe to replace a file  
> > that may have been overwritten by someone or some other process. I do  
> > not want to have to extract the tarball on every run . I considered  
> > extracting the tarball into the file portion of the cookbook, but it is in  
> > many cases several thousand files that is in these tarballs.\*\*\*\*
> > 
> > * * *
> > 
> > Anyone have any ideas?\*\*\*\*
> > 
> > * * *
> > 
> > Randy\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [January 20, 2012, 2:45pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/4 "2012-01-20T14:45:34Z")

</div>

my java\_ark is basically a DSL for doing that

here is an example. The one difference is that it currently doesn't  
support sourcing tarballs from cookbook\_files but I could add that. Right  
now it expects a url pointing to the tarball

here is an example

java\_ark "jdk" do  
url '[Unauthorized Request](http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin)'  
checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'  
app\_home '/usr/local/java/default'  
bin\_cmds ["java", "javac"]  
action :install  
end

On Fri, Jan 20, 2012 at 3:41 PM, Ranjib Dey [ranjibd@thoughtworks.com](mailto:ranjibd@thoughtworks.com)wrote:

> serve the tar ball via file resource or remote file resource,( specify  
> checksum to make it idempotent), notify an un-tar execute resource from  
> the earlier file/remote file resource. you should not check for individual  
> file content/permission check if the number of files are in thousands. You  
> might want to use tar against the uncompressed directory and then verify  
> the checksum .
> 
> On Fri, Jan 20, 2012 at 8:01 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com)wrote:
> 
> > I created the java\_ark lwrp exactly for this use case. While it is in the  
> > java cookbook, it is not actually specific to java
> > 
> > [cookbooks/java/README.md at master · bryanwb/cookbooks · GitHub](https://github.com/bryanwb/cookbooks/blob/master/java/README.md)
> > 
> > On Fri, Jan 20, 2012 at 3:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org)wrote:
> > 
> > > How is the best way to handle installations from tarballs? Currently,  
> > > we have several tarballs that we use to deploy software. These tarballs  
> > > are just extracted to the correct directory and the software is installed.
> > > 
> > > * * *
> > > 
> > > * * *
> > > 
> > > I want the software installation to be idempotent and not have the  
> > > recipe do any more work than necessary. I also want the recipe to replace  
> > > a file that may have been overwritten by someone or some other process.  
> > > I do not want to have to extract the tarball on every run . I considered  
> > > extracting the tarball into the file portion of the cookbook, but it is in  
> > > many cases several thousand files that is in these tarballs.\*\*\*\*
> > > 
> > > * * *
> > > 
> > > Anyone have any ideas?\*\*\*\*
> > > 
> > > * * *
> > > 
> > > Randy\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Ranjib\_Dey](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Ranjib\_Dey](https://discourse.chef.io/u/Ranjib_Dey)\
**Post date:** [January 20, 2012, 2:49pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/5 "2012-01-20T14:49:57Z")

</div>

oh.. sorry :-). Didn't went through your providers.. will check them now.

On Fri, Jan 20, 2012 at 8:15 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com) wrote:

> my java\_ark is basically a DSL for doing that
> 
> here is an example. The one difference is that it currently doesn't  
> support sourcing tarballs from cookbook\_files but I could add that. Right  
> now it expects a url pointing to the tarball
> 
> here is an example
> 
> java\_ark "jdk" do  
> url '[Unauthorized Request](http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin)'  
> checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'  
> app\_home '/usr/local/java/default'  
> bin\_cmds ["java", "javac"]  
> action :install  
> end
> 
> On Fri, Jan 20, 2012 at 3:41 PM, Ranjib Dey [ranjibd@thoughtworks.com](mailto:ranjibd@thoughtworks.com)wrote:
> 
> > serve the tar ball via file resource or remote file resource,( specify  
> > checksum to make it idempotent), notify an un-tar execute resource from  
> > the earlier file/remote file resource. you should not check for individual  
> > file content/permission check if the number of files are in thousands. You  
> > might want to use tar against the uncompressed directory and then verify  
> > the checksum .
> > 
> > On Fri, Jan 20, 2012 at 8:01 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com)wrote:
> > 
> > > I created the java\_ark lwrp exactly for this use case. While it is in  
> > > the java cookbook, it is not actually specific to java
> > > 
> > > [cookbooks/java/README.md at master · bryanwb/cookbooks · GitHub](https://github.com/bryanwb/cookbooks/blob/master/java/README.md)
> > > 
> > > On Fri, Jan 20, 2012 at 3:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org)wrote:
> > > 
> > > > How is the best way to handle installations from tarballs? Currently,  
> > > > we have several tarballs that we use to deploy software. These tarballs  
> > > > are just extracted to the correct directory and the software is installed.
> > > > 
> > > > * * *
> > > > 
> > > > * * *
> > > > 
> > > > I want the software installation to be idempotent and not have the  
> > > > recipe do any more work than necessary. I also want the recipe to replace  
> > > > a file that may have been overwritten by someone or some other process.  
> > > > I do not want to have to extract the tarball on every run . I considered  
> > > > extracting the tarball into the file portion of the cookbook, but it is in  
> > > > many cases several thousand files that is in these tarballs.\*\*\*\*
> > > > 
> > > > * * *
> > > > 
> > > > Anyone have any ideas?\*\*\*\*
> > > > 
> > > > * * *
> > > > 
> > > > Randy\*\*\*\*

---

<div class="post-metadata">

**Author:** ![zts](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/zts/32/111_2.png) [@zts](https://discourse.chef.io/u/zts)\
**Post date:** [January 20, 2012, 3:54pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/6 "2012-01-20T15:54:02Z")

</div>

On Fri, Jan 20, 2012 at 2:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org) wrote:

> How is the best way to handle installations from tarballs? Currently, we  
> have several tarballs that we use to deploy software. These tarballs are  
> just extracted to the correct directory and the software is installed.

We started out with a "tar\_package" LWRP, similar to the approach  
mentioned by the other replies on this thread, but now use FPM[1](https://github.com/jordansissel/fpm) to  
create RPMs of the file we previously shipped in a tarball. The  
tarballs we're concerned with are updated very infrequently, so the  
extra step of building the RPM isn't a problem for us.

Zac

---

<div class="post-metadata">

**Author:** ![Ranjib\_Dey](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Ranjib\_Dey](https://discourse.chef.io/u/Ranjib_Dey)\
**Post date:** [January 20, 2012, 4:08pm UTC](https://discourse.chef.io/t/best-way-to-install-from-tarballs/2365/7 "2012-01-20T16:08:22Z")

</div>

Indeed , even we do use the same strategy to deploy some of our apps. We  
have the fpm mediated rpm creation step as part of our CI. Also, there are  
mcollective based triggers that executed "createrepo" on the rpm repo  
server and "chef-client --once " to the app servers. But as things evolved,  
in some cases we are overburdened with git-fpm--publish-createrepo-chef  
route and in some other cases we have many sources of truth (rpm version/  
git commit hash). As of now , i dont see a 'one solution fits all  
situation' approach for distributing build artifacts. But never the less we  
should work/innovate towards that

On Fri, Jan 20, 2012 at 9:24 PM, Zac Stevens [zts@cryptocracy.com](mailto:zts@cryptocracy.com) wrote:

> On Fri, Jan 20, 2012 at 2:28 PM, Van Fossan,Randy [vanfossr@oclc.org](mailto:vanfossr@oclc.org)  
> wrote:
> 
> > How is the best way to handle installations from tarballs? Currently, we  
> > have several tarballs that we use to deploy software. These tarballs are  
> > just extracted to the correct directory and the software is installed.
> 
> We started out with a "tar\_package" LWRP, similar to the approach  
> mentioned by the other replies on this thread, but now use FPM[1](https://github.com/jordansissel/fpm) to  
> create RPMs of the file we previously shipped in a tarball. The  
> tarballs we're concerned with are updated very infrequently, so the  
> extra step of building the RPM isn't a problem for us.
> 
> Zac
