Commit Graph

24 Commits

Author SHA1 Message Date
Erik Seliger
bb09a4ac1f
Remove HTTP for inter-service RPC (#59093)
In the upcoming release, we will only support gRPC going forward. This PR removes the old HTTP client and server implementations and a few leftovers from the transition.
2024-01-11 19:46:32 +01:00
Erik Seliger
dad4871a96
Make sure we test gRPC in CI suites (#59094)
Some of the suites weren't yet using gRPC - this PR turns it on so we gain some more confidence before we start dropping HTTP entirely.
2023-12-19 00:35:56 +01:00
Will Dollman
ab15920914
Make reindexing work in server image (#53256)
## Info for reviewers

In 5.1 we’ll be migrating the `server` image from Alpine to Wolfi, which
means `server`'s built-in Postgres database needs reindexing ([see RFC
793](https://docs.google.com/document/d/1kVdpTgPFPf1O25TVpFfSiLFIF2CFxUXyV9q2UlhOkfo/edit#heading=h.hgkt2mv20sbx)).

The [existing reindexing
script](https://github.com/sourcegraph/sourcegraph/blob/main/docker-images/postgres-12-alpine/rootfs/reindex.sh)
is only used with the standalone database containers, so I’ve adapted it
to work with server.
2023-06-14 15:17:30 +01:00
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
Valery Bugakov
6491d1838e
bazel: client e2e tests (#50330)
- Run client E2E tests in Bazel
- Fix client integration tests execution locally
- Make client integration tests work with different
`SOURCEGRAPH_BASE_URL` values
- Clean up integration tests and E2E tests logs

## Test plan

1. CI
2. `bazel test //client/web/src/integration:integration-tests`
3. `bazel test //client/web/src/end-to-end:e2e`

---------

Co-authored-by: Jason Bedard <jason@aspect.dev>
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
Co-authored-by: davejrt <davetry@gmail.com>
2023-04-13 04:01:37 -07:00
Camden Cheek
fe50452af7
gRPC: run tests with and without gRPC (#47770)
The migration to gRPC will take a significant amount of time, and until
we are fully migrated and are able to remove the non-gRPC codepaths, we
need to be confident that both codepaths work correctly.

Our options here include: 
1) duplicating every test to run with and without gRPC
2) adding a `TestMain` to every test package that reruns the suite with
and without gRPC
3) manually adding tests for all the codepaths that are interesting to
gRPC
4) always running both the HTTP and gRPC codepaths in parallel
5) mirror the test steps in CI to run both with and without gRPC

None of the options are good, but a solution here is necessary avoid
introducing regressions during the migration. This PR implements option
5 because it is the least bad option that is also the easiest to rip out
when it is no longer needed.

This PR updates our CI pipeline generator to duplicate most of our go
tests (everything except database tests) as well as our backend
integration tests. It does this by adding the environment variable
`SG_FEATURE_FLAG_GRPC`, which is respected when clients are deciding
whether to use gRPC or HTTP.

Co-authored-by: Geoffrey Gilmore <me@ggilmore.net>
2023-02-17 12:38:41 -07:00
Becca Steinbrecher
e82f9b3a36
Local install hide Code Insights actions (#46614)
* local install code insight landing page & hide code insight action when feature not avail

* Fix autocorrect

* Missing dep

* Use  window.context.enabledCodeInsights
2023-01-30 23:07:44 +00:00
Joe Chen
9a3bee2a37
ci: upsert license key for backend integration tests (#41163) 2022-09-01 18:45:50 +08:00
leo
c80efe5743
insights: reinstate code insights option in single docker deployment (#39824) 2022-08-04 09:25:21 -04:00
Robert Lin
da23651ade
dev/sg: add 'sg run server' alias (#38256)
Convenient for running end-to-end tests the same way we run them in CI.
2022-07-06 10:09:41 -07:00
coury-clark
376114fd7d
insights: revert insights database in single docker for integration tests (#36678) 2022-06-07 17:17:01 +00:00
Cristina Birkel
0454acb6db
insights: Add backend integration tests (#33451) 2022-04-07 15:39:41 -04:00
Robert Lin
e7dd8d40e7
dev/ci: do not remove containers by default, set unique container name (#29812) 2022-01-17 09:39:14 -08:00
Robert Lin
bd6944af22
dev: run server cleanup after run, use stable dir for local use (#29656) 2022-01-12 14:28:40 -08:00
Jean-Hadrien Chabran
d62f1cb977
ci: make server volume unique per build (#29627) 2022-01-12 15:19:06 +01:00
Robert Lin
1ab7471f91
dev/ci: restructure integration tests, unify test server setup (#29429)
- unify `sourcegraph/server` setup in integration tests so that we use the same scripts in each
- move all integration tests into new `dev/ci/integration` directory, and introduce a structure of `run.sh` and `test.sh` - see `dev/ci/integration/README.md` for overview
- some minor refactors to unify the tests a bit more
- remove unused `servers.yaml` that was part of the Vagrant setup
2022-01-07 13:39:11 -08:00
Robert Lin
840ee89e7e
cmd(server): add observability.alerts support for sourcegraph/server (#11950) 2020-07-08 12:59:55 +08:00
Geoffrey Gilmore
4bc292d580
ci: add shellcheck linter for shell scripts (#9903) 2020-04-21 10:03:17 -07:00
Geoffrey Gilmore
7970997428
dev: add shfmt for shell script consistency (#9900) 2020-04-15 12:44:36 -07:00
Stephen Gutekanst
c23f977b81
Remove the management console (#7197)
Remove the management console and merge all critical configuration automatically into the site configuration.

Instead of the management console, a file-based site configuration editing escape hatch is now available and is documented.

See [the added 3.11 migration notes](https://docs.sourcegraph.com/admin/migration/3_11) for details on the implications of this change, and ["editing your site configuration if you cannot access teh web UI"](https://docs.sourcegraph.com/admin/config/site_config#editing-your-site-configuration-if-you-cannot-access-the-web-ui) for how to use the new escape-hatch configuration file.

Fully-detailed proposal and motivations behind this change are documented in the PR description here: https://github.com/sourcegraph/sourcegraph/pull/7197

Associated PRs:

- https://github.com/sourcegraph/deploy-sourcegraph/pull/478
- https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/54
2019-12-16 21:30:51 -07:00
Chris Wendt
a0e7d0eb9e remove docker.sock from run-server-image.sh 2019-01-08 20:46:44 -08:00
Stephen Gutekanst
f6eb23799c
Configuration refactoring + management console (#966)
* use .Critical accessors; use conf.Unified type

* pkg/conf: add unified configuration types

* {pkg/conf,cmd/...}: rewrite conf package to be database-backed

* pkg/legacyconf: import from sourcegraph@v2.13.6 pkg/conf/ (and reduce)

* legacyschema: import from sourcegraph@v2.13.6 schema/ (and reduce)

* add dev config override support

* cmd/management-console/assets: add assets package for packing web app code

* cmd/management-console/web: initial webapp implementation

* schema: split site.schema.json into site and critical configuration portions

* schema: critical: add gitlab as valid auth.providers key (broken in master)

* web: update to reflect site config changes

* cmd/management-console: initial backend implementation

* cmd/management-console: add Go backend

* cmd/management-console: add TS frontend

* web: site-admin: add management console password alert

* cmd/management-console/internal/tlscertgen: package for TLS certificate generation

* schema: update docs

* upgrade deasync

* pkg/conf: add proper config defaults for each deployment type

* vfsgendev installation fix

* mgmt console web package-lock.json change

* assets doc.go + gitignore change

* gofmt assets

* dev/check: use dev build tag

Some things such as assets are only defined behind a dev build tag OR
after generating something via `go generate`. Since go generate has not
run yet, I am opting to use the `dev` build tag here.

* cmd/management-console/auth_test.go: simplify test

* fix go assets

* pkg/conf/confdefaults

* pkg/conf: validation test fix

* web: update to reflect site configuration changes

* expose management console port in docker run commands

* management-console: go: return concrete type to /update requests, not type that can arbitrarily change in future

* management-console: web: fix saving ID bug + properly display errors

* pkg/db/confdb: return an error if the creator is not up to date

* web mgmt console error handling

* mgmt console go backend ErrNewerEdit

* pkg/conf: fix zero configuration check (marshaled JSON is "{}")

* add linter for accidental transitive imports of pkg/conf in mgmt console

* enterprise/dev/ci: fix building of non-enterprise docker-images branches

* NOCHANGELOG
2018-12-12 14:59:15 -08:00
Keegan Carruthers-Smith
1f7f8ac942 dev: Override docker server image tag with TAG 2018-10-09 15:59:11 +02:00
Sourcegraph
02a03f54c1 Publish Sourcegraph as open source 🚀
Internal revision: sourcegraph/sourcegraph-intermediate-2018@d0cebbadc7
Executor: @slimsag
2018-09-30 23:13:36 -07:00