sourcegraph/dev
Jean-Hadrien Chabran 58da6780d7
Switch to OCI/Wolfi based image (#52693)
This PR ships our freshly rewritten container images built with
rules_oci and Wolfi, which for now will only be used on S2.

*What is this about*

This work is the conjunction of [hardening container
images](https://github.com/orgs/sourcegraph/projects/302?pane=issue&itemId=25019223)
and fully building our container images with Bazel.

* All base images are now distroless, based on Wolfi, meaning we fully
control every little package version and we won't be subject anymore to
Alpine maintainers dropping a postgres version for example.

* Container images are now built with `rules_oci`, meaning we don't have
Dockerfile anymore, but instead created through [Bazel
rules](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph@bzl/oci_wolfi/-/blob/enterprise/cmd/gitserver/BUILD.bazel).
Don't be scared, while this will look a bit strange to you at first,
it's much saner and simpler to do than our Dockerfiles and their muddy
shell scripts calling themselves in cascade.


:spiral_note_pad:  *Plan*:

*1/ (NOW) We merge our branch on `main` today, here is what it does
change for you 👇:skin-tone-3::*

* On `main`: 
* It will introduce a new job on `main` _Bazel Push_, which will push
those new images on our registries with all tags prefixed by `bazel-`.
    * These new images will be picked up by S2 and S2 only. 
* The existing jobs building docker images and pushing them will stay in
place until we have QA'ed them enough and are confident to roll them out
on Dotcom.
* Because we'll be building both images, there will be more jobs running
on `main`, but this should not affect the wall clock time.
* On all branches (so your PRs and `main`)
* The _Bazel Test_ job will now run: Backend Integration Tests, E2E
Tests and CodeIntel QA
* This will increase the duration of your test jobs in PRs, but as we
haven't removed yet the `sg lint` step, it should not affect too much
the wall clock time of your PRs.
* But it will also increase your confidence toward your changes, as the
coverage will vastly increased compared to before.
* If you have ongoing branches which are affecting the docker images
(like adding a new binary, like the recent `scip-tags`, reach us out on
#job-fair-bazel so we can help you to port your changes. It's much much
simpler than before, but it's going to be unfamiliar to you).

* If something goes awfully wrong, we'll rollback and update this
thread.

*2/ (EOW / Early next week) Once we're confident enough with what we saw
on S2, we'll roll the new images on Dotcom.*

* After the first successful deploy and a few sanity checks, we will
drop the old images building jobs.
* At this point, we'll reach out to all TLs asking for their help to
exercise all features of our product to ensure we catch any potential
breakage.



## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->


* We tested our new images on `scale-testing` and it worked.
* The new container building rules comes with _container tests_ which
ensures that produced images are containing and configured with what
should be in there:
[example](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph@bzl/oci_wolfi/-/blob/enterprise/cmd/gitserver/image_test.yaml)
.

---------

Co-authored-by: Dave Try <davetry@gmail.com>
Co-authored-by: Will Dollman <will.dollman@sourcegraph.com>
2023-06-02 12:12:52 +02:00
..
adr-docs bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
auth-provider Remove left-over mentions of dev/start.sh (#25745) 2021-10-07 16:38:00 +02:00
authtest Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
backcompat Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
bkstats bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
build-tracker ci: enable bazel builds for docker images (#51241) 2023-04-28 10:41:13 +02:00
buildchecker remove okayhq usage in buildchecker (#50107) 2023-03-30 14:53:20 +02:00
check ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
ci Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
codeintel-qa Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
corrupt-archives bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
db dev/deb: Remove scripts replaced by sg (#28767) 2021-12-08 23:22:00 +00:00
depgraph Update buildfiles + fix analysis (#50013) 2023-03-27 12:11:46 +02:00
dx bazel: build //enterprise (#47327) 2023-02-07 15:30:46 +01:00
gqltest Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
grafana dev/sg: introduce 'sg ci logs' with Loki support (#25835) 2021-10-12 11:14:50 -04:00
internal/cmd Revert "Revert "grpc: create interceptors to log / chart errors that seem like they come from go-grpc (#51749) (#52083)" (#52090) 2023-05-17 20:04:10 +00:00
linters bazel: add unparam nogo linter (#50730) 2023-04-18 10:03:35 +00:00
nix ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
perforce bazel: fix buf files (#49444) 2023-03-15 20:21:38 +00:00
perforce-testing-helpers ci: update the use of perforce.sgdev to perforce-tests.sgdev (#50664) 2023-04-17 17:42:28 -07:00
phabricator web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
pr-auditor Update rules_rust to fix the issue with repinning the rust crates (#49698) 2023-03-21 11:02:33 +01:00
prometheus Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
release release: close 5.0.5 (#52781) 2023-06-01 16:02:35 +00:00
scaletesting [github app] Add GitHub App authenticators (#50963) 2023-04-24 09:05:50 +02:00
sg ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
src-expose ci: enable bazel builds for docker images (#51241) 2023-04-28 10:41:13 +02:00
team bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
tilt Remove left-over mentions of dev/start.sh (#25745) 2021-10-07 16:38:00 +02:00
zoekt zoekt: set -indexserver_proxy for webserver (#44995) 2022-12-02 08:38:44 +01:00
.gitignore
add_https_domain_to_hosts.sh
babel.bzl bazel: rename arg to follow convention (#50627) 2023-04-14 04:46:45 +00:00
bazel_buildkite_stamp_vars.sh bazel: test volatile variables with Percy (#51693) 2023-05-11 09:20:42 +00:00
bazel_stamp_vars.sh Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
BUILD.bazel bazel: improve ESLint rule and disable ESLint outside of Bazel (#52667) 2023-06-02 08:37:40 +00:00
caddy.sh Bump caddy version (#26329) 2021-10-19 22:06:22 +00:00
Caddyfile dev/Caddyfile: use 127.0.0.1 instead of localhost (#38955) 2022-07-18 13:19:09 -07:00
CLA.txt
codecov.yml vscode: ignore vscode in Codecov (#32676) 2022-03-16 11:28:28 -04:00
codeinsights-db.sh insights: update references to TimescaleDB (#32948) 2022-03-29 11:04:47 +01:00
comby-install-or-upgrade.sh update team reviewers (#50119) 2023-04-03 16:36:12 +02:00
ctags-install.sh dev: add installer script for building a local universal-ctag (#45198) 2022-12-06 18:32:21 +01:00
defs.bzl bazel: improve ESLint rule and disable ESLint outside of Bazel (#52667) 2023-06-02 08:37:40 +00:00
dev-sourcegraph-server.sh
docsite.sh doc: fix bad and broken links (#51902) 2023-05-12 17:57:43 -04:00
drop-entire-local-database-and-redis.sh all: /bin/bash -> /usr/bin/env bash (#23673) 2021-08-06 12:02:43 +02:00
eslint-report-test.sh bazel: improve ESLint rule and disable ESLint outside of Bazel (#52667) 2023-06-02 08:37:40 +00:00
eslint.bzl bazel: improve ESLint rule and disable ESLint outside of Bazel (#52667) 2023-06-02 08:37:40 +00:00
foreach-non-web-client-project.sh Cody: Add E2E test setup based on Playwright (#52071) 2023-05-19 19:11:52 +02:00
git-stats search: create and document git-stats script (#32663) 2022-03-16 13:41:17 +02:00
global-settings.json codeintel: Revive braindot (#49128) 2023-03-13 13:33:39 +00:00
go-mod-update.sh Upgrade aws-sdk-go-v2 (#19155) 2021-04-14 15:06:15 +02:00
js_lib.bzl bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
licenses.sh rework plugin structure and implement frontside blogpost (#46883) 2023-02-15 11:49:51 +02:00
mocha.bzl bazel: test volatile variables with Percy (#51693) 2023-05-11 09:20:42 +00:00
oci_defs.bzl Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
oci_deps.bzl Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
postgres_exporter.sh migrations: Update postgres exporter queries for dirty database (#30774) 2022-02-10 17:40:09 -06:00
proto.bzl fix: gazelle and proto generation (continuation of #49547) (#49713) 2023-04-11 11:36:45 +02:00
prune-pick.sh
redis-postgres.yml Update Postgres to 12.7 (#31933) 2022-03-03 14:39:52 -06:00
redis.conf Local dev with docker-compose (#23537) 2021-08-06 22:11:40 +00:00
run-server-image.sh Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
sass.bzl Buildifier fixes (#48691) 2023-03-07 10:15:26 +01:00
scip-ctags-dev syntax-highlighter: initial ctags work (w/ musl scip-ctags) (#52643) 2023-05-30 17:19:39 -04:00
scip-ctags-install.sh syntax-highlighter: initial ctags work (w/ musl scip-ctags) (#52643) 2023-05-30 17:19:39 -04:00
site-config.json Always disable user external service mode in UI (#44721) 2022-11-23 14:49:03 +01:00
src-prof-services.json Add embeddings to server behind env var (#50288) 2023-04-04 16:45:50 +02:00
src-search-meta.sh GraphQL: remove deprecated resultCount field (#31573) 2022-02-21 12:03:36 -07:00
tools.go cody-gateway: rename service from LLM-proxy (#52565) 2023-05-30 08:44:27 -07:00
universal-ctags-dev dev: add installer script for building a local universal-ctag (#45198) 2022-12-06 18:32:21 +01:00
webpack.bzl bazel: test bundlesize report ts (#50847) 2023-04-27 19:11:06 -07:00