Skip to content

Commit

Permalink
Split developer docs into per-OS files (#1305)
Browse files Browse the repository at this point in the history
* Split developer docs into per-OS files
* Add Linux instructions for silencing log spam

On Linux (only), Docker Desktop tends to spam the syslog with
debug-level messages about HTTP requests and responses. We should
provide instructions on how to silence that spam so Linux devs' /var
partitions don't fill up unexpectedly fast.

* Move installation summary back into main README

This removes some of the redundancy between the OS-specific files and
the main one.

We also note that the Mac instructions are likely incomplete.
  • Loading branch information
rmunn authored Jan 15, 2025
1 parent 68e8119 commit b55bffd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 23 deletions.
29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,19 @@ There are some exceptions:

## Development

Summary of setup steps below. See the appropriate file for your operating system for more details:

* [Windows](docs/DEVELOPER-win.md)
* [Linux](docs/DEVELOPER-linux.md)
* [Mac](docs/DEVELOPER-osx.md)

### Prerequisites
* docker and compose
* enable Kubernetes in the Docker Desktop settings

### Setup
* install [Taskfile](https://taskfile.dev/installation/)
* windows: `winget install Task.Task`
* linux: `sudo snap install task --classic` or other options on their website
* mac: `brew install go-task/tap/go-task`
* via npm: `npm install -g @go-task/cli`
* install [Tilt](https://docs.tilt.dev/) and add it to your path (don't forget to read the script before running it)
* on Linux, the script will install tilt into `$HOME/.local/bin`, creating it if it doesn't exist
* most Linux distributions put `$HOME/.local/bin` in your PATH automatically. If `tilt version` doesn't work, log out and log back in and it should work; otherwise you'll need to add it to your PATH in `$HOME/.bashrc` or equivalent.
* on Windows, the Tilt installer will create a `bin` folder in your home folder and put the Tilt binary there
* you will then need to do the following to make sure the Tilt binary is in your PATH:
* go to your System properties, click the **Advanced** tab, and click **Environment Variables...**
* Click the Path variable (in either User or System, User is recommended) and click the **Edit...** button
* Add `C:\Users\YOUR_USER_NAME\bin` to the list (if it's not already there) and click **OK**
* run `tilt version` to check that Tilt is installed correctly
* clone the repo
* run `git push` to make sure your GitHub credentials are set up
Expand All @@ -48,18 +43,6 @@ There are some exceptions:
* checks out Git submodules
* downloads the FLEx repo for the project seed data

#### Extra setup steps for Windows

If you're running Windows, you may need to add the following lines to your `C:\Windows\system32\drivers\etc\hosts` file:

```
127.0.0.1 resumable.localhost
127.0.0.1 hg.localhost
127.0.0.1 admin.localhost
```

On Linux, anything with a `.localhost` domain is automatically mapped to 127.0.0.1 so you don't need to edit your `/etc/hosts` file.

### Kubernetes workflow

```bash
Expand Down
22 changes: 22 additions & 0 deletions docs/DEVELOPER-linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Prerequisites
* [Docker Desktop for Linux](https://docs.docker.com/desktop/setup/install/linux/) (provides docker and compose)
* using native docker can lead to permissions issues with shared volumes, and some of our code (e.g. the Tiltfile) assumes you're running Docker Desktop
* enable Kubernetes in the Docker Desktop settings

### Setup details
* to install [Taskfile](https://taskfile.dev/installation/):
* `sudo snap install task --classic` or other options on their website
* Or via npm: `npm install -g @go-task/cli`
* to install [Tilt](https://docs.tilt.dev/) (don't forget to read the script before running it):
* the script will install tilt into `$HOME/.local/bin`, creating it if it doesn't exist
* most Linux distributions put `$HOME/.local/bin` in your PATH automatically
* if `tilt version` doesn't work, try running `source $HOME/.bashrc`, or log out and log back in
* optional but recommended: turn off logging for Docker Desktop
* Docker Desktop's default is to log verbose messages to stderr, which by default gets sent to the systemd journal and/or /var/log/syslog
* This can result in your /var partition filling up fast (one developer saw his syslog grow by multiple gigabytes in a single week)
* To silence Docker Desktop logs, create the following drop-in at `$HOME/.config/systemd/user/docker-desktop.service.d/stop-log-spam.conf`:
```
[Service]
StandardError=null
```
* This file can be named anything as long as it ends in `.conf` and is in the correct directory, e.g. `override.conf` would work. The directory must be named exactly as shown.
10 changes: 10 additions & 0 deletions docs/DEVELOPER-osx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Prerequisites
* docker and compose
* enable Kubernetes in the Docker Desktop settings

### Setup details
* install [Taskfile](https://taskfile.dev/installation/)
* `brew install go-task/tap/go-task` should do it
* Or via npm: `npm install -g @go-task/cli`

None of the current Lexbox developers use OS X, so the above is likely incomplete. If there is anything missing in these setup details, please [open a PR](https://github.com/sillsdev/languageforge-lexbox/pulls) to fill in the missing steps.
21 changes: 21 additions & 0 deletions docs/DEVELOPER-win.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Prerequisites
* docker and compose
* enable Kubernetes in the Docker Desktop settings

### Setup details
* to install [Taskfile](https://taskfile.dev/installation/):
* `winget install Task.Task` should do it
* Or via npm: `npm install -g @go-task/cli`
* to install [Tilt](https://docs.tilt.dev/) and add it to your path:
* the Tilt installer will create a `bin` folder in your home folder and put the Tilt binary there
* you may then need to add `C:\Users\YOUR_USER_NAME\bin` to your PATH
* open PowerShell and run `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned`
* this is necessary before running `task setup`, which uses a PowerShell script to download seed data
* run `task setup` as per main instructions
* add the following lines to your `C:\Windows\system32\drivers\etc\hosts` file:

```
127.0.0.1 resumable.localhost
127.0.0.1 hg.localhost
127.0.0.1 admin.localhost
```

0 comments on commit b55bffd

Please sign in to comment.