Add gitlab-zoekt-indexer image
What does this MR do?
This MR adds a new image for https://gitlab.com/gitlab-org/search-team/gitlab-zoekt-indexer, which is going to replace zoekt-dynamic-indexerver
. The latter has been introduced in !1320 (merged)
How to test it (docker)
docker build -t gitlab-zoekt-indexer -f gitlab-zoekt-indexer/Dockerfile gitlab-zoekt-indexer
docker build -t gitlab-zoekt-webserver -f gitlab-zoekt-webserver/Dockerfile gitlab-zoekt-webserver
docker volume create zoekt-index
- Uncomment
listen_addr = "127.0.0.1:2305"
in$GDK_DIR/gitaly/praefect.config.toml
- Execute
gdk restart praefect
docker run -p 6060:6060 --name gitlab-zoekt-indexer --rm -v zoekt-index:/data/index gitlab-zoekt-indexer
docker run -p 6070:6070 --name gitlab-zoekt-webserver --rm -v zoekt-index:/data/index gitlab-zoekt-webserver
- Get JSON payload by running these commands in
rails c
project = Project.find_by_full_path('flightjs/Flight')
payload = {
GitalyConnectionInfo: {
Address: 'tcp://host.docker.internal:2305',
Storage: project.repository_storage,
Path: "#{project.repository.disk_path}.git"
},
RepoId: 7,
FileSizeLimit: 2097152,
Timeout: "10m"
}.to_json
- Execute
curl -XPOST -d '<PAYLOAD>' -H 'Content-Type: application/json' http://127.0.0.1:6065/indexer/index
- See search results
curl -XPOST -d '{"Q":"test","RepoIDs":[7]}' 'http://127.0.0.1:6070/api/search' | jq .
How to test it (docker-compose)
docker build -t registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt-indexer:master -f gitlab-zoekt-indexer/Dockerfile gitlab-zoekt-indexer
docker build -t registry.gitlab.com/gitlab-org/build/cng/gitlab-zoekt-webserver:master -f gitlab-zoekt-webserver/Dockerfile gitlab-zoekt-webserver
- Uncomment
listen_addr = "127.0.0.1:2305"
in$GDK_DIR/gitaly/praefect.config.toml
- Execute
gdk restart praefect
docker-compose up zoekt_indexer zoekt_webserver
- Get JSON payload by running these commands in
rails c
project = Project.find_by_full_path('flightjs/Flight')
payload = {
GitalyConnectionInfo: {
Address: 'tcp://host.docker.internal:2305',
Storage: project.repository_storage,
Path: "#{project.repository.disk_path}.git"
},
RepoId: 7,
FileSizeLimit: 2097152,
Timeout: "10m"
}.to_json
- Execute
curl -XPOST -d '<PAYLOAD>' -H 'Content-Type: application/json' http://127.0.0.1:6065/indexer/index
- See search results
curl -XPOST -d '{"Q":"test","RepoIDs":[7]}' 'http://127.0.0.1:6070/api/search' | jq .
Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com -
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Integration tests added to GitLab QA - GitLab QA tests for the Zoekt integration would need to be added after it is supported in Omnibus. It's not a near term goal to support this for self-managed so prioritizing these containers to support deployment on GitLab.com makes more sense.
-
The impact any change in container size has should be evaluated $ docker image ls | fgrep indexer gitlab-zoekt-indexer latest b1a5bfeb06cc 33 seconds ago 212MB
Edited by Dmitry Gruzd