|
1 | 1 | # ws-availability v1.1.0-beta.1 — Install |
2 | 2 |
|
3 | | -Beta release. API-compatible with v1.0.5. Default behavior unchanged unless you opt in via env vars. |
| 3 | +Beta release. API-compatible with v1.0.5. |
4 | 4 |
|
5 | 5 | ## Prerequisites |
6 | 6 |
|
7 | | -- Docker with the `docker-compose` v1.x (or `docker compose` v2) plugin. |
8 | | -- Running WFCatalog MongoDB ≥ 4.2 reachable from the host. |
| 7 | +- Docker with `docker-compose` (v1) or `docker compose` (v2). |
| 8 | +- WFCatalog MongoDB ≥ 4.2 reachable from the host. |
9 | 9 | - Port 9001 free on the host. |
10 | | -- ~2 GB RAM. |
11 | 10 |
|
12 | 11 | ## Install |
13 | 12 |
|
14 | | -Set two shell variables once. Replace `<your_node>` with a short tag (`noa`, `resif`, `orfeus`, …). |
| 13 | +`cd` into your `ws-availability` checkout (or `git clone https://github.com/EIDA/ws-availability.git` if you don't have one yet), then: |
15 | 14 |
|
16 | | -```bash |
17 | | -export WSAVAIL_DIR=/path/to/your/ws-availability/checkout # adjust |
18 | | -export NODE_TAG=<your_node> # adjust |
19 | | -``` |
20 | | - |
21 | | -1. Back up. |
22 | | - |
23 | | - ```bash |
24 | | - cd "$WSAVAIL_DIR" |
25 | | - cp config.py "$HOME/config.py.pre-1.1.0-beta.bak" 2>/dev/null || true |
26 | | - crontab -l > "$HOME/crontab.pre-1.1.0-beta.bak" 2>/dev/null || true |
27 | | - git rev-parse HEAD > "$HOME/ws-availability.pre-1.1.0-beta.commit" 2>/dev/null || true |
28 | | - ``` |
29 | | - |
30 | | -2. Check out the beta. |
| 15 | +1. Check out the beta. |
31 | 16 |
|
32 | 17 | ```bash |
33 | 18 | git fetch --tags origin |
34 | 19 | git checkout v1.1.0-beta.1 |
35 | 20 | ``` |
36 | 21 |
|
37 | | -3. Set the per-node Sentry tag. |
38 | | - |
39 | | - ```bash |
40 | | - echo "SENTRY_ENVIRONMENT=${NODE_TAG}_production" > .env |
41 | | - ``` |
42 | | - |
43 | | -4. If this is a first install, copy and edit `config.py`. (Skip on upgrade — your existing `config.py` is kept.) |
44 | | - |
45 | | - ```bash |
46 | | - cp config.py.sample config.py |
47 | | - $EDITOR config.py |
48 | | - ``` |
49 | | - |
50 | | -5. Build images. |
| 22 | +2. `config.py` — keep your existing one if you already have it; otherwise copy the sample and edit: |
51 | 23 |
|
52 | 24 | ```bash |
53 | | - docker-compose build api cacher |
| 25 | + [ -f config.py ] || cp config.py.sample config.py |
| 26 | + $EDITOR config.py # set MONGODB_*, FDSNWS_STATION_URL, SENTRY_DSN |
54 | 27 | ``` |
55 | 28 |
|
56 | | -6. Replace the API container. |
| 29 | +3. Set your node's Sentry tag (replace `noa` with your node short name): |
57 | 30 |
|
58 | 31 | ```bash |
59 | | - docker-compose up -d --no-deps --build api |
| 32 | + echo "SENTRY_ENVIRONMENT=noa_production" > .env |
60 | 33 | ``` |
61 | 34 |
|
62 | | -7. Replace the cacher container. |
| 35 | +4. Build and start. |
63 | 36 |
|
64 | 37 | ```bash |
65 | | - docker-compose up -d --no-deps --build cacher |
| 38 | + docker-compose build |
| 39 | + docker-compose up -d |
66 | 40 | ``` |
67 | 41 |
|
68 | | - Wait for the cacher startup tasks to finish: |
69 | | - |
70 | | - ```bash |
71 | | - docker logs -f fdsnws-availability-cacher 2>&1 | grep --line-buffered -E "Scheduler started|ERROR|Traceback" |
72 | | - ``` |
73 | | - |
74 | | - Stop tailing (`Ctrl-C`) once you see `Scheduler started`. |
75 | | - |
76 | | -8. If your node had a host cron triggering `views/main.js`, remove it. It is now redundant. |
| 42 | +5. If your node had a host cron triggering `views/main.js`, remove it — it's now redundant. |
77 | 43 |
|
78 | 44 | ```bash |
79 | 45 | crontab -l | grep -v "ws-availability.*views.*main.js" | crontab - |
80 | 46 | ``` |
81 | 47 |
|
82 | 48 | ## Verify |
83 | 49 |
|
84 | | -Replace `<known_net>` and `<known_sta>` with one of your live stations. |
| 50 | +Replace `<net>` and `<sta>` with one of your live stations. |
85 | 51 |
|
86 | 52 | ```bash |
87 | 53 | curl -s http://127.0.0.1:9001/version |
88 | 54 | # expected: 1.1.0-beta.1 |
89 | 55 |
|
90 | 56 | curl -s -o /dev/null -w "%{http_code}\n" \ |
91 | | - "http://127.0.0.1:9001/extent?net=<known_net>&sta=<known_sta>&start=2024-01-01&end=2024-01-02" |
| 57 | + "http://127.0.0.1:9001/extent?net=<net>&sta=<sta>&start=2024-01-01&end=2024-01-02" |
92 | 58 | # expected: 200 |
93 | 59 |
|
94 | | -curl -s -o /dev/null -w "%{http_code}\n" "http://127.0.0.1:9001/extent?network=<known_net>" |
| 60 | +curl -s -o /dev/null -w "%{http_code}\n" "http://127.0.0.1:9001/extent?network=<net>" |
95 | 61 | # expected: 413 |
96 | 62 |
|
97 | 63 | docker exec fdsnws-availability-api env | grep SENTRY_ENVIRONMENT |
98 | | -# expected: SENTRY_ENVIRONMENT=<your_node>_production |
| 64 | +# expected: SENTRY_ENVIRONMENT=noa_production |
99 | 65 | ``` |
100 | 66 |
|
101 | 67 | ## Rollback |
102 | 68 |
|
103 | 69 | ```bash |
104 | | -cd "$WSAVAIL_DIR" |
105 | 70 | git checkout v1.0.5 |
106 | 71 | rm -f .env |
107 | | -docker-compose build api cacher |
108 | | -docker-compose up -d --no-deps api cacher |
109 | | -crontab "$HOME/crontab.pre-1.1.0-beta.bak" |
| 72 | +docker-compose build |
| 73 | +docker-compose up -d |
110 | 74 | ``` |
0 commit comments