From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id 8C3185D5 for ; Fri, 30 Mar 2018 14:13:36 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.48,382,1517871600"; d="asc'?scan'208";a="320736060" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 30 Mar 2018 16:13:34 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 50A7282417; Fri, 30 Mar 2018 16:13:34 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 53B9F8239C for ; Fri, 30 Mar 2018 16:12:13 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=louis.gesbert@ocamlpro.com; spf=None smtp.mailfrom=louis.gesbert@ocamlpro.com; spf=Pass smtp.helo=postmaster@mail.antislash.info IronPort-PHdr: =?us-ascii?q?9a23=3A5jqhsR8HzPjgk/9uRHKM819IXTAuvvDOBiVQ1KB4?= =?us-ascii?q?1escTK2v8tzYMVDF4r011RmVBd6ds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+55Pebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRh/2hi?= =?us-ascii?q?kaOTA382bXhc5+jK1UvB2svBN/z5LObYyPKPZyYqHQcNUHTmRBRMZRUClBD5u6?= =?us-ascii?q?YYsIEuoBPP1YpJT8qVQQthuxHhejBPnzyjRVgXL22ao60/kgEQHdxgAgEMwBsG?= =?us-ascii?q?/Po9rrLqcSTfu4zK7UwjrZavNW3S/96JLPchw7vf6MWrdwfNPXxEIyGQ3FiVCQ?= =?us-ascii?q?ppbkPzOTzukNvGmb7/ZgVeKykGErsR1+oj+qxsoql4LHhZoVx0jK+Ch72oo5ON?= =?us-ascii?q?61RUxhbdK6H5ZduDuWOoV3T84kXmpmojw1yqcctp6+ZCUKyIooxxrYa/GfdoiH?= =?us-ascii?q?+BPjVOKLLThignJlZLO/hw228Ue60e38VtO40FdMripLldnArnEN1xrN5cibUv?= =?us-ascii?q?Zw8EWs1SyS2w3Q6OxIO144mKXUJpI7zLM9l4IfsUHZES/3nEX2grWWdkIh+uWw?= =?us-ascii?q?7+TnZajmpp6HN4NuhQHxLL8uldehDuQiLggDRG+b9vim273m+U35WK9Kjvosnq?= =?us-ascii?q?bFt5DaINwXprSlDA9NzoYj9xG/Ai+639sCmHkHKEtJeBaGj4jyJ1HDO+v4DPe6?= =?us-ascii?q?g1S0ijhn3fHGPrv7ApXMNHfPirnhfawuo3JbnQE6yNQa45NPFpkAJujyUwn/ro?= =?us-ascii?q?/2FBg8Ziiz3uf8QPpwzYkTQ37HVqueLaLJ91CF/egiOfWkY4QcvTLlMf9j7Pnr?= =?us-ascii?q?2yxq0WQBdLWkiMNEIEuzGe5rdh3AMCjcx+wZGGJPhTIQCenjiVmMSzlWPirgWK?= =?us-ascii?q?k14zUjEoXgBoDGFNj03O6xmRyjF5gTXVhoT0iWGC60JYKPUvIIcDiVZMRml25c?= =?us-ascii?q?DOXze8oazRir8TTC5f9nI+7ToHRKsJvi0J584fHSjhU77jwyDsKT1DPUQg=3D?= =?us-ascii?q?=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DrAgA8Rb5a/yT0uyVdHQEBBQELAYQjb?= =?us-ascii?q?4QEiABejw0aimmBfoVqgXoIAyWEXwIIhDcFAgQwGAECAQEBAQEBAQEBaihCDgG?= =?us-ascii?q?BZiKCTAYjSxsLISECAg8BRzSEdgutYYIciEGCHwoFiTM/gQyCCEgGLoMRAgKEW?= =?us-ascii?q?jCCJAKXOAiBX4NykA6FA4kVhmaBJRw4gVIzGiNPgkQSgg0Xjhg9hEiLGwEB?= X-IPAS-Result: =?us-ascii?q?A0DrAgA8Rb5a/yT0uyVdHQEBBQELAYQjb4QEiABejw0aimm?= =?us-ascii?q?BfoVqgXoIAyWEXwIIhDcFAgQwGAECAQEBAQEBAQEBaihCDgGBZiKCTAYjSxsLI?= =?us-ascii?q?SECAg8BRzSEdgutYYIciEGCHwoFiTM/gQyCCEgGLoMRAgKEWjCCJAKXOAiBX4N?= =?us-ascii?q?ykA6FA4kVhmaBJRw4gVIzGiNPgkQSgg0Xjhg9hEiLGwEB?= X-IronPort-AV: E=Sophos;i="5.48,382,1517871600"; d="asc'?scan'208";a="320735737" Received: from antislash.info (HELO mail.antislash.info) ([37.187.244.36]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2018 16:12:12 +0200 From: Louis Gesbert To: caml-list@inria.fr Date: Fri, 30 Mar 2018 16:11:49 +0200 Message-ID: <4945274.q1Lr0Fu7B2@agaric> Organization: OCamlPro In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1938174.GVcTeVyNIl"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-Validation-by: louis.gesbert@ocamlpro.com Subject: Re: [Caml-list] Create a deployable application unit from OPAM? Reply-To: Louis Gesbert X-Loop: caml-list@inria.fr X-Sequence: 16762 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --nextPart1938174.GVcTeVyNIl Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" There is no perfect solution at the moment, as there are still some hiccups= with relocation of quite a few opam packages, but there are a few options: 1. Not precisely what you were asking for, since it involves re-compiling, = but opam-bundle=C2=B9 can generate an all-in-one package that can easily be= deployed to a different system and will bootstrap OCaml, opam, the package= s and their dependencies, and can put wrappers for the binaries to your PAT= H. This takes a while, but avoids any relocation problems and is quite reli= able. The bundle could also be used as base for a container, or even copied acros= s similar hosts (to the same location), and just the wrappers reinstalled. 2. opam 2.0 has an `opam install --destdir` option, that you could use to c= opy the installed artefacts of the required packages to some prefix (be sur= e to reinstall all the dependencies, or start from an empty switch). You co= uld then tar/gz that prefix, and copy it across hosts. 3. in a simpler way, you could just copy the opam switch across hosts. With= opam 2, all metadata is gathered in /.opam-switch/, so omit= that subdirectory and you just get a "normal" Linux prefix (i.e. with bin/= , lib/, etc. subdirectories). Of course, 2. and 3. can hit relocation issues, depending on what the packa= ges you are interested in use (e.g. ocsigenserver seems to have specific ne= eds). As Gerd mentionned, specifying `CAML_LD_LIBRARY_PATH` and `OCAMLPATH`= (and maybe a few others=C2=B2) may help. And none of these reduce the end result to "just the binaries needed", alth= ough 2. might help a little by letting you choose which packages get into t= he dest-prefix. I am not aware of a way to do this automatically. A vast su= per-appoximation could be to just ignore opam build-dependencies: `opam rei= nstall --destdir SOME_TEMP_PREFIX $(opam list --installed --rec --required-= by PACKAGES --nobuild --short)`, on the origin host, then package and ship = SOME_TEMP_PREFIX, possibly with wrappers to set the required PATH variables. These are just a few clues, but hope this helps! Louis Gesbert =E2=80=94 OCamlPro =C2=B9 https://github.com/AltGr/opam-bundle =C2=B2 https://github.com/ocaml/opam-repository/issues/10863#issuecomment-3= 47174662 > - Hans Ole Rafaelsen, 29/03/2018 18:31 - > Hi, >=20 > I have small application written using Ocsigen. Ocaml and the rest of the > development environment is installed using OPAM. >=20 > Now I want to install this application on a few other nodes, without havi= ng > to bring bring along the whole development process for deployment on each > node. What I want to end up with, is a single unit, e.g a tar-file, a > docker container or similar, that can be copied and deployed to the target > nodes. This unit should only contain the binaries needed to run the > application. >=20 > I have tried to ask on the Ocsigen mailing-list how do do this for Ocsigen > applications, but without success. But I guess the problem is more related > to how to deploy applications built using OPAM. I did not find any way to > do this with OPAM, but I might have missed something. I have tried to copy > all the binary files (.so, .cmxa .cmxs, etc) from the OPAM directory and > setting the environment variables to point the this new location, but > without much success. When starting ocsigenserver it was not able to solve > all symbols. Looking more into the problem, it looks like binaries such as > ocsigenserver has hard coded the location of the OPAM development > environment. Might be possible to override this using environment > variables, but I'm not sure how. So I gave up on this track. >=20 >=20 > Is there a way to generate such a deployable unit from OPAM development > environment? >=20 > Do anyone have some tips / best practice on how to deploy applications > built using OPAM? >=20 > (I'm developing and want to deploy on Ubuntu 16.04.) >=20 > Regards, >=20 > Hans Ole Rafaelsen >=20 >=20 --nextPart1938174.GVcTeVyNIl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEbvv1DIVPNISNNdcMGDmcR4apvJgFAlq+RaUACgkQGDmcR4ap vJh5ZQgAqIjb2atCE9xYyLa13MGQZTRHM5e81s1IVlmsS1rOh7Fxo3+BinXNw82E dBCfV9CvbtBvqj/a7xT9P1XAT9MIqC/4cB0NqY/B4XEYXet5CSoahOd+n32nNUF1 mp+YIkxvR1AM6Qcf3PAzb2eUXBqOoYqUyk04Th2Gg359B4ZyhBXu3NgsM/zQbfqh tzXwo7pwJFU7srPPOneridpBnFNx7Ef1CtsL/ZAszCmLgN/RrBKZv4i8uMIn8cCy Q0nVvg676Q71MaMwKmxTB+MmCC6ERXR3aap5G3x1mVGudkyNXR9UOvVPfrrwsSqt SbaTkviWZAS9vukocYZMWWgS07u3mQ== =EGjF -----END PGP SIGNATURE----- --nextPart1938174.GVcTeVyNIl--