Commit Graph

26 Commits

Author SHA1 Message Date
Keegan Carruthers-Smith
0a038b1593
gomod: update zoekt to fix several CVEs in dependencies (#60093)
This is in preperation for the 5.3 release.

19fa44cea9...245e0cebf7

- fdc144f8fd all: gofmt -s -w .
- 746f38849d matchtree: fix panic for missing files
- 62017762fc gomod: update mountinfo to latest
- 0ddb91fea5 all: use stdlib slices package
- 7ec3d8e8bf gomod: update grpc for GHSA-m425-mq94-257g
- 245e0cebf7 gomod: update otel and circl for CVEs

Test Plan: CI and the relevant CVEs we solved no longer appear when
running "trivy fs go.mod".
2024-02-02 15:36:04 +00:00
Geoffrey Gilmore
c1f887415b
update zoekt to include updated grpc prometheus 2.0.0 version (#56735) 2023-09-18 19:51:59 +00:00
Geoffrey Gilmore
6f008798f9
zoekt: update to 40a9a23bb04b (#56250) 2023-08-25 17:49:12 +00:00
Stefan Hengl
8305be2e66
zoekt: set -indexserver_proxy for webserver (#44995)
Relates to https://github.com/sourcegraph/zoekt/pull/487

We set the new flag for local dev and server.
2022-12-02 08:38:44 +01:00
Keegan Carruthers-Smith
eca13930d3
unrevert "all: rename go module google/zoekt to sourcegraph/zoekt" (#40423)
Last time we changed the zoekt module name it broke the wire protocol
for zoekt. This now includes one more commit such that the wire protocol
is unchanged:

- c9182fcd2a rpc: use old module name when registering gob values

Revert chain:
- #40404
- #40353

Test Plan: Ran a local dev server with a hardcoded zoekt-webserver
pinned to the old version (the google/zoekt module). indexed search was
failing. Then upgraded the gomod version and it started working.
2022-08-17 15:30:49 -07:00
Thorsten Ball
85efb7af51
Revert "all: rename go module google/zoekt to sourcegraph/zoekt (#40353)" (#40404)
This reverts commit 6d376d871a.

See #inc-134-search-on-sourcegraphcom-fails-with-errors in Slack.

Current suspicion is that it causes gob-encoding/decoding problems in
production if the code below is not in sync with the zoekt cluster code.
2022-08-16 08:07:12 +00:00
Keegan Carruthers-Smith
6d376d871a
all: rename go module google/zoekt to sourcegraph/zoekt (#40353)
We have updated the module name in the zoekt repo to our own repository name.
This means we can remove the replace directive and just rely on normal go
tooling.

Note: at the same time we rename the default branch for zoekt from master to
main.

Test Plan: master dry run in CI.
2022-08-15 16:49:26 +01:00
Keegan Carruthers-Smith
8f067fc997
zoekt: directly use GitHub API for update script (#38609)
This greatly speeds up the script since it avoids the use of using
GOPROXY=direct. It also allows us to inline the suggested PR and commit
descriptions. The intention here is we can then start using this output
to improve the automated PRs created by the bot.

Additionally I changed the command we test to be an package which is
faster to compile.

This is some over engineering thanks to me having only 1h before a
chore.

Included zoekt changes:

- 16b6b7e50c all: remove datadog support
- f7f68fd7f3 ci: cleanup whitespace

Test Plan: ran the script and included the update to gomod here.
2022-07-14 09:26:18 +01:00
Keegan Carruthers-Smith
1bc081e532
gomod: update zoekt (#31041)
Includes the following commits. In particular we are interested to see
if our commit which removes python from the image removes a CVE related
to expat.

- 9d1b56e change findShard implementation to match on IDs, not names
- f6ba702 ctags: bump version to latest
- 840d5e4 docs: document JSON API
- 5f70fa0 fix: sourcegraphFake only checks SG_PRIVATE
- abedc19 introduce BLOCK_PROFILE_RATE environment variable to control the sampling rate of Go's block profiler
- acb6f19 use the ctags build script from sourcegraph
- 9e4c394 indexserver: track number of repository options we fetch
- 6b1df4f build ctags on alpine 3.11
- 65df08f specify docker tag versions
- b87be87 debug: add more facilities for debugging
- d19dfcd remove zoekt-merge-small.py
- 27e54f1 Add support for JSON responses in the webserver
- 574b805 indexserver: return uint from MaybeRemoveMissing
- 512672d indexserver: track num of repos we stop tracking
- 5bbbd4e merging: run vacuum every 24h instead of every hour
- d11a068 merging: remove obsolete maxSize
- 8ec61a4 merging: support unsetting tombstones during cleanup

Test Plan: main dry run for integration tests and to inspect the trivy
report to see if expat CVE is gone.
2022-02-11 08:54:54 +00:00
Robert Lin
fa3c0ee4b7
zoekt: update to sourcegraph/zoekt@f40c58e (#28485)
Includes the following changes:

https://github.com/sourcegraph/zoekt/commit/f40c58e zoekt-sourcegraph-indexserver: set internal actor on requests (https://github.com/sourcegraph/zoekt/pull/219)
https://github.com/sourcegraph/zoekt/commit/13aa167 merging: convert feature flag to ENV variable (https://github.com/sourcegraph/zoekt/pull/217)
https://github.com/sourcegraph/zoekt/commit/56b87f5 Cleanup the artifacts of didYouMean (https://github.com/sourcegraph/zoekt/pull/215)

Also adds some output to ./dev/zoekt/update to indicate that the go test command is expected to not run any tests.
2021-12-03 10:05:03 -08:00
Keegan Carruthers-Smith
9324ca3d0a
gomod: update zoekt (#27331)
Quite a few changes since our last bump:

- ae47cfc indexserver: ensure indexed for unchanged repositories
- 905148e indexserver: set and read Config Fingerprint
- 8cc3582 indexserver: Sourcegraph interface is just List
- d89a313 indexserver: move CloneURL into IndexOptions
- bfeddd7 indexserver: delete meta file after merging
- cd787b0 update README to reflect we are the defacto source
- f8682c1 shards: stream results per repo for compound shards
- ba7cd37 indexserver: merge in order of priority
- 004c956 shards: send max pending priority while searching
- df63d76 indexserver: don't delete shards if merge didn't run
- 4c69cfb indexserver: automate merging
- 9d85eab indexserver: update merge policy
- 0e81eb3 shards: set SearchResult.Progress.Priority
- c79ecf9 shards: only `observeMetrics` when `r.err == nil`
- f493172 shards: buffer search channel

We also update the update script to suggest a command which strips out
the PR numbers from the commit message. This is done since GitHub
interprets them as PRs in the SG repo, but they are in the zoekt repo.
2021-11-10 10:45:18 +02:00
Stefan Hengl
c61b0f1a7b
all: /bin/bash -> /usr/bin/env bash (#23673)
I ran into issues setting up Sourcegraph on NixOS, because NixOS, like
some other distros, doesn't have a /bin/bash. We already use /usr/bin/env
in many of our scripts, so this improves consistency, too.
2021-08-06 12:02:43 +02:00
Keegan Carruthers-Smith
03b0484e10
gomod: update zoekt for more robust indexing (#23610)
We also update go-git and go-ctags like we did in zoekt.

- 0ff6088 indexserver: send sigquit before sigkill to stalled index
- c8b1e5f ctags: timeout parse requests after a minute
- d50ed97 Merge remote-tracking branch 'gerrit/master'
- e056565 eval: fix bug where /(foo){2,}/ was equivalent to /foo/
- 6e5e87c ngramoffset: add a dense asciiNgramOffset mapper and a combiner.
- a6adac0 all: rely on priority in RawConfig only
- a6a7c57 Merge remote-tracking branch 'gerrit/master'
- 5118231 indexbuilder: remove subrepo branch validation
- f560be7 Guard against invalid slice bound
- 0a98eee indexbuilder: avoid writing root in SubRepoMap
- 253a9c5 index: pre-allocate size of ngram map
- d5ee8b0 index: read in ngrams in own function
- 68ffcf0 web: serve robots.txt, disallowing /search
- 0d5782d Revert "add back subrepo branch validation"
2021-08-05 09:42:25 +00:00
Ryan Hitchman
f8114aff06 zoekt/update: run 'go mod tidy' too 2021-06-09 10:53:34 -06:00
Keegan Carruthers-Smith
7893408750
gomod: zoekt uses different import for lumberjack (#21446)
This is a bump to fix a problem we are facing in CI when building zoekt
for the server image.

Co-authored-by: Stefan Hengl <stefan@sourcegraph.com>
2021-05-27 12:51:24 +00:00
Keegan Carruthers-Smith
a78157d224
zoekt: default new scheduler to on (#19971)
It has been running well in production. The metrics look good, so lets
default to on.
2021-04-15 11:36:27 +02:00
Keegan Carruthers-Smith
71eb43babc
zoekt: use new scheduler in development (#19821)
This commit bumps the version of zoekt to include one new commit:
https://github.com/sourcegraph/zoekt/commit/4c31790 shards: introduce a
scheduler abstraction.

We enable this scheduler in development mode.
2021-04-08 15:30:40 +02:00
Keegan Carruthers-Smith
61143bdffa
search: indexed config API supports multiple repo query arguments (#14558)
This converts the API into a batch API by writing a JSON blob per "repo"
query parameter in the order they are specified.

Each zoekt indexserver currently queries this endpoint with a hardcoded
concurrency of 32. This can cause many many HTTP requests, which on a
linux machine without tuning can lead to socket errors. By converting
this into a batch API we reduce the number of connections as well as
moving the responsbility of concurrency to the frontend which has more
knowledge of load/etc.

We also remove backwards compatibility support where repo wasn't
specified. Repo has been specified for multiple releases now.
2020-10-09 15:08:00 +02:00
Beyang Liu
2d6b40debf
dev: set JAEGER_DISABLED=false in zoekt wrapper (#12998) 2020-08-14 08:33:57 -07:00
Keegan Carruthers-Smith
a521dfbea1
zoekt: prevent indexserver stalling (#12502)
See 6ed80895db...a99799fdc0

- a99799f ctags: handle fatal ctags errors
- 5fcad78 ctags: skip commands that are too large
- cf36be0 ctags: use file basename
- d4fecb4 indexserver: timeout if no output for 5m
- 34a0dd6 indexserver: coarse 1h timeout on index job
- fdc9c2c Merge remote-tracking branch 'gerrit/master'
- b48e35d shards: a progress message every 10s when loading
- 4481f7b shards: throttle loading in watcher
2020-07-28 00:35:41 +02:00
Keegan Carruthers-Smith
1f80aac6c6
zoekt: build updates to enable multiple branch indexing (#10549)
* gomod: update zoekt

Includes the following commits

- 9d90c1c gitindex: allocate buffer of correct size
- aa0e667 zoekt: verbose flag prints shard metadata
- ddddd93 gitindex: do not resolve HEAD ref
- 8c0aee7 build: handle nil Options in largeFilesFlag
- 36a801c indexserver: use temp directory on same mount as indexes
- 070c191 indexserver: align flag defaults with dockerfile
- 35dabc7 indexserver: optionally shallow clone and use zoekt-git-index
- f89b8e3 indexserver: inline CmdArgs into archiveIndex
- ef52f4b indexserver: consistently use a pointer to indexArgs
- e407d68 indexserver: store root in indexArgs
- 70628e0 indexserver: factor out index logic
- 4961ee9 indexserver: add cli flags to debug indexing and listing
- 4abd60f indexserver: log success
- 605d890 indexserver: metrics track if we skipped indexing
- 1a62bb8 indexserver: rename metric vars to have metric prefix
- a2233e1 indexserver: check incremental in process
- ddccdf9 indexserver: use build.Options to generate flags
- 8463ade Do not ignore large files.

* zoekt: set cpu_fraction flag for indexserver

The default was 0.25, but was bumped to 1.0. This bump was done to align
the flag defaults with how we run indexserver in cluster
environments. We update our dev and single image environments to use the
same value. Those environmemts don't have resource isolation so we need
to continue using 0.25 rather than allowing indexing to use all cores.

* all: build and include zoekt-git-index

If you are indexing multiple branches this command is required. This
adds the command to our dev and single docker image environments. The
docker images for cluster already include the command (see zoekt repo).

* gofmt
2020-05-11 14:08:38 +02:00
Keegan Carruthers-Smith
3545de8931
zoekt: use go.mod version for building docker images (#10384) 2020-05-04 13:10:42 +02:00
Geoffrey Gilmore
7970997428
dev: add shfmt for shell script consistency (#9900) 2020-04-15 12:44:36 -07:00
Keegan Carruthers-Smith
ea73532add
dev: Enable sharded search by default (#6291)
This is only for dev mode, we will follow up with enabling horizontal search
by default in docker and k8s in a later commit.
2019-10-31 15:56:36 +02:00
Keegan Carruthers-Smith
fb374a2992
dev: Set DEV_SEARCH_SHARDING for sharded search (#6225)
We update our zoekt wrapper to understand a replica number. If
DEV_SEARCH_SHARDING is set we then start up two replicas locally, each
pointing to `~/.sourcegraph/zoekt/index-$replica`.
2019-10-28 11:04:08 +02:00
Keegan Carruthers-Smith
316d3d4a5b
dev: Move zoekt scripts into own subdir (#6144) 2019-10-22 14:32:03 +02:00