# How correctly deploy code to another machine?

**URL:** <https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956>\
**Category:** New to Julia\
**Created:** [May 7, 2019, 10:20am UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956 "2019-05-07T10:20:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Post date:** [May 7, 2019, 10:20am UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956/1 "2019-05-07T10:20:42Z")

</div>

I am developing a package on my laptop. But I actually need it to run a server. So what I do is to test the code locally until it’s ready, and then rsync the package folder to the server.

It works when I first tried it yesterday. But now I made some new changes, synchronized the code again, and the modification does not work on the sever. It always runs the code from yesterday on the sever, even if I have checked the source code has been correctly synchronized.

I tried to delete .julia/complied/v1.1/mypackge. I tried to remove my own package from default environment and add it again. Nothing seems to work.

What can be the reason for such bizarre problem? I guess I must have messed up package system somehow.

I also see this line when I run update in package mode

```
Updating git-repo `/home/myname/somepahte/mypackage

```

Could it has something to do with git? I am using it to tracking my code and the .git folder in the package is also copied to the server.

What should be a proper way to synchronize code to another machine?

---

<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:** [May 7, 2019, 10:24am UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956/2 "2019-05-07T10:24:58Z")

</div>

You may find this discussion useful:

> [@Local & remote workflow](https://discourse.julialang.org/t/local-remote-workflow/17780):
>
> Suppose I have two machines, LAPTOP and SERVER. LAPTOP is resource-limited but convenient, SERVER is powerful but not super-convenient. Both run Linux, I have standard tools (and I can ask for other ones on SERVER, which is not under my control). My strategy for working on large problems is to develop a “toy” version on my laptop (eg using small simulated data, a subsample of the data, etc), which I can benchmark and test, until it is ready to run. Then I would like to continue working on the s…

TL;DR: I am using a repository with `Manifest.toml` committed for the project.

---

<div class="post-metadata">

**Author:** ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Post date:** [May 7, 2019, 10:42am UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956/3 "2019-05-07T10:42:26Z")

</div>

Yeah, l can also do that.

But do You register your package in the server’s home environment using Pkg.add(“yourpackage”)?

---

<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:** [May 7, 2019, 11:00am UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956/4 "2019-05-07T11:00:28Z")

</div>

Yes, I `pkg> add` the package (that has nothing to do with registration).

Basically my workflow is this: make sure it works on my laptop (tests pass, results with toy dataset look satisfactory, estimation converges for simulated data). Then I push to the repo (a private one on Gitlab), and just do a

```julia
pkg> up

```

on the server and I am ready to run the computation.

I e-mail myself (using a bash script calling `mailx`) when done and retrieve the results (also via git, in a separate repository, just a bunch of CSV files).

---

<div class="post-metadata">

**Author:** ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Post date:** [May 7, 2019, 12:27pm UTC](https://discourse.julialang.org/t/how-correctly-deploy-code-to-another-machine/23956/5 "2019-05-07T12:27:07Z")

</div>

Thanks. Now I see what’s wrong in my original attempt.

It’s not enough to have the code of the package updated on the remote server. Since the package has been added to the default environment, I need to run

```
pkg> up

```

Otherwise in the default environment, julia will run the old code.
