Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# levenshtein-distance-service
## Table of content
1. [Introduction](#introduction)
2. [Development](#development)
1. [Getting started](#getting-started)
2. [How to enable BuildKit?](#how-to-enable-buildkit)
1. [Enable the BuildKit in Docker Desktop](#enable-the-buildkit-in-docker-desktop)
2. [Enable the BuildKit in a fresh terminal](#enable-the-buildkit-in-a-fresh-terminal)
3. [On Linux machines, you may also need](#on-linux-machines-you-may-also-need)
3. [Building your Docker images](#building-your-docker-images)
4. [How to update project dependencies?](#how-to-update-project-dependencies)
5. [How to run services locally?](#how-to-run-services-locally)
3. [Testing and code formatting](#testing-and-code-formatting)
1. [How to run tests locally?](#how-to-run-tests-locally)
2. [How to format the code before pushing new changes to remote?](#how-to-format-the-code-before-pushing-new-changes-to-remote)
4. [Continuous integration/CI](#continuous-integration)
1. [Code coverage](#code-coverage)
## Introduction
A web service for calculating the Levenshtein distance between two sequences.
In order to compare and study proteins, scientists have devised many computational techniques and
algorithms. One such algorithm is the “Levenshtein distance”, which computes the distance between
two string-like sequences. It is used as a simple measure of similarity between two proteins.
The aim of this project is to develop a web application where a user can compute the Levenshtein distance between
two proteins.
## Development
### Getting started
...
### How to enable BuildKit?
This could be achieved in different ways.
#### Enable the BuildKit in Docker Desktop

#### Enable the BuildKit in a fresh terminal
```
export DOCKER_BUILDKIT=1
```
##### On Linux machines, you may also need:
```
export COMPOSE_DOCKER_CLI_BUILD=1
```
### Building your Docker images
```shell
docker build --ssh default . -f Dockerfile -t mscheremetjew/levenshtein-distance-service
docker-compose build
```
And then the service can be started as following:
```shell
docker-compose up
```
### How to update project dependencies?
For this project we are using pip-tools to manage all project dependencies. Apply changes to
requirements.in and run pip-compile, which generates an updated version of requirements.txt.
For rsa keys run...
```console
make pip-compile-rsa
```
For ed-25519 keys run...
```console
make pip-compile-ed-25519
```
### How to run services locally?
#### How to start all services defined in docker-compose file - for development only?
```shell
docker-compose up
```
OR use the following Makefile command:
```shell
make up
```
#### How to start services marked with specific profiles - for development only?
Certain services are marked with specific profiles. To start these services
you have to use the --profile option in your docker-compose command.
```shell
docker-compose [--profile prometheus] up
```
## Testing and code formatting
### How to run tests locally?
```console
make pytest
OR you can run specific test like this...
docker-compose run --rm --entrypoint=sh <service-name> -c "pytest app/tests/unit/test_*.py"
```
### How to format the code before pushing new changes to remote?
```console
make format
make lint
```
## Continuous integration
...
### Code coverage
For this project code coverage is set up.