You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,7 +45,7 @@ as well as to the `--help` text for each tool.
45
45
46
46
> 💡 We accept pull requests on GitHub. If you want to submit a new feature or a bug fix, then create a GitHub account, [make a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) of the [origin repository `nextstrain/nextclade`](https://github.com/nextstrain/nextclade) and clone your forked repository instead. Refer to [GitHub documentation "Contributing to projects"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) for more details.
47
47
48
-
> 💡 Make sure you [keep your local code up to date](https://github.com/git-guides/git-pull) with the origin repo, [especially if it's forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).
48
+
> 💡 Make sure you [keep your local code up to date](https://github.com/git-guides/git-pull) with the origin repo, [especially if it's forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).
49
49
50
50
> 💡 If you are a member of Nextstrain team, then you don't need a fork and you can contribute directly to the origin repository. Still, in most cases, please submit pull requests for review, rather than pushing changes to major branches directly.
51
51
@@ -76,56 +76,56 @@ as well as to the `--help` text for each tool.
76
76
77
77
The only supported Rust version is the one declared in [`rust-toolchain.toml`](https://github.com/nextstrain/nextclade/blob/master/rust-toolchain.toml) (currently **1.92.0**).
78
78
79
-
```bash
80
-
# Install Rustup, the Rust version manager
81
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
79
+
```bash
80
+
# Install Rustup, the Rust version manager
81
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
82
82
83
-
# Add Rust tools to the $PATH
84
-
export PATH="$PATH:$HOME/.cargo/bin"
83
+
# Add Rust tools to the $PATH
84
+
export PATH="$PATH:$HOME/.cargo/bin"
85
85
86
-
# Check your installed versions
87
-
rustc -V
88
-
cargo -V
89
-
rustup -V
90
-
```
86
+
# Check your installed versions
87
+
rustc -V
88
+
cargo -V
89
+
rustup -V
90
+
```
91
91
92
92
> ⚠️ Nextclade team doesn't have bandwidth to support Rust installations deviating from the [officially recommended steps](https://doc.rust-lang.org/book/ch01-01-installation.html) and Rust versions different from what is declared in [rust-toolchain.toml](https://github.com/nextstrain/nextclade/blob/master/rust-toolchain.toml). If you install Rust from Linux package repositories, Homebrew, Conda etc., things may or may not work, or they may work but produce wrong results. Nextclade team doesn't have bandwidth to try every platform and config, so if you decide to go unofficial route, then you are on your own. But feel free to open pull requests if fixes are necessary to make your setup work.
93
93
94
94
> 💡 Note, Rustup allows to install multiple versions of Rust and to switch between them. This repository contains a [rust-toolchain.toml](https://github.com/nextstrain/nextclade/blob/master/rust-toolchain.toml) file, which describes which version of Rust is currently in use by Nextclade official build. Cargo and Rustup should be able to [pick it up automatically](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file), install the required toolchain and use it when you type `cargo` commands. Any other versions of Rust toolchain are not supported.
95
95
96
96
4. Prepare environment variables (once). They configure Nextclade build-time settings. Optionally adjust the variables in the `.env` file to your needs.
97
97
98
-
```bash
99
-
cp .env.example .env
100
-
```
98
+
```bash
99
+
cp .env.example .env
100
+
```
101
101
102
102
5. Build and run Nextclade CLI in debug mode (convenient for development - faster to build, slow to run, has more debug info in the executable, error messages are more elaborate):
103
103
104
-
```bash
105
-
# (Re-)build Nextclade in debug mode.
106
-
# By default, the resulting executable will be in `target/debug/nextclade`.
107
-
cargo build --bin=nextclade
108
-
109
-
# (Re-)build Nextclade in debug mode and run `nextclade --help` to print
110
-
# Nextclade CLI main help screen. The arguments after the `--` are passed
111
-
# to nextclade executable, as if you'd run it directly.
112
-
# Refer to Nextclade user documentation for explanation of arguments.
113
-
cargo run --bin=nextclade -- --help
114
-
115
-
# (Re-)build Nextclade in debug mode and use it to download a dataset to
116
-
# `data_dev/` directory.
117
-
cargo run --bin=nextclade -- dataset get \
118
-
--name='sars-cov-2' \
119
-
--output-dir='data_dev/sars-cov-2'
120
-
121
-
# (Re-)build Nextclade in debug mode and run the analysis using the
122
-
# dataset we just downloaded (to `data_dev/`) and output results to
123
-
# the `out/` directory.
124
-
cargo run --bin=nextclade -- run \
125
-
'data_dev/sars-cov-2/sequences.fasta' \
126
-
--input-dataset='data_dev/sars-cov-2/' \
127
-
--output-all='out/'
128
-
```
104
+
```bash
105
+
# (Re-)build Nextclade in debug mode.
106
+
# By default, the resulting executable will be in `target/debug/nextclade`.
107
+
cargo build --bin=nextclade
108
+
109
+
# (Re-)build Nextclade in debug mode and run `nextclade --help` to print
110
+
# Nextclade CLI main help screen. The arguments after the `--` are passed
111
+
# to nextclade executable, as if you'd run it directly.
112
+
# Refer to Nextclade user documentation for explanation of arguments.
113
+
cargo run --bin=nextclade -- --help
114
+
115
+
# (Re-)build Nextclade in debug mode and use it to download a dataset to
116
+
# `data_dev/` directory.
117
+
cargo run --bin=nextclade -- dataset get \
118
+
--name='sars-cov-2' \
119
+
--output-dir='data_dev/sars-cov-2'
120
+
121
+
# (Re-)build Nextclade in debug mode and run the analysis using the
122
+
# dataset we just downloaded (to `data_dev/`) and output results to
123
+
# the `out/` directory.
124
+
cargo run --bin=nextclade -- run \
125
+
'data_dev/sars-cov-2/sequences.fasta' \
126
+
--input-dataset='data_dev/sars-cov-2/' \
127
+
--output-all='out/'
128
+
```
129
129
130
130
The `cargo run` command automatically performs the `cargo build` command if there are code changes.
131
131
@@ -135,18 +135,18 @@ as well as to the `--help` text for each tool.
135
135
136
136
6. Build and run Nextclade CLI in release mode (slow to build, fast to run, very little debug info):
137
137
138
-
```bash
139
-
# Build Nextclade in release mode.
140
-
# By default, the resulting executable will be in `target/release/nextclade`.
141
-
cargo build --bin=nextclade --release
142
-
143
-
# Run Nextclade release binary
144
-
./target/release/nextclade run \
145
-
'data_dev/sars-cov-2/sequences.fasta' \
146
-
--input-dataset='data_dev/sars-cov-2/' \
147
-
--output-all='out/'
148
-
149
-
```
138
+
```bash
139
+
# Build Nextclade in release mode.
140
+
# By default, the resulting executable will be in `target/release/nextclade`.
141
+
cargo build --bin=nextclade --release
142
+
143
+
# Run Nextclade release binary
144
+
./target/release/nextclade run \
145
+
'data_dev/sars-cov-2/sequences.fasta' \
146
+
--input-dataset='data_dev/sars-cov-2/' \
147
+
--output-all='out/'
148
+
149
+
```
150
150
151
151
> 💡 Debug builds are incremental, i.e. only the files that have changed since the last build are compiled, which is much faster that full build. But release builds are always full builds, with additional optimization passes, so they take much more time. If you need to quickly iterate on features, then use debug builds. If you are measuring performance, or building binaries for the actual daily usage, always use release builds.
152
152
@@ -167,14 +167,14 @@ Note that there is no actual programmable backend server. Nextclade Web is a sta
167
167
168
168
Clone Nextclade git repository:
169
169
170
-
```bash
171
-
git clone https://github.com/nextstrain/nextclade
172
-
cd nextclade
173
-
```
170
+
```bash
171
+
git clone https://github.com/nextstrain/nextclade
172
+
cd nextclade
173
+
```
174
174
175
175
> 💡 We accept pull requests on GitHub. If you want to submit a with new feature or a bug fixe, then make a GitHub account, [make a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) of the [origin Nextclade repository](https://github.com/nextstrain/nextclade) and clone your forked repository instead. Refer to [GitHub documentation "Contributing to projects"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) for more details.
176
176
177
-
> 💡 Make sure you [keep your local code up to date](https://github.com/git-guides/git-pull) with the origin repo, [especially if it's forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).
177
+
> 💡 Make sure you [keep your local code up to date](https://github.com/git-guides/git-pull) with the origin repo, [especially if it's forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).
178
178
179
179
> 💡 If you are a member of Nextstrain team, then you don't need a fork and you can contribute directly to the origin repository. Still, in most cases, please submit pull requests for review, rather than pushing changes to branches directly.
180
180
@@ -184,19 +184,19 @@ Note that there is no actual programmable backend server. Nextclade Web is a sta
184
184
185
185
Install Node.js from [nodejs.org](https://nodejs.org), or using [nvm](https://github.com/nvm-sh/nvm):
186
186
187
-
```bash
188
-
cd nextclade/
189
-
nvm install
190
-
nvm use
191
-
node --version
192
-
```
187
+
```bash
188
+
cd nextclade/
189
+
nvm install
190
+
nvm use
191
+
node --version
192
+
```
193
193
194
194
Install Bun (version **1.2.14** recommended) from [bun.sh](https://bun.sh):
195
195
196
-
```bash
197
-
curl -fsSL https://bun.sh/install | bash
198
-
bun --version
199
-
```
196
+
```bash
197
+
curl -fsSL https://bun.sh/install | bash
198
+
bun --version
199
+
```
200
200
201
201
> ⚠️ Nextclade team doesn't have bandwidth to support Node.js installations from Linux package repositories, Homebrew, Conda, as well as versions of Node.js which are not the same as the one currently declared in the [`.nvmrc`](https://github.com/nextstrain/nextclade/blob/master/.nvmrc), and everything else deviating from the recommended setup. If you decide to go that route - things may or may not work - you are on your own. But feel free to open pull requests if fixes are necessary to make your setup work.
202
202
@@ -241,30 +241,30 @@ Note that there is no actual programmable backend server. Nextclade Web is a sta
241
241
242
242
5. Prepare environment variables (once). They configure Nextclade build-time settings. Optionally adjust the variables in the `.env` file to your needs.
243
243
244
-
```bash
245
-
cp .env.example .env
246
-
```
244
+
```bash
245
+
cp .env.example .env
246
+
```
247
247
248
248
6. Install WebAssembly toolchain (once)
249
249
250
250
The following versions are pinned for build reproducibility:
251
251
252
-
| Tool | Version |
253
-
|------|---------|
254
-
| wasm-pack | 0.13.1 |
252
+
| Tool | Version |
253
+
|---------------- | ------- |
254
+
| wasm-pack | 0.13.1|
255
255
| wasm-bindgen-cli | 0.2.106 |
256
-
| binaryen | 125 |
256
+
| binaryen | 125|
257
257
258
-
```bash
259
-
# Install wasm-pack
260
-
cargo install wasm-pack@0.13.1 --locked
258
+
```bash
259
+
# Install wasm-pack
260
+
cargo install wasm-pack@0.13.1 --locked
261
261
262
-
# Install wasm-bindgen-cli (must match the version in Cargo.toml)
263
-
cargo install wasm-bindgen-cli@0.2.106 --locked
262
+
# Install wasm-bindgen-cli (must match the version in Cargo.toml)
263
+
cargo install wasm-bindgen-cli@0.2.106 --locked
264
264
265
-
# Add WebAssembly compilation target
266
-
rustup target add wasm32-unknown-unknown
267
-
```
265
+
# Add WebAssembly compilation target
266
+
rustup target add wasm32-unknown-unknown
267
+
```
268
268
269
269
<details>
270
270
<summary>🐧 Install binaryen on Linux</summary>
@@ -291,21 +291,21 @@ Note that there is no actual programmable backend server. Nextclade Web is a sta
291
291
292
292
7. Install NPM dependencies (once)
293
293
294
-
```bash
295
-
cd packages/nextclade-web
296
-
bun install
297
-
```
294
+
```bash
295
+
cd packages/nextclade-web
296
+
bun install
297
+
```
298
298
299
299
> ⚠️ Nextclade uses `bun` to manage NPM dependencies. While you could try `npm` or other tools instead, we don't support this.
300
300
301
301
8. Build the WebAssembly module
302
302
303
-
```bash
304
-
cd packages/nextclade-web
305
-
bun wasm-prod
306
-
```
303
+
```bash
304
+
cd packages/nextclade-web
305
+
bun wasm-prod
306
+
```
307
307
308
-
This step might take a lot of time. The WebAssembly module and accompanying Typescript code should be been generated into `packages/nextclade-web/src/gen/`. The web application should be able to find it there.
308
+
This step might take a lot of time. The WebAssembly module and accompanying Typescript code should be been generated into `packages/nextclade-web/src/gen/`. The web application should be able to find it there.
309
309
310
310
Repeat this step every time you are changing Rust code.
311
311
@@ -315,31 +315,31 @@ Note that there is no actual programmable backend server. Nextclade Web is a sta
315
315
316
316
The development version can be built using:
317
317
318
-
```bash
319
-
cd packages/nextclade-web
320
-
bun dev
321
-
```
318
+
```bash
319
+
cd packages/nextclade-web
320
+
bun dev
321
+
```
322
322
323
323
This runs Next.js dev server (continuously). Open `http://localhost:3000/` in the browser. Typescript code changes should trigger automatic rebuild and fast refresh of the app in the browser - no dev server restart is typically necessary.
324
324
325
325
Note that changes in Rust code (the algorithms) are not picked up automatically and the requirement rebuilding the WebAssembly module manually (as explained above). Once you rebuild the WebAssembly module in a separate terminal instance, the dev server should pick up the changes in the algorithms - no dev server restart is necessary.
326
326
327
327
10. Build and serve the production version of the web app locally
328
328
329
-
Alternatively, the optimized ("production") version of the web app can be built and (optionally) served with
329
+
Alternatively, the optimized ("production") version of the web app can be built and (optionally) served with
330
330
331
331
```bash
332
332
bun prod:build
333
333
bun prod:serve
334
334
```
335
335
336
-
Open `http://localhost:8080/` in the browser.
336
+
Open `http://localhost:8080/` in the browser.
337
337
338
-
The resulting HTML, CSS, JS and WASM files should be available under `packages/nextclade-web/.build/production/web/`. This is the "web root" of the application. All files required to deploy and serve Nextclade Web are there.
338
+
The resulting HTML, CSS, JS and WASM files should be available under `packages/nextclade-web/.build/production/web/`. This is the "web root" of the application. All files required to deploy and serve Nextclade Web are there.
339
339
340
-
The production build does not have automatic rebuild and reload. You need to do full rebuild on every code change - both the WebAssembly module and then the web app.
340
+
The production build does not have automatic rebuild and reload. You need to do full rebuild on every code change - both the WebAssembly module and then the web app.
341
341
342
-
The `bun prod:serve` command runs a simple static file web server. But the produced files can be served using any static file web server (Apache, Nginx, Caddy, Express, etc.), static file hosting services, or cloud services (AWS S3, Vercel, GitHub Pages, etc.). The official deployment uses AWS S3 + Cloudfront.
342
+
The `bun prod:serve` command runs a simple static file web server. But the produced files can be served using any static file web server (Apache, Nginx, Caddy, Express, etc.), static file hosting services, or cloud services (AWS S3, Vercel, GitHub Pages, etc.). The official deployment uses AWS S3 + Cloudfront.
343
343
344
344
### Internationalization (translation)
345
345
@@ -441,7 +441,6 @@ For routine development, it is recommended to configure your text editor to see
441
441
442
442
(these instructions can go out of date with time, so make sure you check Jetbrains docs for what's latest and greatest)
> In main menu, "File | Settings | Languages & Frameworks | Rust | External Linters", set "External tool" to "Clippy" and check the checkbox "Run external linter to analyze code on the fly".
@@ -523,7 +522,7 @@ Other branches are built in the context of GitHub pull requests. If you submit a
523
522
Here is a list of environments:
524
523
525
524
| Nextclade repo branch | Nextclade Web domain name | Dataset server | Meaning |
| release | clades.nextstrain.org | data.clades.nextstrain.org | Final release, targeting all end users |
528
527
| staging | staging.nextstrain.org | data.staging.nextstrain.org | Staging release, for last-minute testing and fixes before a final release is made, to not block progress on master branch |
529
528
| master | master.nextstrain.org | data.master.nextstrain.org | Main development branch - accumulates features and bug fixes from pull requests |
@@ -566,6 +565,7 @@ In all cases you need to have a dataset server directory ready (contained datase
566
565
- Build a fresh dataset server directory as described in the [nextstrain/nextclade_data](https://github.com/nextstrain/nextclade_data) repo. At the time of writing it simply means to run `./scripts/rebuild` and to observe the `data_output/` directory created, containing the dataset files and associated index files
567
566
568
567
- Serve the output directory locally using any static file server. [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) should be enabled on the server. For example, using `serve` package from NPM:
0 commit comments