180 lines
26 KiB
Plaintext
180 lines
26 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "view-in-github",
|
||
"colab_type": "text"
|
||
},
|
||
"source": [
|
||
"<a href=\"https://colab.research.google.com/github/geneweb/geneweb/blob/master/geneweb_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "_ukucGtwbeI0"
|
||
},
|
||
"source": [
|
||
"# Live test GeneWeb 7.xx exp\n",
|
||
"\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "_ksBSC1Ne5PV"
|
||
},
|
||
"source": [
|
||
"##Upload your Geneweb database\n",
|
||
"\n",
|
||
"\n",
|
||
"The file must be in **.gw format** at the root on your current Colab session. Use the Colab file import button (folder icon one on left) to import it.\n",
|
||
"Note that this Colab is a personnal temporary server and that everything including the imported database will be deleted if you stop to use it. It serves only for testing purpose.\n",
|
||
"\n",
|
||
""
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {
|
||
"cellView": "form",
|
||
"id": "jF_yIa6UbUwp"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"#@markdown #Type your database file name\n",
|
||
"#@markdown You need to fill the **basefile** input according to the database file you have uploaded.\n",
|
||
"basefile = 'mybase.gw' #@param {type:\"string\"}\n",
|
||
"\n",
|
||
"#@markdown Then execute all cells one by one with “>” button, including this one, or press Ctrl+F9 to execute them all."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "1gApp3nC27vo"
|
||
},
|
||
"source": [
|
||
"##Building Ocaml with Opam\n",
|
||
"\n",
|
||
"\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "a6ITFlOg1wEA"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"#Installing Ocaml environnement needed to build Geneweb (takes 15-20 min, be patient!)\n",
|
||
"!add-apt-repository -y ppa:avsm/ppa\n",
|
||
"!apt update\n",
|
||
"!apt install opam libgmp-dev xdot\n",
|
||
"!opam -y init --compiler=4.14.1\n",
|
||
"!eval $(opam env)\n",
|
||
"!opam install -y calendars.1.0.0 camlp-streams camlp5 cppo dune jingoo markup oUnit ppx_blob ppx_deriving ppx_import stdlib-shims syslog unidecode.0.2.0 uucp uutf uunf"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "OdVIltaiFADP"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"#[OPTIONAL] Verify installed versions of Ocaml and Opam versions, list Opam dependencies\n",
|
||
"!opam exec -- ocaml --version\n",
|
||
"!opam exec -- opam --version\n",
|
||
"!opam list"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "h3d_lUG-cXMK"
|
||
},
|
||
"source": [
|
||
"## Clone and build GeneWeb"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "ZdUDG0-zEycK"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"#Clone GeneWeb, checkout selected branch\n",
|
||
"!git clone https://github.com/geneweb/geneweb\n",
|
||
"!cd geneweb && opam exec -- ocaml ./configure.ml --sosa-legacy --release && opam exec -- make distrib"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "cij0oB2fe42d"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"#Import your Geneweb database. Log file stored in /bases/ if needed.\n",
|
||
"!cd geneweb/distribution/bases/ && ../gw/gwc -f ../../../$basefile -stats -cg > import.log"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "WE_b3wDIj6va"
|
||
},
|
||
"source": [
|
||
"## Lauch Geneweb server"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "gKpkYEtkhf0Y"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"# Show the URL of Geneweb server on this Colab environnement. Don’t click before the gwd server is launched (next step).\n",
|
||
"from google.colab.output import eval_js\n",
|
||
"print(eval_js(\"google.colab.kernel.proxyPort(2317)\"))"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "y5VrJTdlZ8GW"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"# Launch Geneweb server and clic on previous given Colab URL …-2317-colab.googleusercontent.com/ to test your database in live!\n",
|
||
"!cd geneweb/distribution/ && gw/gwd -hd gw -bd bases"
|
||
]
|
||
}
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"provenance": [],
|
||
"include_colab_link": true
|
||
},
|
||
"kernelspec": {
|
||
"display_name": "Python 3",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"name": "python"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 0
|
||
} |