|
| 1 | +# Updating Rica Without Rerunning Tedana |
| 2 | + |
| 3 | +When tedana runs, it generates an `open_rica_report.py` script in the output directory. This script automatically downloads the latest Rica from GitHub every time it runs, so **you usually don't need to do anything special** — just run the script and it will self-update. |
| 4 | + |
| 5 | +This page explains how the update mechanism works and what to do in less common situations (offline use, pinning a specific version, or using a local build). |
| 6 | + |
| 7 | +## How `open_rica_report.py` Works |
| 8 | + |
| 9 | +Each time you run `open_rica_report.py`, it: |
| 10 | + |
| 11 | +1. Queries the GitHub API for the latest Rica release |
| 12 | +2. Compares it against the version cached at `~/Library/Caches/tedana/rica/` (macOS) or the platform equivalent |
| 13 | +3. Downloads `index.html` and `rica_server.py` if a newer version is available |
| 14 | +4. Copies the files into a `rica/` subdirectory of your tedana output folder |
| 15 | +5. Starts a local HTTP server and opens Rica at `http://localhost:8000/rica/index.html` |
| 16 | + |
| 17 | +So to get the latest Rica, simply run: |
| 18 | + |
| 19 | +```bash |
| 20 | +python open_rica_report.py |
| 21 | +``` |
| 22 | + |
| 23 | +## Forcing a Re-download |
| 24 | + |
| 25 | +If you suspect the cache is stale or want to guarantee a fresh download: |
| 26 | + |
| 27 | +```bash |
| 28 | +python open_rica_report.py --force-download |
| 29 | +``` |
| 30 | + |
| 31 | +This bypasses the version comparison and always downloads the latest release. |
| 32 | + |
| 33 | +## Offline / Air-Gapped Use |
| 34 | + |
| 35 | +When there is no network access, the script falls back to the last cached version automatically. You will see a warning like: |
| 36 | + |
| 37 | +``` |
| 38 | +[Rica] Warning: Could not check for updates (...) |
| 39 | +[Rica] Using cached version v2.1.5 |
| 40 | +``` |
| 41 | + |
| 42 | +No action is needed — Rica continues to work with the cached files. |
| 43 | + |
| 44 | +If you need to set up Rica on a machine that has never had network access, pre-populate the cache directory manually: |
| 45 | + |
| 46 | +| Platform | Cache Path | |
| 47 | +|----------|-----------| |
| 48 | +| macOS | `~/Library/Caches/tedana/rica/` | |
| 49 | +| Linux | `~/.cache/tedana/rica/` | |
| 50 | +| Windows | `%LOCALAPPDATA%\tedana\rica\` | |
| 51 | + |
| 52 | +Place `index.html`, `rica_server.py`, and a `VERSION` file (containing the version tag, e.g. `v2.1.5`) in that directory. Download these from the [Rica releases page](https://github.com/ME-ICA/rica/releases/latest). |
| 53 | + |
| 54 | +## Using a Local or Custom Build |
| 55 | + |
| 56 | +Set the `TEDANA_RICA_PATH` environment variable to a directory containing `index.html` and `rica_server.py`. The script will use those files directly and skip the GitHub download entirely. |
| 57 | + |
| 58 | +```bash |
| 59 | +export TEDANA_RICA_PATH=/path/to/your/rica/build |
| 60 | +python open_rica_report.py |
| 61 | +``` |
| 62 | + |
| 63 | +This is useful for: |
| 64 | + |
| 65 | +- Testing a development build of Rica against real tedana data |
| 66 | +- Pinning a specific version without auto-updates |
| 67 | +- Air-gapped environments where you manage files manually |
| 68 | + |
| 69 | +To build Rica from source: |
| 70 | + |
| 71 | +```bash |
| 72 | +git clone https://github.com/ME-ICA/rica.git |
| 73 | +cd rica |
| 74 | +npm install |
| 75 | +npm run build |
| 76 | +npx gulp |
| 77 | +# Built files are in build/ |
| 78 | +export TEDANA_RICA_PATH=/path/to/rica/build |
| 79 | +``` |
| 80 | + |
| 81 | +## Checking the Current Version |
| 82 | + |
| 83 | +The Rica version is shown in the **About** popup (the `(i)` button in the top-right corner). The version of the files installed in your output directory is also stored in `rica/VERSION`: |
| 84 | + |
| 85 | +```bash |
| 86 | +cat /path/to/tedana/output/rica/VERSION |
| 87 | +``` |
| 88 | + |
| 89 | +Compare this to the [latest release](https://github.com/ME-ICA/rica/releases/latest) to see if an update is available. |
| 90 | + |
| 91 | +## Troubleshooting |
| 92 | + |
| 93 | +### Port Already in Use |
| 94 | + |
| 95 | +If port 8000 is occupied, the script automatically tries the next available port. You can also specify one explicitly: |
| 96 | + |
| 97 | +```bash |
| 98 | +python open_rica_report.py --port 9000 |
| 99 | +``` |
| 100 | + |
| 101 | +### Browser Does Not Open Automatically |
| 102 | + |
| 103 | +Navigate manually to the URL printed in the terminal, or suppress auto-open and open it yourself: |
| 104 | + |
| 105 | +```bash |
| 106 | +python open_rica_report.py --no-open |
| 107 | +# Then open http://localhost:8000/rica/index.html |
| 108 | +``` |
| 109 | + |
| 110 | +### Script Can't Find tedana Output Files |
| 111 | + |
| 112 | +Make sure `open_rica_report.py` is in the tedana output directory (where the `*_metrics.tsv` files are). The script uses its own location to find data. |
| 113 | + |
| 114 | +See [Troubleshooting](troubleshooting.md) for more help. |
0 commit comments