mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2024-12-18 14:32:23 +00:00
os-trog and venv-trog initial documn. - online edit of handbook/troggle/troglaptop.html [PosixPath('/home/philip/expo/expoweb/handbook/troggle/troglaptop.html')]
This commit is contained in:
parent
8e2e60621c
commit
d87db3ed82
@ -66,41 +66,38 @@ Windows Subsystem for Linux now packaged as a Microsoft Store app</a>,
|
|||||||
<li>~/expo/expoweb
|
<li>~/expo/expoweb
|
||||||
<li>~/expo/drawings
|
<li>~/expo/drawings
|
||||||
<li>~/expo/loser<br><br>
|
<li>~/expo/loser<br><br>
|
||||||
<li>~/expo/p13d5/ - python3.13 Django 5 (dev)
|
<li>~/expo/.venv/ - virtual environment
|
||||||
<li>~/expo/p11d3/ - python3.11 Django 3.2 (server mimic)
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<p>The install script (see below) will create the dev and server-mimic folders which will be virtual environments.
|
<p>The install script (see below) will create the virtual environment.
|
||||||
<p>Before the install scripts work on a bare Ubuntu installation, you will need to have git installed. This is in-built on Ubuntu 24.04 but on other (and earlier) Linux distros you will need to do:
|
<p>Before the install scripts work on a bare Ubuntu installation, you will need to have git installed. This is in-built on Ubuntu 24.04 but on other (and earlier) Linux distros you will need to do:
|
||||||
<br><var>sudo apt intall git</var>
|
<br><var>sudo apt intall git</var>
|
||||||
<br> manually.
|
<br> manually.
|
||||||
|
|
||||||
<p>There are two scripts in the <var>troggle</var> folder which will do semi-automatically what is described below. Have a look at
|
<p>There are two scripts in the <var>troggle</var> folder which will do semi-automatically what is described below. Have a look at
|
||||||
<ul>
|
<ul>
|
||||||
<li><var>os-trog.sh</var>
|
<li><var>os-trog24.04.sh</var>
|
||||||
<li><var>venv-trog.sh</var>
|
<li><var>venv-trog.sh</var>
|
||||||
</ul>
|
</ul>
|
||||||
which you can read without installing by looking at:<br>
|
which you can read without installing by looking in:<br>
|
||||||
|
<a href="https://expo.survex.com/repositories/troggle/.git/tree/_deploy/wsl">troggle/.git/tree/_deploy/wsl</a>.
|
||||||
|
|
||||||
|
|
||||||
<p>You will run <var>os-trog.sh</var> just once to install the basics, but you will run <var>venv-trog.sh</var> every time you fire up a new python version/django version combination or play with the versions of the imported packages as listed in <var>requirements.txt</var>.
|
<p>You will run <var>os-trog24.04.sh</var> just once to install the basics,and you will run <var>venv-trog.sh</var> just once initially.
|
||||||
|
<p>We have two configurations for the virtual environment: 'dev' which uses the latest python and Django for speed, and 'server' which mimics the versions currently running on the server. In December 2024 Django is 5 releases ahead of the version on the server (5.1 versus 3.2). Each has a list of ancilliary packages with the appropriate versions in dev.toml and server.toml.
|
||||||
|
|
||||||
<p><var>os-trog.sh</var> takes a few minutes initially, but then about an hour when it installs therion and tunnel as these drag in a huge number of dependencies.
|
<p><var>os-trog.sh</var> takes a few minutes initially, but then about an hour when it installs therion and tunnel as these drag in a huge number of dependencies.
|
||||||
<h3>Files and directories</h3>
|
<h3>Files and directories</h3>
|
||||||
<p>Do familiarise yourself with the directory structure on the expo server, which we will be duplicating (partly) as docmented in <a href="serverconfig.html">The Expo Server</a>. We are not here doing a full install of all the software and scripts on the server, just the minimum to run, test and debug troggle on Django. These will be setup for you by <var>venv-trog.sh</var>.
|
<p>Do familiarise yourself with the directory structure on the expo server, which we will be duplicating (partly) as docmented in <a href="serverconfig.html">The Expo Server</a>. We are not here doing a full install of all the software and scripts on the server, just the minimum to run, test and debug troggle on Django.
|
||||||
|
|
||||||
<h3>WSL on Windows</h3>
|
<h3>WSL on Windows</h3>
|
||||||
<p>[You will need to read this is you are doing anything even very slightly off the beaten tracke: <a href="../computing/wsllaptop.html">WSL/Troggle</a>].<p>
|
<p>[You will need to read this is you are doing anything even very slightly off the beaten tracke: <a href="../computing/wsllaptop.html">WSL/Troggle</a>].<p>
|
||||||
|
|
||||||
<p>If you are using a very old laptop, you may have to run Ubuntu in WSL1 rather than WSL2. WSL2 requires virtualisation features that your hardware may not support if it is more than about 10 years old.
|
|
||||||
<p>The standard documentation for Ubuntu or debian below all works, but you should first skim the
|
|
||||||
<a href="../computing/winlaptop.html">Windows expo laptop</a> configuration too. <em>So far as expo software</em> is concerned, WSL1 and WSL2 behave identically. <p>...Except for file permissions, which can cost you a day of frustration if you are unlucky.
|
|
||||||
|
|
||||||
The trick is to make sure that all the files in your development folders, e.g. <var>C:\expo\</var> which contains your repos e.g. <var>C:\expo\troggle\</var> are owned in the Windows system by the default Windows user e.g. <var>MACHINENAME\philip</var> and owned in the Linux system e.g. <var>/mnt/c/expo/</var> by the default Linux user, e.g. <var>philip:philip</var> using <br><var>sudo chown -Rhv philip:philip *</var>
|
<p>The standard documentation for Ubuntu or debian below all works, but you should first skim the
|
||||||
<br>
|
<a href="../computing/winlaptop.html">Windows expo laptop</a> configuration too.
|
||||||
and then <em>reboot your machine</em> as this doesn't seem to properly take effect until you do that.
|
|
||||||
<p>
|
|
||||||
See also <a href="https://learn.microsoft.com/en-us/windows/wsl/file-permissions">WSL File Permissions</a>.
|
|
||||||
|
|
||||||
<h3>Why no Docker container?</h3>
|
<h3>Why no Docker container?</h3>
|
||||||
<p>Yes, it is true that this would greatly speed up on-boarding new programmers. Or <a href="https://podman.io/">podman</a>.
|
<p>Yes, it is true that this would greatly speed up on-boarding new programmers. Or <a href="https://podman.io/">podman</a>.
|
||||||
@ -109,10 +106,14 @@ resulting in configuration drift and a <a href="https://martinfowler.com/bliki/S
|
|||||||
File permissions are a big issue.
|
File permissions are a big issue.
|
||||||
<p>We should do both: create a Docker or Podman system for getting started, then transition programmers to script-based or recipe-based
|
<p>We should do both: create a Docker or Podman system for getting started, then transition programmers to script-based or recipe-based
|
||||||
provisioning so that systems are rebuilt cleanly. <a href="http://www.cuyc.org.uk">CUYC</a> (who also use Django) have a bash script which sets up a new django
|
provisioning so that systems are rebuilt cleanly. <a href="http://www.cuyc.org.uk">CUYC</a> (who also use Django) have a bash script which sets up a new django
|
||||||
development system. We should copy that in the first instance. Alas, we haven't got around to doing any of this yet.
|
development system. We should copy that in the first instance. Alas, we haven't got around to doing any of this yet. However <var>uv</var> now makes everything much, much simpler than when were were using <var>pip</var>.
|
||||||
|
|
||||||
<h2 id="git">Configuring ubuntu</h2>
|
<h2 id="git">Configuring ubuntu</h2>
|
||||||
|
<p>In your home folder run <br>
|
||||||
|
~$ <var>bash os-trog24.04.sh</var>
|
||||||
|
<br>copy it from the .git repo online to get hold of it.
|
||||||
|
|
||||||
|
<!--
|
||||||
<pre><code>sudo apt install python3 python3-pip -y
|
<pre><code>sudo apt install python3 python3-pip -y
|
||||||
sudo apt install sqlite3 sqlite3-doc -y
|
sudo apt install sqlite3 sqlite3-doc -y
|
||||||
sudo apt install survex -y
|
sudo apt install survex -y
|
||||||
@ -124,8 +125,8 @@ sudo apt install software-properties-common -y
|
|||||||
sudo apt install default-jdk -y
|
sudo apt install default-jdk -y
|
||||||
sudo apt install binutils binfmt-support -y
|
sudo apt install binutils binfmt-support -y
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
-->
|
||||||
|
|
||||||
<h2 id="git">Configuring git</h2>
|
|
||||||
<h4>key exchange</h4>
|
<h4>key exchange</h4>
|
||||||
<p>You need this so that you can upload your edited code to the git repo on the server.
|
<p>You need this so that you can upload your edited code to the git repo on the server.
|
||||||
<p>Follow this link to <a href="../computing/keyexchange.html">register a key with the expo server</a> to get git access if you have
|
<p>Follow this link to <a href="../computing/keyexchange.html">register a key with the expo server</a> to get git access if you have
|
||||||
@ -159,12 +160,7 @@ confusing and apparently inconsistent behaviour: e.g. you will upload a file but
|
|||||||
|
|
||||||
<p>You can, if you like, have the expo photo archive collection somewhere else, not inside <var>expofiles</var>, on a troggle development machine. To do this set the PHOTOS_ROOT appropriately in <var>troggle/localsettings.py</var>. By default it is <var>PHOTOS_ROOT = EXPOFILES / 'photos'</var>. This is handy if you want everything else in expofiles in your Linux home drive for speed, but don't care about speed for the 29GB of photos which can sit on an SDdrive.
|
<p>You can, if you like, have the expo photo archive collection somewhere else, not inside <var>expofiles</var>, on a troggle development machine. To do this set the PHOTOS_ROOT appropriately in <var>troggle/localsettings.py</var>. By default it is <var>PHOTOS_ROOT = EXPOFILES / 'photos'</var>. This is handy if you want everything else in expofiles in your Linux home drive for speed, but don't care about speed for the 29GB of photos which can sit on an SDdrive.
|
||||||
|
|
||||||
<h2>Getting a copy of live javascript libraries</h2>
|
|
||||||
|
|
||||||
To get the same javascript libraries as the expo server:
|
|
||||||
|
|
||||||
<pre><code>scp -r expo@expo.survex.com:/usr/share/javascript/ ~/expo/troggle/javascript/
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
|
|
||||||
<h2 id="python">Installing python libraries</h2>
|
<h2 id="python">Installing python libraries</h2>
|
||||||
@ -178,8 +174,8 @@ environment (a 'venv'), not in the main linux system.
|
|||||||
|
|
||||||
|
|
||||||
<h3 id="venv">Installing a venv</h3>
|
<h3 id="venv">Installing a venv</h3>
|
||||||
<p>[We are revising this process. In future we may be using uv instead of pip, see
|
<p>[We are revising this process. We are now (December 2024) using uv instead of pip, see
|
||||||
<a href="https://nielscautaerts.xyz/python-dependency-management-is-a-dumpster-fire.html">"dumpster fire".</a>
|
<a href="https://nielscautaerts.xyz/python-dependency-management-is-a-dumpster-fire.html">"dumpster fire".</a>. DOCUMENTATION HERE NEEDS UPDATING URGENTLY, we do NOT use REQUIREMENTS.TXT
|
||||||
]
|
]
|
||||||
<p>In order to avoid compatability issues when deploying our code, we should develop using the same libraries that will be used in production of expo.survex.com. Expo.survex.com currently uses python 3.11.2, python 3.12 (standard with Ubuntu 24.04) is backwardly compatable as long as you do not use any new functions it should be fine. Venv allows us to specify which python libraries to use.</p>
|
<p>In order to avoid compatability issues when deploying our code, we should develop using the same libraries that will be used in production of expo.survex.com. Expo.survex.com currently uses python 3.11.2, python 3.12 (standard with Ubuntu 24.04) is backwardly compatable as long as you do not use any new functions it should be fine. Venv allows us to specify which python libraries to use.</p>
|
||||||
<p>[We also develop with Django 5 even though the server is still running Django 3.2, but so long as we are carefule, and test code before pushng to the server, this is fine.]
|
<p>[We also develop with Django 5 even though the server is still running Django 3.2, but so long as we are carefule, and test code before pushng to the server, this is fine.]
|
||||||
@ -457,6 +453,15 @@ sudo apt install libmariadbclient-dev
|
|||||||
pip install mariadb
|
pip install mariadb
|
||||||
</pre>
|
</pre>
|
||||||
wwhich now has installed mariadb python stuff, but seems to have trashed my django installattion. Hmph. And pip.
|
wwhich now has installed mariadb python stuff, but seems to have trashed my django installattion. Hmph. And pip.
|
||||||
|
|
||||||
|
<h2>Getting a copy of live javascript libraries</h2>
|
||||||
|
|
||||||
|
To get the same javascript libraries as the expo server:
|
||||||
|
|
||||||
|
<pre><code>scp -r expo@expo.survex.com:/usr/share/javascript/ ~/expo/troggle/javascript/
|
||||||
|
</code></pre>
|
||||||
|
but you don't need these for most troggle development: copies of what is needed are in the troggle git repo. One example that is not in the troggle git repo is <a href="https://aardgoose.github.io/CaveView.js/installation.html">"CaveView"</a>.
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
Go on to: <a href="trogarch.html">Troggle architecture</a><br />
|
Go on to: <a href="trogarch.html">Troggle architecture</a><br />
|
||||||
@ -464,5 +469,9 @@ Go on to: <a href="trogarch.html">Troggle architecture</a><br />
|
|||||||
Return to: <a href="trognotes.html">Troggle programmers' guide</a><br />
|
Return to: <a href="trognotes.html">Troggle programmers' guide</a><br />
|
||||||
Troggle index:
|
Troggle index:
|
||||||
<a href="trogindex.html">Index of all troggle documents</a><br />
|
<a href="trogindex.html">Index of all troggle documents</a><br />
|
||||||
|
Go to: ※ <a href="basiclaptop.html">Basic laptop</a><br />
|
||||||
|
Go to: ⁂ <a href="surveylaptop.html">Survey laptop</a><br />
|
||||||
|
Go to: ☯ <a href="winlaptop.html">Windows Bulk Update laptop</a><br />
|
||||||
|
Go to: ⚒ <a href="troglaptop.html">Troggle development laptop</a><br />
|
||||||
<hr /></body>
|
<hr /></body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user