diff --git a/.buildkite/ci-checkov.sh b/.buildkite/ci-checkov.sh deleted file mode 100755 index a4d1a9372..000000000 --- a/.buildkite/ci-checkov.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# Set this to fail on the install -set -euxo pipefail - -# List of checks we do not want to run here -# This is a living list and will see additions and mostly removals over time. -SKIP_CHECKS="CKV_GCP_22,CKV_GCP_66,CKV_GCP_13,CKV_GCP_71,CKV_GCP_61,CKV_GCP_21,CKV_GCP_65,CKV_GCP_67,CKV_GCP_20,CKV_GCP_69,CKV_GCP_12,CKV_GCP_24,CKV_GCP_25,CKV_GCP_64,CKV_GCP_68,CKV2_AWS_5,CKV2_GCP_3,CKV2_GCP_5,CKV_AWS_23,CKV_GCP_70,CKV_GCP_62,CKV_GCP_62,CKV_GCP_62,CKV_GCP_62,CKV_GCP_29,CKV_GCP_39" - -set +x -# In case no terraform code is present -echo "--- Starting Checkov..." -echo "Note: If there is no output below here then no terraform code was found to scan. All good!" -echo "===========================================================================================" - -# Set not to fail on non-zero exit code -set +e -# Run checkov -checkov --skip-check $SKIP_CHECKS --quiet --framework terraform --compact -d . - -# Options -# --quiet: Only show failing tests -# --compact: Do not show code snippets -# --framework: Only scan terraform code - -# Capture the error code -CHECKOV_EXIT_CODE="$?" - -# We check the exit code and display a warning if anything was found -if [[ "$CHECKOV_EXIT_CODE" != 0 ]]; then - echo "^^^ +++" - echo "Possible Terraform security issues found. " - echo "Please refer to the Sourcegraph handbook for guidance: https://handbook.sourcegraph.com/product-engineering/engineering/cloud/security/checkov" -fi diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 852b496b9..571e961e3 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -1,6 +1,6 @@ $schema: "http://json.schemastore.org/buildkite" env: - # Build this image in sourcegraph/infrastructure by running `make e2e` in `gcp/images` + # GCP VM image for the Vagrant smoke test. Build it in sourcegraph/infrastructure by running `make e2e` in `gcp/images` IMAGE: "e2e-db8a40720-2024-08-26t08-44-10z" VAGRANT_RUN_ENV: "CI" steps: @@ -19,17 +19,8 @@ steps: - label: ":rice: docker-compose-test" command: .buildkite/vagrant-run.sh docker-test artifact_paths: ./*.log - env: - TEST_TYPE: "docker-compose-test" agents: { queue: "vagrant" } - # This runs the Checkov Terraform Code scanner - # https://www.checkov.io/ - - command: .buildkite/ci-checkov.sh - label: ":lock: security - checkov" - agents: { queue: "standard" } - soft_fail: true - # Please keep in mind that the release manifest uses specific branch names when creating releases. # Therefore, if you update them, or if you decide to change how we detect what kind of build we're dealing # with, please update this file as well. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 81100d3cc..198c82ace 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,13 +2,12 @@ ### Checklist -* [ ] All images have a valid tag and SHA256 sum +- [ ] All images have a valid tag and SHA256 sum + ### Test plan diff --git a/.gitignore b/.gitignore index acd374d8b..764f282ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,6 @@ node_modules/ -nginx/sourcegraph.crt -nginx/sourcegraph.key - .vagrant *.log /.env - -/right.dhall diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index c92af7fbd..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -13.5.0 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions index 4df9eb887..815b64596 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,6 +1,4 @@ nodejs 16.7.0 yarn 1.22.4 -shellcheck 0.7.1 golang 1.19.8 github-cli 2.46.0 -asdf:bosmak/asdf-checkov latest diff --git a/README.md b/README.md index c272c0fb6..69ab0a548 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,15 @@ -# Sourcegraph with Docker Compose +# Deploy Sourcegraph via Docker Compose [![sourcegraph: search](https://img.shields.io/badge/sourcegraph-search-brightgreen.svg)](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegraph-docker) [![Build status](https://badge.buildkite.com/e60f9ffcafd68882d3db6fe5e33567e3a111d391a554d50d82.svg)](https://buildkite.com/sourcegraph/deploy-sourcegraph-docker) -This repository is the deployment reference for [deploying Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose). +This repository is the deployment reference for [deploying Sourcegraph with Docker Compose](https://sourcegraph.com/docs/self-hosted/deploy/docker-compose). -> 🚨 IMPORTANT: When upgrading Sourcegraph, please check [upgrading docs](https://docs.sourcegraph.com/admin/updates/docker_compose) to check if any manual migrations are necessary. -> -> The `main` branch tracks development. Use the branch of this repository corresponding to the -> version of Sourcegraph you wish to deploy, e.g. `git checkout 3.19`. - -For product and [pricing](https://about.sourcegraph.com/pricing/) information, visit -[about.sourcegraph.com](https://about.sourcegraph.com) or [contact -us](https://about.sourcegraph.com/contact/sales) for more information. If you're just starting out, -we recommend running Sourcegraph as a [single Docker -container](https://docs.sourcegraph.com/#quickstart-guide) or using [Docker -Compose](https://docs.sourcegraph.com/admin/install/docker-compose). Migrating to Sourcegraph on -Kubernetes is easy later. +🚨 IMPORTANT: When upgrading Sourcegraph, please check the [upgrade docs](https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/upgrade) and [changelog](https://sourcegraph.com/changelog/self-hosted/docker-compose), then use the tag matching the Sourcegraph version, e.g. `git checkout v8.1.0` ## Is Docker Compose the right deployment type for me? -Please see [our docs](https://docs.sourcegraph.com/admin/install) for comparisons of deployment types and our resource estimator. - -## Contributing - -We've made our deployment configurations open source to better serve our customers' needs. If there is anything we can do to make deploying Sourcegraph easier just [open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&title=%5Bdeploy-sourcegraph-docker%5D) or a pull request and we will respond promptly! - -## Questions & Issues - -[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph&template=deploy-sourcegraph.md&title=%5Bdeploy-sourcegraph%5D) or contact us (support@sourcegraph.com), we are happy to help! - -### Contributing +Please see [our docs](https://sourcegraph.com/docs/self-hosted/deploy) for comparisons of our deployment types -#### Releasing +## Support -Please see the [documentation](https://go/releases). +Please contact us at support@sourcegraph.com diff --git a/TESTING.md b/TESTING.md deleted file mode 100644 index 8ae0e4435..000000000 --- a/TESTING.md +++ /dev/null @@ -1,63 +0,0 @@ -## Testing - -Developers can test using [Vagrant](https://www.vagrantup.com) and your Sourcegraph GCP account. - -- Use [these](https://www.vagrantup.com/docs/index) instructions to install `Vagrant` on your local machine. Once successfully installed, install the required plugin: -``` -vagrant plugin install vagrant-google -``` - -- Ensure your credentials are correct by executing the command below and following the prompts: -``` -gcloud auth application-default login -``` - -- Configure your local variables using the following environment variables - - `VAGRANT_GCP_PROJECT_ID`: Project to run on. (default: `sourcegraph-server`) - - `VAGRANT_SSH_USER`: Your SSH user ID as specified in GCP metadata. (default: `ENV['USER']`) - - `VAGRANT_SSH_KEY`: Path to your SSH Keys as specified in GCP metadata. (default: `~/.ssh/id_rsa`) - - `TEST_TYPE`: Deployment type to test, `docker-compose-test`. -``` -.buildkite/vagrant-run.sh docker-test -``` - -This command will start a GCP instance, upload your local copy of the repository and run the relevant smoke test for the docker-compose deployment type. - -To run any additional tests or commands, edit the servers.yaml and add the commands to the `shell_commands` list, eg: -``` -shell_commands: - - [...] - - /vagrant/moretests.sh - - "ps aux | grep thisthat" - - | - cd /vagrant - bartest.sh -``` -### Smoke test: ensure Docker Compose upgrades work - -Start the prior version of Docker Compose: - -``` -git checkout -cd test/ -TEST_TYPE=docker-compose-test vagrant up docker-test -``` - -Wait for the test to pass and for the output (approximately 5-10 minutes): - -``` -docker-test: ALL TESTS PASSED -``` - -Update to the latest version: - -``` -git checkout master -TEST_TYPE=docker-compose-test vagrant provision docker-test -``` - -Wait for the test to pass and for the output (approximately 5-10 minutes): - -``` -docker-test: ALL TESTS PASSED -``` diff --git a/codeinsights-db/conf/postgresql.conf b/codeinsights-db/conf/postgresql.conf index 1b9723fc1..34395f16b 100644 --- a/codeinsights-db/conf/postgresql.conf +++ b/codeinsights-db/conf/postgresql.conf @@ -54,4 +54,4 @@ max_locks_per_transaction = 64 #------------------------------------------------------------------------------ # Add your customization here -# Learn more: https://docs.sourcegraph.com/admin/config/postgres-conf +# Learn more: https://sourcegraph.com/docs/self-hosted/postgres-conf diff --git a/codeintel-db/conf/postgresql.conf b/codeintel-db/conf/postgresql.conf index f3e95b992..80092d095 100755 --- a/codeintel-db/conf/postgresql.conf +++ b/codeintel-db/conf/postgresql.conf @@ -53,4 +53,4 @@ effective_cache_size = 3GB #------------------------------------------------------------------------------ # Add your customization here -# Learn more: https://docs.sourcegraph.com/admin/config/postgres-conf +# Learn more: https://sourcegraph.com/docs/self-hosted/postgres-conf diff --git a/docker-compose/README.md b/docker-compose/README.md index 691af522d..c3d59a381 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -2,7 +2,7 @@ This directory contains the Sourcegraph with Docker Compose deployment reference. -To learn more about deploying, configuring, and upgrading a Sourcegraph with Docker Compose installation, please refer to our documentation: [Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose) +To learn more about deploying, configuring, and upgrading a Sourcegraph with Docker Compose installation, please refer to our documentation: [Sourcegraph with Docker Compose](https://sourcegraph.com/docs/self-hosted/deploy/docker-compose) ## Shared object storage diff --git a/docker-compose/db-only-migrate.docker-compose.yaml b/docker-compose/db-only-migrate.docker-compose.yaml index d8277e7b2..ca3d6340b 100644 --- a/docker-compose/db-only-migrate.docker-compose.yaml +++ b/docker-compose/db-only-migrate.docker-compose.yaml @@ -1,6 +1,7 @@ # This file contains the pgsql service definition (the primary Sourcegraph database deployment), # as well as the codeintel-db service definition (a separate postgres deployment). Both run postgres. -# This file is used during the sourcegraph/server -> docker-compose migration process. +# This file is used for database-only operations such as backup and restore. +# See https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/operations # # 🚨This file MUST be kept in sync with the pgsql definition in docker-compose/docker-compose.yaml version: '2.4' diff --git a/docker-compose/dev/README.md b/docker-compose/dev/README.md index fc50215f8..bf75a6e23 100644 --- a/docker-compose/dev/README.md +++ b/docker-compose/dev/README.md @@ -1,7 +1,7 @@ # Development overlay For use developing Sourcegraph's docker-compose deployment only. -For deployments, refer to the official [Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose) documentation. +For deployments, refer to the official [Sourcegraph with Docker Compose](https://sourcegraph.com/docs/self-hosted/deploy/docker-compose) documentation. This folder includes a helper script, [run.sh](./run.sh), that will run the `docker-compose` command (with any provided arguments) while automatically specifying the appropriate set of overlays. diff --git a/docker-compose/docker-compose.yaml b/docker-compose/docker-compose.yaml index 5201c97a0..b2603b7c6 100644 --- a/docker-compose/docker-compose.yaml +++ b/docker-compose/docker-compose.yaml @@ -33,7 +33,7 @@ services: - CODEINTEL_PGSSLMODE=disable # If you are not running code insights, please see: - # https://docs.sourcegraph.com/admin/install/docker-compose/operations#database-migrations for more information + # https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/operations#database-migrations for more information # for information on how to configure Sourcegraph migrations - CODEINSIGHTS_PGHOST=codeinsights-db - CODEINSIGHTS_PGPORT=5432 diff --git a/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml b/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml index 784705621..a5a8ca557 100644 --- a/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml +++ b/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml @@ -1,5 +1,5 @@ # Docker Compose override file for customers using AWS IAM authentication to databases on RDS -# See https://sourcegraph.com/docs/admin/external_services/postgres#usage-with-aws-rds-iam-auth +# See https://sourcegraph.com/docs/self-hosted/external-services/postgres#usage-with-aws-rds-iam-auth @@ -79,7 +79,7 @@ services: # command: ["add-log", "-db=codeinsights", "-version=1675347548"] # If you do fall a few versions behind, here's the command to run a multi-version upgrade - # See https://sourcegraph.com/docs/admin/deploy/docker-compose/upgrade#multi-version-upgrades + # See https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/upgrade#multi-version-upgrades # command: ["upgrade", "--from=v6.4.0", "--to=v6.9.1277"] # Do not skip the drift check, or use other args, without instruction from Sourcegraph Customer Support Engineering diff --git a/docker-compose/examples/migrator-operations/docker-compose.override.yaml b/docker-compose/examples/migrator-operations/docker-compose.override.yaml index 51c0cc7fa..4fc3d4a98 100644 --- a/docker-compose/examples/migrator-operations/docker-compose.override.yaml +++ b/docker-compose/examples/migrator-operations/docker-compose.override.yaml @@ -32,7 +32,7 @@ services: ################################################################################ # Multi-version upgrades - # See https://sourcegraph.com/docs/admin/deploy/docker-compose/upgrade#multi-version-upgrades + # See https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/upgrade#multi-version-upgrades # command: ["upgrade", "--from=v6.4.0", "--to=v6.9.1277"] # Do not skip the drift check, or use other args, without instruction from Sourcegraph Customer Support Engineering diff --git a/go.mod b/go.mod index f1e6ab114..b92ce5013 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,11 @@ go 1.19 require ( github.com/Masterminds/semver v1.5.0 github.com/sourcegraph/run v0.12.0 - github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20240222005846-e3158c0c2717 - github.com/sourcegraph/update-docker-tags v0.10.0 github.com/urfave/cli/v2 v2.25.7 ) require ( bitbucket.org/creachadair/shell v0.0.7 // indirect - github.com/Masterminds/semver/v3 v3.1.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/djherbis/buffer v1.2.0 // indirect github.com/djherbis/nio/v3 v3.0.1 // indirect @@ -20,7 +17,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/itchyny/gojq v0.12.11 // indirect github.com/itchyny/timefmt-go v0.1.5 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect diff --git a/go.sum b/go.sum index 616ac9a8e..7439a245f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ bitbucket.org/creachadair/shell v0.0.7 h1:Z96pB6DkSb7F3Y3BBnJeOZH2gazyMTWlvecSD4 bitbucket.org/creachadair/shell v0.0.7/go.mod h1:oqtXSSvSYr4624lnnabXHaBsYW6RD80caLi2b3hJk0U= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -37,8 +35,6 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= @@ -46,12 +42,6 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sourcegraph/run v0.12.0 h1:3A8w5e8HIYPfafHekvmdmmh42RHKGVhmiTZAPJclg7I= github.com/sourcegraph/run v0.12.0/go.mod h1:PwaP936BTnAJC1cqR5rSbG5kOs/EWStTK3lqvMX5GUA= -github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20231101211343-d046aeda10e4 h1:Mi4SkXsHkJBGrzbrarAU0gCT/GpwP4OnAVrqynAUjoQ= -github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20231101211343-d046aeda10e4/go.mod h1:HpOGaRM0iHPNrEQvpB4/3E9dAUjutyhgjg9vrOOeXPY= -github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20240222005846-e3158c0c2717 h1:xzO3kAjylr2urK0w5Yu95n98jSwpTQ4w/rvf8QA5pwY= -github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20240222005846-e3158c0c2717/go.mod h1:HpOGaRM0iHPNrEQvpB4/3E9dAUjutyhgjg9vrOOeXPY= -github.com/sourcegraph/update-docker-tags v0.10.0 h1:KpY1HtvSt0FzDM/sR0jQF5StNbiPKpqmHhE0jpBEa0A= -github.com/sourcegraph/update-docker-tags v0.10.0/go.mod h1:lCDsoUnk/ASDbm7UxE7tU3qAUhQxA7xykELHXcLeKFM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 9a3af5476..000000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,53 +0,0 @@ -# @sourcegraph: This file should be kept in sync with https://github.com/sourcegraph/sourcegraph/blob/main/cmd/server/shared/assets/nginx.conf -# -# You can adjust the configuration to add additional TLS or HTTP features. -# Read more at https://docs.sourcegraph.com/admin/nginx - -error_log stderr; -pid /var/run/nginx.pid; - -# Do not remove. The contents of sourcegraph_main.conf can change between -# versions and may include improvements to the configuration. -include nginx/sourcegraph_main.conf; - -events { -} - -http { - server_tokens off; - - # SAML redirect response headers are sometimes large - proxy_buffer_size 128k; - proxy_buffers 8 256k; - proxy_busy_buffers_size 256k; - - # Do not remove. The contents of sourcegraph_http.conf can change between - # versions and may include improvements to the configuration. - include nginx/sourcegraph_http.conf; - - access_log off; - upstream backend { - # Do not remove. The contents of sourcegraph_backend.conf can change - # between versions and may include improvements to the configuration. - include nginx/sourcegraph_backend.conf; - } - - server { - # Do not remove. The contents of sourcegraph_server.conf can change - # between versions and may include improvements to the configuration. - include nginx/sourcegraph_server.conf; - - listen 7080; - location / { - proxy_pass http://backend; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # SAML redirect response headers are sometimes large - proxy_buffer_size 128k; - proxy_buffers 8 256k; - proxy_busy_buffers_size 256k; - } - } -} diff --git a/nginx/nginx/sourcegraph_backend.conf b/nginx/nginx/sourcegraph_backend.conf deleted file mode 100644 index d2450fbb1..000000000 --- a/nginx/nginx/sourcegraph_backend.conf +++ /dev/null @@ -1,8 +0,0 @@ -# @sourcegraph: This file was adapted from https://github.com/sourcegraph/sourcegraph/blob/main/cmd/server/shared/assets/nginx/sourcegraph_backend.conf -# -# Do not remove. This config is included in the upstream context for backend by -# nginx.conf - -# Nginx round-robins between all of the sourcegraph-frontend service endpoints listed here. -# Add/remove 'sourcegraph-frontend-x' addresses here when changing the number of replicas. -server sourcegraph-frontend-0:3080; diff --git a/nginx/nginx/sourcegraph_http.conf b/nginx/nginx/sourcegraph_http.conf deleted file mode 100644 index de9f34b3b..000000000 --- a/nginx/nginx/sourcegraph_http.conf +++ /dev/null @@ -1,9 +0,0 @@ -# @sourcegraph: This file should be kept in sync with https://github.com/sourcegraph/sourcegraph/blob/main/cmd/server/shared/assets/nginx/sourcegraph_http.conf -# -# Do not remove. The contents of sourcegraph_http.conf can change between -# versions and may include improvements to the configuration. -# -# This config is included in the http context by nginx.conf - -# We can upload large extensions -client_max_body_size 150M; diff --git a/nginx/nginx/sourcegraph_main.conf b/nginx/nginx/sourcegraph_main.conf deleted file mode 100644 index 39538dfd6..000000000 --- a/nginx/nginx/sourcegraph_main.conf +++ /dev/null @@ -1,8 +0,0 @@ -# @sourcegraph: This file should be kept in sync with https://github.com/sourcegraph/sourcegraph/blob/main/cmd/server/shared/assets/nginx/sourcegraph_main.conf -# -# Do not remove. The contents of sourcegraph_main.conf can change between -# versions and may include improvements to the configuration. -# -# This config is included in the main context by nginx.conf - -# Intentionally blank diff --git a/nginx/nginx/sourcegraph_server.conf b/nginx/nginx/sourcegraph_server.conf deleted file mode 100644 index b2cdde8ef..000000000 --- a/nginx/nginx/sourcegraph_server.conf +++ /dev/null @@ -1,5 +0,0 @@ -# @sourcegraph: This file should be kept in sync with https://github.com/sourcegraph/sourcegraph/blob/main/cmd/server/shared/assets/nginx/sourcegraph_server.conf -# -# Do not modify. - -# Intentionally blank diff --git a/otel-collector/config.yaml b/otel-collector/config.yaml index c29a89cdf..a06de1961 100644 --- a/otel-collector/config.yaml +++ b/otel-collector/config.yaml @@ -11,7 +11,7 @@ exporters: # Add your exporter(s) configuration here. For each exporter, make sure it is enabled # in the service configuration below. # Refer to our OpenTelemetry docs for information on how to configure different exporters: - # https://docs.sourcegraph.com/admin/observability/opentelemetry + # https://sourcegraph.com/docs/self-hosted/observability/opentelemetry extensions: health_check: diff --git a/pgsql/conf/postgresql.conf b/pgsql/conf/postgresql.conf index f3e95b992..80092d095 100644 --- a/pgsql/conf/postgresql.conf +++ b/pgsql/conf/postgresql.conf @@ -53,4 +53,4 @@ effective_cache_size = 3GB #------------------------------------------------------------------------------ # Add your customization here -# Learn more: https://docs.sourcegraph.com/admin/config/postgres-conf +# Learn more: https://sourcegraph.com/docs/self-hosted/postgres-conf diff --git a/renovate.json b/renovate.json index a58a74a9c..bbd0f43d0 100644 --- a/renovate.json +++ b/renovate.json @@ -21,12 +21,6 @@ "ignoreUnstable": false, "semanticCommits": false, "automerge": true - }, - { - "groupName": "Sourcegraph Docker images list", - "packagePatterns": ["github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images"], - "allowedVersions": "~=0.0.0", - "automerge": true } ], "masterIssue": true, diff --git a/test/Vagrantfile b/test/Vagrantfile index 34db323a6..09bd66030 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -61,7 +61,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| #!/usr/bin/env bash cat << EOF >> /root/.profile export GIT_BRANCH=#{ENV['BUILDKITE_BRANCH']} -export TEST_TYPE=#{ENV['TEST_TYPE']} export DOCKER_USERNAME=#{ENV['DOCKER_USERNAME']} export DOCKER_PASSWORD=#{ENV['DOCKER_PASSWORD']} EOF diff --git a/test/smoke-test.sh b/test/smoke-test.sh index 079ccb6c0..5aac87dca 100755 --- a/test/smoke-test.sh +++ b/test/smoke-test.sh @@ -11,13 +11,11 @@ configure_docker() { gcloud auth configure-docker us-central1-docker.pkg.dev,us-docker.pkg.dev } +expect_containers="25" + deploy_sourcegraph() { cd $(dirname "${BASH_SOURCE[0]}")/.. - #Deploy sourcegraph - if [[ "$TEST_TYPE" == "docker-compose-test" ]]; then - docker-compose --file docker-compose/docker-compose.yaml up -d -t 600 - expect_containers="25" - fi + docker-compose --file docker-compose/docker-compose.yaml up -d -t 600 echo "Giving containers 90s to start..." sleep 90 diff --git a/tools/migrate.sh b/tools/migrate.sh deleted file mode 100755 index 3bffdba9e..000000000 --- a/tools/migrate.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Please ensure the variables in migration vars have been assigned before running this script. - -set -euxo pipefail - -( -# shellcheck source=migration_vars -source migration_vars -) - -image=${image:-sourcegraph/server} -sg_dump_file=$(mktemp) -codeintel_dump_file=$(mktemp) - -trap 'rm -f ${sg_dump_file} ${codeintel_dump_file}' EXIT - -# Get the ID of the sourcegraph container -echo "Obtaing sourcegraph container ID" -container_id=$(ssh "${src_host}" docker ps | grep "${image}:${version}" | cut -f 1 -d ' ') - -# Dump sourcegraph db and alter script for migration -echo "Dumping sourcegraph database" -ssh ${src_host} "docker exec ${container_id} pg_dump -C --username=postgres sourcegraph" >${sg_dump_file} -sed -i '/^CREATE DATABASE/a CREATE USER postgres WITH SUPERUSER CREATEROLE CREATEDB REPLICATION BYPASSRLS;' ${sg_dump_file} >/dev/null 2>&1 -printf '\connect -reuse-previous=on dbname=postgres\nDROP DATABASE sg;\nALTER DATABASE "sourcegraph" RENAME TO sg;\nALTER DATABASE sg OWNER TO sg;\n' >>${sg_dump_file} - -# Dump codeintel db and alter script for migration -echo "Dumping codeintel database" -ssh ${src_host} "docker exec ${container_id} pg_dump -C --username=postgres sourcegraph-codeintel" >${codeintel_dump_file} -sed -i '/^CREATE DATABASE/a CREATE USER postgres WITH SUPERUSER CREATEROLE CREATEDB REPLICATION BYPASSRLS;' ${codeintel_dump_file} >/dev/null 2>&1 -printf '\connect -reuse-previous=on dbname=postgres\nDROP DATABASE sg;\nALTER DATABASE "sourcegraph-codeintel" RENAME TO sg;\nALTER DATABASE sg OWNER TO sg;\n' >>${codeintel_dump_file} - -# Upload database dumps to new docker-compose deployment -echo "Uploading dumps to new deployment" -chmod 544 ${sg_dump_file} ${codeintel_dump_file} -scp ${sg_dump_file} "${dst_host}:${sg_dump_file}" -scp ${codeintel_dump_file} "${dst_host}:${codeintel_dump_file}" - -# Migrate databases and start new deployment -ssh -t "${dst_host}" " -pushd ${compose_dir} -docker-compose down --volumes -docker-compose -f db-only-migrate.docker-compose.yaml up -d -sleep 10 -docker cp ${sg_dump_file} pgsql:${sg_dump_file} -docker cp ${codeintel_dump_file} codeintel-db:${codeintel_dump_file} - -echo 'Starting migration' -docker exec pgsql sh -c 'psql -v ERROR_ON_STOP=1 -U sg -f ${sg_dump_file} postgres' -docker exec codeintel-db sh -c 'psql -v ERROR_ON_STOP=1 -U sg -f ${codeintel_dump_file} postgres' - -docker-compose -f docker-compose.yaml up -d -echo 'TEST: Checking frontend is accessible for 1 minute' - -for i in {1..6}; do -curl -f http://localhost:80 -curl -f http://localhost:80/healthz -sleep 10 -done -echo 'Migration completed' -" diff --git a/tools/migration_vars b/tools/migration_vars deleted file mode 100644 index 198058cb3..000000000 --- a/tools/migration_vars +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -u - -# Please populate the following variables with details of your migration - -# The name of the sourcegraph server image. Defaults to "sourcegraph/server" -IMAGE= - -# The sourcegraph version running on both the source and destination hosts. NOTE: this version must be the same when migration data ie : 3.24.1 -VERSION= - -# The username and hostname of the host you will be migrating from. Takes the form of username@host ie: sourcegraph-user@myhost -SRC_HOST= - -# The username and hostname of the host you will be migrating too. Takes the form of username@host ie: sourcegraph-user@myhost -DST_HOST= - -# Fully qualified path to the docker-compose directory on a host -COMPOSE_DIR= diff --git a/tools/tools.go b/tools/tools.go deleted file mode 100644 index c2dae5113..000000000 --- a/tools/tools.go +++ /dev/null @@ -1,8 +0,0 @@ -//+build tools - -package tools - -import ( - // pins update-docker-tags CLI - _ "github.com/sourcegraph/update-docker-tags" -)