Skip to content

Commit

Permalink
Remove GitHub proxy service (#942)
Browse files Browse the repository at this point in the history
See sourcegraph/sourcegraph#55290, we're removing this service in favor of deployment simplicity with a redis-based equivalent.
  • Loading branch information
eseliger authored Oct 12, 2023
1 parent 60ef9eb commit 216c11b
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 92 deletions.
26 changes: 0 additions & 26 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ services:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'REPO_UPDATER_URL=http://repo-updater:3182'
- 'GRAFANA_SERVER_URL=http://grafana:3370'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
- 'PROMETHEUS_URL=http://prometheus:9090'
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
Expand All @@ -154,7 +153,6 @@ services:
{ "Name": "searcher-0", "Host": "searcher-0:6060" },
{ "Name": "symbols-0", "Host": "symbols-0:6060" },
{ "Name": "repo-updater", "Host": "repo-updater:6060" },
{ "Name": "github-proxy", "Host": "github-proxy:6060" },
{ "Name": "worker", "Host": "worker:6060" },
{ "Name": "zoekt-indexserver-0", "Host": "zoekt-indexserver-0:6072" },
{ "Name": "zoekt-webserver-0", "Host": "zoekt-webserver-0:6070", "DefaultPath": "/debug/requests/" }
Expand Down Expand Up @@ -198,7 +196,6 @@ services:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'REPO_UPDATER_URL=http://repo-updater:3182'
- 'GRAFANA_SERVER_URL=http://grafana:3000'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
- 'PROMETHEUS_URL=http://prometheus:9090'
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
Expand Down Expand Up @@ -236,7 +233,6 @@ services:
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
volumes:
- 'gitserver-0:/data/repos'
networks:
Expand Down Expand Up @@ -321,26 +317,6 @@ services:
- sourcegraph
restart: always

# Description: Rate-limiting proxy for the GitHub API.
#
# CPU: 1
# Memory: 1GB
# Disk: 1GB / non-persistent SSD (only for read-only config file)
# Ports exposed to other Sourcegraph services: 3180/TCP 6060/TCP
# Ports exposed to the public internet: none
#
github-proxy:
container_name: github-proxy
image: 'index.docker.io/sourcegraph/github-proxy:216430_2023-05-02_5.0-3cc9006de32c@sha256:30d4550f51febc1e32ec8af175ef8cce4d1706fd75468572da86f6da451f546f'
cpus: 1
mem_limit: '1g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
networks:
- sourcegraph
restart: always

# Description: Handles conversion of uploaded precise code intelligence bundles.
#
# Ports exposed to other Sourcegraph services: 3188/TCP
Expand Down Expand Up @@ -380,7 +356,6 @@ services:
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
volumes:
- 'repo-updater:/mnt/cache'
networks:
Expand All @@ -405,7 +380,6 @@ services:
- 'SEARCHER_URL=http://searcher-0:3181'
- 'SYMBOLS_URL=http://symbols-0:3184'
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
volumes:
Expand Down
1 change: 0 additions & 1 deletion docker-compose/embeddings/embeddings.docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ services:
{ "Name": "searcher-0", "Host": "searcher-0:6060" },
{ "Name": "symbols-0", "Host": "symbols-0:6060" },
{ "Name": "repo-updater", "Host": "repo-updater:6060" },
{ "Name": "github-proxy", "Host": "github-proxy:6060" },
{ "Name": "worker", "Host": "worker:6060" },
{ "Name": "zoekt-indexserver-0", "Host": "zoekt-indexserver-0:6072" },
{ "Name": "zoekt-webserver-0", "Host": "zoekt-webserver-0:6070", "DefaultPath": "/debug/requests/" },
Expand Down
5 changes: 0 additions & 5 deletions prometheus/prometheus_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
targets:
- cadvisor:8080
- sourcegraph-frontend-internal:6060
- labels:
nodename: "sourcegraph-docker-compose-host"
job: github-proxy
targets:
- github-proxy:6060
- labels:
nodename: "sourcegraph-docker-compose-host"
job: repo-updater
Expand Down
1 change: 0 additions & 1 deletion pure-docker/deploy-frontend-internal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ docker run --detach \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e REPO_UPDATER_URL=http://repo-updater:3182 \
-e GRAFANA_SERVER_URL=http://grafana:3000 \
-e GITHUB_BASE_URL=http://github-proxy:3180 \
-e PROMETHEUS_URL=http://prometheus:9090 \
-e PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore \
-e PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 \
Expand Down
1 change: 0 additions & 1 deletion pure-docker/deploy-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ docker run --detach \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e REPO_UPDATER_URL=http://repo-updater:3182 \
-e GRAFANA_SERVER_URL=http://grafana:3370 \
-e GITHUB_BASE_URL=http://github-proxy:3180 \
-e PROMETHEUS_URL=http://prometheus:9090 \
-e PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore \
-e PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 \
Expand Down
26 changes: 0 additions & 26 deletions pure-docker/deploy-github-proxy.sh

This file was deleted.

1 change: 0 additions & 1 deletion pure-docker/deploy-gitserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ docker run --detach \
-e GOMAXPROCS=4 \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317' \
-e 'GITHUB_BASE_URL=http://github-proxy:3180' \
-v $VOLUME:/data/repos \
index.docker.io/sourcegraph/gitserver:187572_2022-12-06_cbecc5321c7d@sha256:87642b2f0cccbdcd661e470c8f7aa6c022ab03065a2c8ab565afc4b8829a4531

Expand Down
1 change: 0 additions & 1 deletion pure-docker/deploy-repo-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ docker run --detach \
-e GOMAXPROCS=1 \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317' \
-e GITHUB_BASE_URL=http://github-proxy:3180 \
-v $VOLUME:/mnt/cache \
index.docker.io/sourcegraph/repo-updater:187572_2022-12-06_cbecc5321c7d@sha256:0bf2b95c73bceff8c3edb96299175fe36a550f57fd3f5256d38fa2c42992655a

Expand Down
1 change: 0 additions & 1 deletion pure-docker/deploy-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ docker run --detach \
-e GOMAXPROCS=1 \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317' \
-e GITHUB_BASE_URL=http://github-proxy:3180 \
-e INDEXED_SEARCH_SERVERS="$(addresses "zoekt-webserver-" $NUM_INDEXED_SEARCH ":6070")" \
-e SEARCHER_URL="$(addresses "http://searcher-" $NUM_SEARCHER ":3181")" \
-e SRC_GIT_SERVERS="$(addresses "gitserver-" $NUM_GITSERVER ":3178")" \
Expand Down
1 change: 0 additions & 1 deletion pure-docker/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ docker network create sourcegraph &>/dev/null || true

./deploy-node-exporter.sh
./deploy-cadvisor.sh
./deploy-github-proxy.sh
for i in $(seq 0 $(($NUM_GITSERVER - 1))); do ./deploy-gitserver.sh $i; done
./deploy-grafana.sh
./deploy-precise-code-intel-worker.sh
Expand Down
51 changes: 25 additions & 26 deletions pure-docker/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,30 @@ cd "$root_dir"
source ./replicas.sh

docker rm -f node-exporter &>/dev/null || true &
docker rm -f cadvisor &> /dev/null || true &
docker rm -f caddy &> /dev/null || true &
docker rm -f sourcegraph-frontend-internal &> /dev/null || true &
docker rm -f $(addresses "sourcegraph-frontend-" $NUM_FRONTEND "") &> /dev/null || true &
docker rm -f github-proxy &> /dev/null || true &
docker rm -f $(addresses "gitserver-" $NUM_GITSERVER "") &> /dev/null || true &
docker rm -f grafana &> /dev/null || true
docker rm -f jaeger &> /dev/null || true
docker rm -f precise-code-intel-worker &> /dev/null || true
docker rm -f pgsql &> /dev/null || true &
docker rm -f codeintel-db &> /dev/null || true &
docker rm -f codeinsights-db &> /dev/null || true &
docker rm -f blobstore &> /dev/null || true &
docker rm -f migrator &> /dev/null || true &
docker rm -f prometheus &> /dev/null || true
docker rm -f redis-cache &> /dev/null || true &
docker rm -f redis-store &> /dev/null || true &
docker rm -f repo-updater &> /dev/null || true &
docker rm -f worker &> /dev/null || true &
docker rm -f $(addresses "searcher-" $NUM_SEARCHER "") &> /dev/null || true &
docker rm -f $(addresses "symbols-" $NUM_SYMBOLS "") &> /dev/null || true &
docker rm -f syntect-server &> /dev/null || true &
docker rm -f $(addresses "zoekt-indexserver-" $NUM_INDEXED_SEARCH "") &> /dev/null || true &
docker rm -f $(addresses "zoekt-webserver-" $NUM_INDEXED_SEARCH "") &> /dev/null || true &
docker rm -f otel-collector &> /dev/null || true &
docker rm -f cadvisor &>/dev/null || true &
docker rm -f caddy &>/dev/null || true &
docker rm -f sourcegraph-frontend-internal &>/dev/null || true &
docker rm -f $(addresses "sourcegraph-frontend-" $NUM_FRONTEND "") &>/dev/null || true &
docker rm -f $(addresses "gitserver-" $NUM_GITSERVER "") &>/dev/null || true &
docker rm -f grafana &>/dev/null || true
docker rm -f jaeger &>/dev/null || true
docker rm -f precise-code-intel-worker &>/dev/null || true
docker rm -f pgsql &>/dev/null || true &
docker rm -f codeintel-db &>/dev/null || true &
docker rm -f codeinsights-db &>/dev/null || true &
docker rm -f blobstore &>/dev/null || true &
docker rm -f migrator &>/dev/null || true &
docker rm -f prometheus &>/dev/null || true
docker rm -f redis-cache &>/dev/null || true &
docker rm -f redis-store &>/dev/null || true &
docker rm -f repo-updater &>/dev/null || true &
docker rm -f worker &>/dev/null || true &
docker rm -f $(addresses "searcher-" $NUM_SEARCHER "") &>/dev/null || true &
docker rm -f $(addresses "symbols-" $NUM_SYMBOLS "") &>/dev/null || true &
docker rm -f syntect-server &>/dev/null || true &
docker rm -f $(addresses "zoekt-indexserver-" $NUM_INDEXED_SEARCH "") &>/dev/null || true &
docker rm -f $(addresses "zoekt-webserver-" $NUM_INDEXED_SEARCH "") &>/dev/null || true &
docker rm -f otel-collector &>/dev/null || true &

docker network rm sourcegraph &> /dev/null || true &
docker network rm sourcegraph &>/dev/null || true &
wait
4 changes: 2 additions & 2 deletions test/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ deploy_sourcegraph() {
if [[ "$TEST_TYPE" == "pure-docker-test" ]]; then
./test/volume-config.sh
timeout 600s ./pure-docker/deploy.sh
expect_containers="26"
expect_containers="25"
elif [[ "$TEST_TYPE" == "docker-compose-test" ]]; then
docker-compose --file docker-compose/docker-compose.yaml up -d -t 600
expect_containers="27"
expect_containers="26"
fi

echo "Giving containers 90s to start..."
Expand Down

0 comments on commit 216c11b

Please sign in to comment.