mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-01-30 23:22:31 +00:00
updates to python and Django versions - online edit of handbook/troggle/troglaptop.html
This commit is contained in:
parent
d430be9ae1
commit
da93e53291
@ -39,7 +39,7 @@ http://expo.survex.com/repositories/troggle/.git/tree/README.txt
|
||||
|
||||
<h2 id="os">Installing linux</h2>
|
||||
<p>If you don't already know how to do this, then you should probably not be attempting to work on the troggle code. But in case you are an experienced linux user who has always had someone else set up the system for them, then Ubuntu is the easiest and more forgiving to install, either directly on the computer or inside WSL. Ubuntu installs python and various essential python dev tools by default.
|
||||
<p>The server is running fairly old, stable releases of Debian and Django, but you will probably want Ubuntu-22.04 which is compatible.
|
||||
<p>The server is running fairly old, stable releases of Debian and Django, but you will probably want Ubuntu-24.04 which is compatible.
|
||||
<ul>
|
||||
<li>Linux machine
|
||||
<ul>
|
||||
@ -47,12 +47,12 @@ http://expo.survex.com/repositories/troggle/.git/tree/README.txt
|
||||
</ul>
|
||||
<li>Windows 10 or 11 machine
|
||||
<ul>
|
||||
<li>In late 2022 a new way of installing and using WSL was announced, see <a href="https://www.theregister.com/2022/11/23/wsl_microsoft_store_default_version/">
|
||||
Windows Subsystem for Linux now packaged as a Microsoft Store app</a> so WSL documentation on this expo site has been revised.
|
||||
<li>In late 2022 you had to use the App Store <a href="https://www.theregister.com/2022/11/23/wsl_microsoft_store_default_version/">
|
||||
Windows Subsystem for Linux now packaged as a Microsoft Store app</a>,
|
||||
<lI>But in 2024 <a href="https://learn.microsoft.com/en-us/windows/wsl/install">it has changed again</a> and you just type <var>wsl --install</var>. at a terminal in Windows 11.
|
||||
<li>See our own expo page about <a href="../computing/wsllaptop.html">setting up a WSL Expo Laptop</a>
|
||||
<li>Install in <a href="https://docs.microsoft.com/en-us/windows/wsl/install">WSL on Windows 10/11</a>
|
||||
<li>[<em>obsolete</em> Install <a href="https://docs.microsoft.com/en-us/windows/wsl/install">Ubuntu 20.04 LTS</a> - can be done directly from wsl command line <var>wsl --install -d Ubuntu</var> ].
|
||||
<li>Install <a href="https://linuxconfig.org/ubuntu-22-04-on-wsl-windows-subsystem-for-linux">Ubuntu 22.04 LTS</a> - must be done using <a href="https://support.microsoft.com/en-us/account-billing/how-to-open-microsoft-store-on-windows-e080b85a-7c9e-46a7-8d8b-3e9a42e32de6">MS App Store</a>.
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
<p>Before you do anything else, get yourself set up with a <a href="../computing/keyexchange.html">key-pair</a> to access the software on the expo server properly.
|
||||
@ -68,8 +68,8 @@ Windows Subsystem for Linux now packaged as a Microsoft Store app</a> so WSL doc
|
||||
|
||||
<h3>WSL on Windows</h3>
|
||||
<p><p>
|
||||
Windows Subsystem for Linux now packaged as <a href="https://www.theregister.com/2022/11/23/wsl_microsoft_store_default_version/">a Microsoft Store app</a>, see above.
|
||||
<p>If you are using an 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 5 years old.
|
||||
|
||||
<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.
|
||||
|
||||
@ -80,11 +80,11 @@ and then <em>reboot your machine</em> as this doesn't seem to properly take effe
|
||||
See also <a href="https://learn.microsoft.com/en-us/windows/wsl/file-permissions">WSL File Permissions</a>.
|
||||
|
||||
<h3>Why no Docker container?</h3>
|
||||
<p>Yes, it is true that this would greatly speed up on-boarding new programmers.
|
||||
<p>Yes, it is true that this would greatly speed up on-boarding new programmers. Or <a href="https://podman.io/">podman</a>.
|
||||
<p>But there is the significant danger that containers would get copied around and deployed without being properly cleaned up:
|
||||
resulting in configuration drift and a <a href="https://martinfowler.com/bliki/SnowflakeServer.html">snowflake server situation</a>.
|
||||
File permissions are a big issue.
|
||||
<p>We should do both: create a Docker 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
|
||||
development system. We should copy that in the first instance. Alas, we haven't got around to doing any of this yet.
|
||||
|
||||
@ -155,8 +155,12 @@ environment (a 'venv'), not in the main linux system.
|
||||
|
||||
|
||||
<h3 id="venv">Installing a venv</h3>
|
||||
|
||||
<p>In over to avoid compatability issues when deploying our code, we should develop using the same libraries that will be used in prduction of expo.survex.com. Expo.survex.com currently uses python3.9.2, python 3.x is backwardly compatable as long as you do not use any new fuctions it should be fine. Venv allows us to specify which python libraries to use.</p>
|
||||
<p>[We are revising this process. In future we may be using uv instead of pip, see
|
||||
<a href="https://nielscautaerts.xyz/python-dependency-management-is-a-dumpster-fire.html">"dumpster fire".</a>
|
||||
]
|
||||
<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>
|
||||
|
||||
Create and activate the virtual enviroment:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user