# Delivering Julia code to production computers

**URL:** https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586
**Category:** General Usage
**Created:** [January 13, 2019, 9:46am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586 "2019-01-13T09:46:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 9:46am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/1 "2019-01-13T09:46:44Z")

</div>

In our MATLAB production projects, we can deliver (copy) our compiled MATLAB code with the corresponding MATLAB MCR to production computers without installing MATLAB MCR on them. This makes it easy to switch between different versions of MATLAB. Is this possibility planned for Julia (without installing Julia on production computers)? This is a very important feature for large projects.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [January 13, 2019, 10:22am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/2 "2019-01-13T10:22:52Z")

</div>

VLadimir, there is the possibility of compiling Julia. Other people will comment on this as they know better than me.  
I work in HPC. There was a thread recently on using Julia with a shared filesystem – how to cope with the initial JIT compilations being triggered on multiple hosts.

---

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 10:54am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/3 "2019-01-13T10:54:03Z")

</div>

The question was how to copy Julia code together with the Julia run-time onto the target production computer without installing Julia on it, which is not always possible for many reasons. This feature exists in MATLAB and is not associated with shared folders. This is a very important feature for the use of Julia in the production.

---

<div class="post-metadata">

### Author: ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)
#### Post date: [January 13, 2019, 11:08am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/4 "2019-01-13T11:08:40Z")

</div>

> [@vladimir](#):
>
> The question was how to copy Julia code together with the Julia run-time onto the target production computer without installing Julia on it, which is not always possible for many reasons.

This company has a commercial option: [http://www.techilatechnologies.com/distributed-julia-juliacon/](http://www.techilatechnologies.com/distributed-julia-juliacon/)

Or if not exactly fitting to your needs they are probably willing to develop it.

---

<div class="post-metadata">

### Author: ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)
#### Post date: [January 13, 2019, 11:23am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/5 "2019-01-13T11:23:39Z")

</div>

If julia’s dependencies are installed in the host machine (i.e. `libuv`, `libgit2` and possibly a few other), the precompiled binaries (the ones [here](https://julialang.org/downloads/)) can just be extracted in some folder and that’s pretty much it. Works out of the box.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [January 13, 2019, 11:27am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/6 "2019-01-13T11:27:58Z")

</div>

> [@vladimir](#):
>
> The question was how to copy Julia code together with the Julia run-time onto the target production computer without installing Julia on it, which is not always possible for many reasons.

I think the key question is what you mean with “installing Julia” and what aspects make this difficult on the target system.

For Matlab I understand that an installation can be difficult because it may require

- files in a system directory
- inclusion in PATH and/or other environment/registry variables
- a licensing solution

whereas an MCR solution sidesteps all of these by bundling a subset of the Matlab system (i.e. the runtime) with your application.

Neither of the points above apply to Julia and you can just bundle the entire Julia like you would do with the MCR part of Matlab. There might be a question of how large the things you need to bundle are, but if you see other difficulties, please be more specific about what those are.

---

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 11:59am UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/7 "2019-01-13T11:59:36Z")

</div>

How I can bundle the entire Julia installed on one Windows computer and copy it to another, different computer (with different user name, etc.) where Julia is not installed?  
Can Julia with all its installed packages can be copied into a selected target directory on a computer without Julia as the MATLAB MCR ?

---

<div class="post-metadata">

### Author: ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)
#### Post date: [January 13, 2019, 12:05pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/8 "2019-01-13T12:05:14Z")

</div>

Short answer, yes. Copying the `.julia` folder (that contains installations of packages) and julia binaries should work or at least be require minimal additional work (fixing paths etc.)

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 13, 2019, 12:07pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/9 "2019-01-13T12:07:44Z")

</div>

If you commit the `Manifest.toml` in a git repository, it will reproduce the same package _versions_.

Alternatively, a Docker image or a similar container can easily be created, updated, distributed, and reproduces the exact same environment.

---

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 12:20pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/10 "2019-01-13T12:20:21Z")

</div>

" Short answer, yes. Copying the `.julia` folder (that contains installations of packages) and julia binaries should work or at least be require minimal additional work (fixing paths etc.)"

I actually need a long answer, how to merge “.julia” folder and julia binaries folder into one arbitrary folder on a target Windows computer without Julia 🙂

---

<div class="post-metadata">

### Author: ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)
#### Post date: [January 13, 2019, 12:37pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/11 "2019-01-13T12:37:39Z")

</div>

~~If you are copying these folders anyway and running binaries anyway why not just copy the julia folder and run julia?~~

~~There is no “installing” julia. Copy the folder across and it will work. (as long as you have the necessary libraries installed)~~

Edit: Sorry I didn’t quite understand what you didn’t understand: the main question here is how to set the .julia folder to an arbitrary path? (You can put the julia folder anywhere).

You should find what you need here:  
[https://docs.julialang.org/en/v1/manual/environment-variables/index.html](https://docs.julialang.org/en/v1/manual/environment-variables/index.html)

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [January 13, 2019, 1:09pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/12 "2019-01-13T13:09:51Z")

</div>

> [@vladimir](#):
>
> How I can bundle the entire Julia installed on one Windows computer and copy it to another, different computer (with different user name, etc.) where Julia is not installed?

I have done exactly this in the past, with Julia 0.5, creating an installer with Inno Setup that bundled Julia together with our application and could be installed and run on a computer that didn’t otherwise have Julia. Things may be a little different with Julia 1.0 but I assure you it can be done.

The base Julia is the least problem. Just take the Windows binaries and place them somewhere in your application directory.

User packages allow some options, depending on what you can do at install time. The easiest is if you can run package installation as post-install step. Point `DEPOT_PATH` to somewhere in your application directory and use `Pkg.instantiate` to replicate the packages from a manifest. If this is not an option you basically want to do the same thing in your build environment before packing up the installation. What can cause problems, or at least did in Julia 0.5 times, is if you have packages with binary dependencies with build scripts that set up absolute paths to the dll they depend on. I had to patch up a few such paths to make them relative instead. This may or may not still be a problem. If it is, a potential solution is if you can run their build scripts at post install time. I haven’t explored this with Julia 1.0 since the instantiation from manifest at end of install works fine in my setting.

---

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 1:50pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/13 "2019-01-13T13:50:28Z")

</div>

Thanks for very detailed reply!

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [January 13, 2019, 4:43pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/14 "2019-01-13T16:43:30Z")

</div>

Another option is to use Docker to pull proper OS and Julia binary images. Combine that with Project/Manifest.toml to ensure proper dependencies. This is super consistent and can run everywhere.

---

<div class="post-metadata">

### Author: ![vladimir](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@vladimir](https://discourse.julialang.org/u/vladimir)
#### Post date: [January 13, 2019, 5:45pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/15 "2019-01-13T17:45:18Z")

</div>

It’s not so popular in Windows world…

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [January 13, 2019, 8:10pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/16 "2019-01-13T20:10:36Z")

</div>

Popularity is not a reason to dismiss a reasonably well-established approach to bundling applications, their dependencies, and associated configurations. Docker works decently well in Windows via Docker-machine from what I hear.

You could also put your application in a VM and ship that; there’s plenty of precedent out there, even though it’s not the most efficient approach.

To expand on @tk3369 's suggested approach, there was some discussion about a related question here (permalinking my response because I consider it a solution to this problem as well):

> [@Easy packaging of a complete environment for running a course?](https://discourse.julialang.org/t/easy-packaging-of-a-complete-environment-for-running-a-course/19497/11):
>
> Why not just make your own depot, install all the packages you need within there (and instantiate or not depending on whether you want it to be tiny or huge), tar+gz or zip it and send it off to students? I don’t think you’re going to get around doing the initial precompile of all packages, but how much time does that really buy you anyway? 5 minutes maybe? Edit: Note that making your own depot is as simple as running JULIA\_DEPOT\_PATH=/my/depot/path julia and running ] up.

---

<div class="post-metadata">

### Author: ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)
#### Post date: [January 13, 2019, 11:32pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/17 "2019-01-13T23:32:52Z")

</div>

Unrelated: Do you have a link to that? I work with HPC also. For every package I run `@everywhere` I first `using Pkg` locally on the head node. This triggers the precompilation, where the compiled files are instantly copied over to the compute nodes by InfiniBand.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [January 14, 2019, 5:09pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/18 "2019-01-14T17:09:25Z")

</div>

Hello. Sorry - I did search and I cannot find that thread.  
Your technique sounds good, and I think it was similar to what was said in that thread.

---

<div class="post-metadata">

### Author: ![jair\_wuilloud](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jair_wuilloud/32/10896_2.png) [@jair\_wuilloud](https://discourse.julialang.org/u/jair_wuilloud)
#### Post date: [October 19, 2019, 4:18pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/19 "2019-10-19T16:18:47Z")

</div>

I am looking for examples of Julia successfully implemented IN PRODUCTION. Can somebody point me at examples or share positive/negative experience with Julia in Prod.?

---

<div class="post-metadata">

### Author: ![henry\_Kang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry_kang/32/27883_2.png) [@henry\_Kang](https://discourse.julialang.org/u/henry_Kang)
#### Post date: [August 5, 2021, 4:51pm UTC](https://discourse.julialang.org/t/delivering-julia-code-to-production-computers/19586/20 "2021-08-05T16:51:27Z")

</div>

Good answer
