Skip to content

Commit

Permalink
Add documentation for devcontiner (#2042)
Browse files Browse the repository at this point in the history
* writing in progress

* update

* style: Format code with gofumpt and prettier

* update

* fix

* revert

* style: Format code with gofumpt and prettier

* move development.md

* fix link

* fix helm extra option

* Update docs/contributing/development.md

Co-authored-by: Kiichiro YUKAWA <[email protected]>

---------

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Kiichiro YUKAWA <[email protected]>
  • Loading branch information
3 people authored May 31, 2023
1 parent 12e0bd9 commit 665f20c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Please submit the security issue report [here](https://github.com/vdaas/vald/iss

## Contributing Source Code

Please refer to our [development documentaion](./docs/contributing/development.md) for information on setting up a development environment.

### Before contributing source code

Follow these steps to make a contribution to any of our open source repositories:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ K8S_SERVER_VERSION ?= $(eval K8S_SERVER_VERSION := $(shell echo "$(K8S_KUBECTL_V
# values file to use when deploying sample vald cluster with make k8s/vald/deploy
HELM_VALUES ?= charts/vald/values/dev.yaml
# extra options to pass to helm when deploying sample vald cluster with make k8s/vald/deploy
HELM_EXTRA_OPTIONS ?= ""
HELM_EXTRA_OPTIONS ?=

COMMA := ,
SHELL = bash
Expand Down
70 changes: 70 additions & 0 deletions docs/contributing/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Development documentation

This document describes how to set up the development environment and how to develop Vald.

## Set up environment

### Prerequisites

#### OS

- When using Docker related environment, you can use any OS that supports Docker.
- When using native environment, `Linux` is required.

#### Architecture

`amd64` is recommended because `NGT`, the vector search library we use, is optimized for `amd64`.
But you can also build and test `Vald` on `arm64` with the same way as described below.

### Devcontainer

This is the easiest way to start developing `Vald`. You can just open our [devcontainer.json](https://github.com/vdaas/vald/blob/main/.devcontainer/devcontainer.json) with `VS Code` and go.

### Other

We don't officially have a setup documentation for now, but you can take a look at the [`Dockerfile`](https://github.com/vdaas/vald/blob/main/dockers/dev/Dockerfile).
That's everything you need to build and test `Vald`, so you can use it as a reference.

> If you would like to use the `Dockerfile` directlly, please note that `docker-in-docker` environment is required to run our E2E tests.
> In devcontainer, [`VS Code` handles it for us](https://github.com/devcontainers/features/tree/main/src/docker-in-docker).
## Run tests

### Unit tests

The command below will run all the unit tests.

```bash
make test
```

### E2E tests

The steps below will deploy a Vald cluster to the local `k3d` cluster and run the E2E tests.

1. Change `example/helm/values.yaml` to `dimensions: 784` and `distance_type: l2`.
2. Run the commands below.

```bash
# Download the dataset
make hack/benchmark/assets/dataset/fashion-mnist-784-euclidean.hdf5

# Start k3d
make k3d/start

# Wait for a while until the cluster is ready
# You might want to use k9s for this

# Deploy Vald
make k8s/vald/deploy

# Wait for a while until the deployment is ready

# Run E2E tests
make e2e E2E_WAIT_FOR_CREATE_INDEX_DURATION=3m

# The result will be shown in three minutes or so

# Delete the cluster
make k8s/vald/delete
```

0 comments on commit 665f20c

Please sign in to comment.