Sourcegraph resource estimator
Sourcegraph resource estimator helps predict and plan the required resource for your deployment.
This tool ensures you provision appropriate resources to scale your instance.
Development Prerequisites
Optional prerequisites
The project includes a justfile that includes simple
commands for automating common tasks such as:
- Building the WASM binary:
just build
- Automatic formatting of various file types:
just format
- Linting of various filetypes:
just lint
- A single command to perform all of the above steps:
just
You can install just
and the various commands it calls by either:
- Separately installing each of the tools listed in .tool-versions (via homebrew or something similar)
- Using the asdf version manager and running scripts/asdf-add-plugins.sh followed by
asdf install
Development
./scripts/watch-wasm.sh # or "just watch | just dev"
This will start serving on http://localhost:8080 the WASM bundle and recompiling code each time you reload the page (any errors compiling your changes will show up in this terminal).
Developing on the docsite
Visit http://docs.sourcegraph.com/admin/install/resource_estimator?dev=true and the page will use your local wasmserve
instance, so
that changes you make to the code are automatically reflected when you reload the page.
This is the best option as you can see the page with full CSS styling.
Developing without the docsite
You can view the page without any CSS styling at http://localhost:8080
Golden test
Run go test -update
in the internal/scaling directory to update the tests
Releasing
- Get your changes merged into
master
first and git checkout master
.
- Run
./build.sh
which will produce a main_$COMMIT.wasm
file.
- Upload that file to the Google Cloud Storage bucket.
- Update the
version=<oldcommit>
attribute in this file to match the file you uploaded.
- Merge that PR and your change has been released!