Skip to content

Commit

Permalink
Fix network subnet collision, zombie processes, and env vars (#19)
Browse files Browse the repository at this point in the history
* Specifying subnet for docker network
* Use docker compose's default network, so fewer networks need to get created
* Refactoring config to env vars
* Fixing zombie processes
  • Loading branch information
marcleblanc2 authored Feb 23, 2024
1 parent 92d635c commit d1065c1
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 202 deletions.
10 changes: 7 additions & 3 deletions config/docker-compose-common-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
command: ["-config=/sourcegraph/cloud-agent-config.yaml"]
restart: always
networks:
- sourcegraph
- default

src-serve-git:
# Uses a valid hostname as container_name, to trick the cloud agent and code host config into finding this container on the Docker network
Expand All @@ -21,7 +21,11 @@ services:
- ../src-serve-root/:/sourcegraph/src-serve-root:ro
command: "serve-git -addr :443 /sourcegraph/src-serve-root"
networks:
- sourcegraph
- default

networks:
sourcegraph:
default:
ipam:
driver: default
config:
- subnet: "172.20.2.0/27"
6 changes: 3 additions & 3 deletions repo-converter/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ ENV PYTHONDONTWRITEBYTECODE=1
# the application crashes without emitting any logs due to buffering
ENV PYTHONUNBUFFERED=1

# Install python
# Install packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
cron \
gcc \
git \
git-svn \
python3 \
python3-dev \
python3-pip \
python3-wheel \
subversion \
Expand All @@ -31,8 +33,6 @@ RUN apt-get update && \
systemctl enable cron && \
systemctl start cron

# python3-dev \
# gcc \

# Download dependencies as a separate step to take advantage of Docker's caching
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds
Expand Down
4 changes: 2 additions & 2 deletions repo-converter/build/docker-compose-override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ services:

src-serve-git:
# Uses a valid hostname as container_name, to trick the cloud agent and code host config into finding this container on the Docker network
container_name: src-serve-git-wsl.local
command: "-v serve-git -addr :443 /sourcegraph/src-serve-root"
container_name: src-serve-git-ubuntu.local
command: "serve-git -addr :443 /sourcegraph/src-serve-root"
6 changes: 4 additions & 2 deletions repo-converter/build/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ services:
- ../../config/toprc:/root/.config/procps/toprc
- ../../src-serve-root/:/sourcegraph/src-serve-root
environment:
- BRIDGE_REPO_CONVERTER_INTERVAL_SECONDS=60
- LOG_LEVEL=DEBUG # DEBUG INFO WARNING ERROR CRITICAL # Default is INFO
- REPO_CONVERTER_INTERVAL_SECONDS=60
- LOG_LEVEL=DEBUG # DEBUG INFO WARNING ERROR CRITICAL # Default is INFO
# - REPOS_TO_CONVERT="/sourcegraph/repos-to-convert.yaml" # Path inside the container to find this file, only change to match if the right side of the volume mapping changes
# - SRC_SERVE_ROOT="/sourcegraph/src-serve-root" # Path inside the container to find this directory, only change to match if the right side of the volume mapping changes
1 change: 1 addition & 0 deletions repo-converter/build/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
psutil
PyYAML
Loading

0 comments on commit d1065c1

Please sign in to comment.