Code AI platform with Code Search & Cody
Go to file
Will Dollman d56fa926dd
Build images end-to-end using Bazel v2 (#61845)
* wip

* gitserver (mostly) wolfi 4 bazel

* the big heck of all things

* Add rules_apko lock translation rules to WORKSPACE

* Call apko_repositories() more

* fix rules_apko to handle our shorter repo urls

* fix workspace from rebase, and missing locks

* visibility on wolfi_base_image

* hand-fix a lock coz apko lock is 🅱️roken

* remove chainguard repo+keyring from base

* update locks

* add chainguard repo+keychain to single server manifest

* unrelated fixes, server+grafana still h*cked

* fix postgres-exporter

* the big fix

* aws lib got bumped?

* downgrade sso-oidc? idk

* ignore wolfi locks from prettier

* dynamically do the locks with a reporule

* document and make nice :nails:

* bazel run @rules_apko//apko patch

* Fix .typo.typo

* Update tooling for end-to-end Bazel images (#61106)

* Update sg wolfi image to build using Bazel

* bazel run @rules_apko//apko patch

* Fix .typo.typo

* Add update-images and implement apko YAML change monitoring

* Use bazel apko and add support for additional repos

* Refactor sg wolfi

* Rework wolfi base image auto-update pipeline

* sg bazel configure

* [rough] Add --check flag to sg wolfi lock

* Refactor sg wolfi lock --check

* Simplify check and update apko lock hash operations

* Fix resolveImagePath when running in bazel

* Fixup logic error in CheckApkoLockHashes

* Tweak DoBaseImageBuild output

* Remove debug output

* Fix sg wolfi lock --check behaviour for all images

* Replace base image build step with apko lock --check

* Remove debug line

* Minor fixups for CI step

* Wrap with AnnotatedCmd

* Fixup annotation

* Update apko lockfiles

* Allow additional repos to be passed

* Update build-base-image.sh with bazel + add back to pipeline

* Ensure that modified base images are rebuilt

* Solve bazelception

* Remove timestamp for bit-level reproducibility

* Skip local keygen when running on buildkite

* Add workaround for lack of local repo support in rules_apko

* Run apkoOps first as it's quick and might fail

* Remove blocking allBaseImagesBuilt step

* Remove unused promethus-gcp image

* Add special cases to resolveImagePath

* Cleanly handle case where no bazel build path exists

This could happen in cases where a base image is only used outside of sourcegraph/sourcegraph,
or if you've added a new base image config but haven't added the associated Bazel scaffolding

* Add debugging around failing docker builds

* More debugging

* Normalise apko_lockfile to match repo.bzl

* Fixup apko docker call

* Try passing imageconfigdir differently to docker

* Run ls in different container

* Soft-fail when using legacy build in Buildkite

* Add missing include

* Workaround for building sourcegraph and sourcegraph-dev

* Add postgresql-client package to server

This contains createdb, which was recently moved from postgresql

* Inflate postgres-12-codeinsights image to avoid rules_apko errors

* Remove update line from yaml files

* Fix issue caused by moving base sourcegraph image

* Remove apk-tools from server

* Update lockfiles

* Address review feedback

* Remove debug lines

* fix unbound var

---------

Co-authored-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>

* go mod tidy + gazelle-update-repos after merging main

* Use aspect bazel cache

* Use Aspect bazel caching when calling bazel in bash and sg

* Append annotation

* Run apko lock on aspect agent

* Remove base image builds

Discussion in https://sourcegraph.slack.com/archives/C05EVRLQEUR/p1712307465660509

* Remove unused functionality

* Update BaseImageConfig comments

* Rewrite wolfi-images/README.md

* Add .apko/range.sh to .gitattributes

* Remove "wolfi" from :base_image and :base_tarball targets

* remove allowlist extras from debugging

* Tweak user instructions around package testing

* Add agent healthcheck to buildkite scripts

* prettier

* sg bazel configure

* bazel run //:gazelle-update-repos

---------

Co-authored-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>
Co-authored-by: Noah S-C <noah@sourcegraph.com>
2024-04-12 16:18:43 +01:00
.apko Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
.aspect ci: disable emitting execution log for bazel (#61783) 2024-04-11 13:57:59 +01:00
.buildkite ci: temporary mitigation - make backcompat soft fail on exit code 1 (#61767) 2024-04-10 22:14:16 +00:00
.github sg: brew link postgresql@12 (#61829) 2024-04-12 14:41:47 +01:00
.vscode release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
client chore: update readme for svelte dev (#61825) 2024-04-12 14:30:24 +00:00
cmd Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
dev Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
doc monitoring: add golang monitoring for zoekt (#61731) 2024-04-12 13:46:11 +00:00
docker-images Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
internal Fix nil dereference from wrong bool operator (#61841) 2024-04-12 14:06:34 +00:00
lib msp/opentelemetry: fix metrics export instrumentation (#61649) 2024-04-05 19:00:19 +00:00
migrations Extract reposcheduler and add support for syntactic indexes (#60958) 2024-04-02 11:37:30 +01:00
monitoring monitoring: fix "instance" dropdown for Zoekt (#61836) 2024-04-12 15:47:19 +02:00
schema schema: remove non-determinism from TestSchemaValidationUUID (#61728) 2024-04-09 15:50:30 +00:00
testing Upgrade test CLI tool (#60594) 2024-04-02 09:44:09 -07:00
third_party Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
third-party-licenses chore: update third-party licenses (#59370) 2024-01-08 10:12:45 +02:00
tools release: move release caalendar config (#61739) 2024-04-09 14:20:39 -05:00
ui/assets Revert "use vite for web builds (#58228)" (#59132) 2023-12-20 16:23:45 -03:00
wolfi-images Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
wolfi-packages ci: remove prometheus-gcp from completely (#61472) 2024-03-28 15:42:10 +00:00
.bazel_fix_commands.json SG Start Bazel Improvements Take 2 (#60687) 2024-03-05 01:44:21 -08:00
.bazelignore release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
.bazeliskrc chore: upgrade to Aspect CLI 5.8.19 (#59203) 2024-01-02 15:13:24 +01:00
.bazelrc Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
.bazelversion bazel: bump to 7.1 (#61092) 2024-03-13 14:52:25 +00:00
.dockerignore use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
.editorconfig proto: Add editorconfig to ident using two spaces (#57281) 2023-10-03 00:39:42 +00:00
.eslintrc.js Revert vs-code extension deleting (#61258) 2024-03-20 13:53:27 +01:00
.gitattributes Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
.gitignore Chore: clean up .gitignore (#61182) 2024-03-15 13:15:37 +00:00
.graphqlrc.yml
.hadolint.yaml bump comby version to 1.7.1 (#35830) 2022-05-20 20:12:01 -07:00
.mailmap mailmap: add entries for Eric and Renovate (#50966) 2023-04-25 09:42:22 +02:00
.mocharc.js reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145) 2023-11-07 12:00:18 +02:00
.npmrc pnpm: remove update notifier message (#51630) 2023-05-10 08:53:39 +02:00
.percy.yml ci: percy defer snapshots upload (#54116) 2023-06-25 18:57:49 -07:00
.pre-commit-config.yaml exclude pnpm-lock.yaml from precommit (#61158) 2024-03-14 15:35:14 +00:00
.prettierignore Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
.stylelintignore rework plugin structure and implement frontside blogpost (#46883) 2023-02-15 11:49:51 +02:00
.stylelintrc.json web: drop bootstrap depenedency (#41401) 2022-09-07 03:11:26 -07:00
.swcrc use swc instead of babel for faster bazel typescript transpilation (#57912) 2023-11-02 22:49:03 -07:00
.tool-versions bump to Go 1.22.1 (#60902) 2024-03-06 17:38:43 -07:00
.trivyignore ci: ignore benign CVE-2021-43816 in prometheus (#31069) 2022-02-11 16:49:10 +00:00
BUILD.bazel Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
CHANGELOG.md vscsyncer: introduce syncer wrapper which calculates latencies for all operations (#61708) 2024-04-11 14:21:14 -07:00
CODENOTIFY nix: update pnpm hash (#51512) 2023-05-05 12:51:59 +00:00
CONTRIBUTING.md Docs: update links to point to new site (#60381) 2024-02-13 00:23:47 +00:00
deps.bzl Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
doc.go
eslint-relative-formatter.js bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
flake.lock nix: bump to bazel 7.1 (#61326) 2024-03-22 16:57:50 +00:00
flake.nix nix: build pg-utils with nix [static edition] (#61734) 2024-04-09 20:24:19 +01:00
gen.go chore: fixup go-mockgen run statement (#61028) 2024-03-12 13:06:36 +00:00
go.mod Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
go.sum Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
graphql-schema-linter.config.js
LICENSE relicense all paths other than MIT licensed code, client/cody*, jetbrains, VS code, and browser extension to enterprise (#53345) (#53345) 2023-06-13 10:28:11 -07:00
LICENSE.enterprise Update marketing website link in monorepo (#58449) 2023-12-01 22:22:34 +00:00
linter_deps.bzl build: add buildifier check to Aspect Workflows (#58566) 2023-11-27 14:58:01 +02:00
mockgen.temp.yaml Reapply "gitserver: Introduce FS layer to encapsulate repo name conversions (#60627)" (#61487) (#61523) 2024-04-02 19:20:18 +02:00
mockgen.test.yaml gitserver: Don't trigger clones in hot requests (#61672) 2024-04-11 18:47:31 +02:00
mockgen.yaml bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
nogo_config.json gitserver: Fully sunset p4 exec endpoint (#60327) 2024-02-14 17:24:18 +01:00
package.json release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
pnpm-lock.yaml release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
pnpm-workspace.yaml release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
postcss.config.js
prettier.config.js clean up Cody CSS to increase shareability and improve display in web app (#50279) 2023-04-03 12:29:05 -07:00
README.md Docs: update links to point to new site (#60381) 2024-02-13 00:23:47 +00:00
release.yaml chore(rel): remove placeholder in release test (#61540) 2024-04-03 13:04:45 +01:00
renovate.json Require approval to run Renovate (#57608) 2023-10-18 20:36:53 +02:00
SECURITY.md
service-catalog.yaml lib/servicecatalog: init to distribute catalog (#46999) 2023-01-26 17:22:27 -08:00
sg.config.yaml sg: Enable otel-collector in enterprise-codeintel preset (#61820) 2024-04-12 06:51:42 +01:00
shell.nix bazel: use pgutil binaries from GCS instead of from the host (#61741) 2024-04-11 18:00:21 +01:00
stamp_tags.bzl Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
tsconfig.base.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00
tsconfig.json release: drop legacy release tooling (#61220) 2024-04-09 14:29:35 -05:00
vitest.shared.ts code intel: Don't rely on URL polyfill to correctly parse git: URIs (#58258) 2023-11-17 19:32:46 +01:00
vitest.workspace.ts vitest: Fix workspace config wrt client/web/ (#58397) 2023-11-17 08:22:46 +00:00
WORKSPACE Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00

DocsContributingTwitterDiscord

Build status Scorecard Latest release Discord Contributors


Sourcegraph makes it easy to read, write, and fix code—even in big, complex codebases.

  • Code search: Search all of your repositories across all branches and all code hosts.
  • Code intelligence: Navigate code, find references, see code owners, trace history, and more.
  • Fix and refactor: Roll out large-scale changes to many repositories at once and track big migrations.

Getting started



Development

Refer to the Developing Sourcegraph guide to get started.

Documentation

The doc directory has additional documentation for developing and understanding Sourcegraph:

License

This repository contains primarily non-OSS-licensed files. See LICENSE.