# Saving current julia/package information for reproducible research

**URL:** <https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [November 22, 2016, 7:34pm UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505 "2016-11-22T19:34:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bisraelsen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bisraelsen/32/3974_2.png) [@bisraelsen](https://discourse.julialang.org/u/bisraelsen)\
**Post date:** [November 22, 2016, 7:34pm UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/1 "2016-11-22T19:34:52Z")

</div>

Hi all does anyone have a “best practice” for archiving the current julia package state for the purposes of reproducible research.

What I have in mind is being able to save off a file with the required packages and associated versions that were used to run a certain script. I know about Pkg.status() but this would return all installed packages, I am looking for something that saves off the version of only the currently loaded packages.

Thanks!

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 22, 2016, 7:37pm UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/2 "2016-11-22T19:37:27Z")

</div>

The [next generation](https://github.com/JuliaLang/Juleps/blob/master/Pkg3.md) package manager will address this, but in the mean time [Playground](https://github.com/Rory-Finnegan/Playground.jl) or [DeclarativePackages](https://github.com/rened/DeclarativePackages.jl) may help.

---

<div class="post-metadata">

**Author:** ![bisraelsen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bisraelsen/32/3974_2.png) [@bisraelsen](https://discourse.julialang.org/u/bisraelsen)\
**Post date:** [November 23, 2016, 12:09am UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/3 "2016-11-23T00:09:29Z")

</div>

Thanks for the response. I am glad that Pkg3 is going to address the issue. In the meantime your recommendations are useful.

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [November 23, 2016, 11:00am UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/4 "2016-11-23T11:00:20Z")

</div>

How easy is it to bundle up an existing julia configuration (i.e. julia v0.5 plus all the packages I currently have installed) into a docker image for that purpose?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [November 23, 2016, 11:44pm UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/5 "2016-11-23T23:44:45Z")

</div>

Should be pretty easy. You just need to extract from `.julia/v0.5/REQUIRE` the list of (“top-level”) packages you have installed, and add them in the Dockerfile, as you can see e.g. [here](https://github.com/andreasnoack/HHXX/blob/master/Dockerfile)

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [December 11, 2017, 10:32am UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/6 "2017-12-11T10:32:14Z")

</div>

I just wanted to ask whether DeclarativePackages (and fixing RNG-state, and running single-threaded) is supposedly enough for “mostly reproducible” computations (mostly meaning: Unless something very weird happens, I should get identical results, including floating point rounding).

I’m asking because DeclarativePackages does not fix the compiler version used for julia, or libc version, etc. Also, Ithink that the commit-hash for julia does not fix all the commit-hashes for dependencies (llvm, lapack, etc)

Or do you recommend just fixing the hash of a VM image?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 11, 2017, 10:40pm UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/7 "2017-12-11T22:40:01Z")

</div>

If you’re willing to use VMs and you really want to make sure something is perfectly reproducible, you may want to check out [ReproZip](https://www.reprozip.org/). It uses system call tracing to record and bundle up everything you need to run an experiment, including source code, data files, shared libraries – everything. It doesn’t care what language you’re using.

---

<div class="post-metadata">

**Author:** ![amckay1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amckay1/32/8280_2.png) [@amckay1](https://discourse.julialang.org/u/amckay1)\
**Post date:** [December 12, 2017, 2:38am UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505/8 "2017-12-12T02:38:16Z")

</div>

My solution has been to use the official julia docker repo ([Docker Hub](https://hub.docker.com/_/julia/)) with the Singularity container system which is geared towards reproducible science ([http://singularity.lbl.gov/](http://singularity.lbl.gov/)).
