diff --git a/docker-compose/db-only-migrate.docker-compose.yaml b/docker-compose/db-only-migrate.docker-compose.yaml deleted file mode 100644 index 353c40b7e..000000000 --- a/docker-compose/db-only-migrate.docker-compose.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# 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 MUST be kept in sync with the pgsql definition in docker-compose/docker-compose.yaml -version: '2.4' -services: - # Description: PostgreSQL database for various data. - # - # Disk: 128GB / persistent SSD - # Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP - # Ports exposed to the public internet: none - # - pgsql: - container_name: pgsql - image: 'index.docker.io/sourcegraph/postgres-12-alpine:5.10.0@sha256:5df73dbaf7714e7a9ccaeb1d2f9ec6a84e9f746ec2ef46296d95bb693bad8ffe' - cpus: 4 - mem_limit: '2g' - healthcheck: - test: '/liveness.sh' - interval: 10s - timeout: 1s - retries: 3 - start_period: 15s - volumes: - - 'pgsql:/data/' - networks: - - sourcegraph - restart: always - - codeintel-db: - container_name: codeintel-db - image: 'index.docker.io/sourcegraph/codeintel-db:5.10.0@sha256:5df73dbaf7714e7a9ccaeb1d2f9ec6a84e9f746ec2ef46296d95bb693bad8ffe' - cpus: 4 - mem_limit: '2g' - healthcheck: - test: '/liveness.sh' - interval: 10s - timeout: 1s - retries: 3 - start_period: 15s - volumes: - - 'codeintel-db:/data/' - networks: - - sourcegraph - restart: always - -volumes: - pgsql: - codeintel-db: -networks: - sourcegraph: diff --git a/docker-compose/scripts/install-aws.sh b/docker-compose/scripts/install-aws.sh deleted file mode 100644 index 6e6e66fb8..000000000 --- a/docker-compose/scripts/install-aws.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail -############################################################################### -# ACTION REQUIRED: REPLACE THE URL AND REVISION WITH YOUR DEPLOYMENT REPO INFO -############################################################################### -# Please read the notes below the script if you are cloning a private repository -# Example: DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION='v4.1.3' -DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION="$1" -DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL="$2" -##################### NO CHANGES REQUIRED BELOW THIS LINE ##################### -if [ "$2" = "" ]; then - DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL='https://github.com/sourcegraph/deploy-sourcegraph-docker.git' -fi -DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT='/home/ec2-user/deploy-sourcegraph-docker' -DOCKER_COMPOSE_VERSION='1.29.2' -DOCKER_DAEMON_CONFIG_FILE='/etc/docker/daemon.json' -DOCKER_DATA_ROOT='/mnt/docker-data' -EBS_VOLUME_DEVICE_NAME='/dev/sdb' -EBS_VOLUME_LABEL='sourcegraph' -# Install git -yum update -y -yum install git -y -# Clone the deployment repository -git clone "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL}" "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -git checkout "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION}" -# Format (if unformatted) and then mount the attached volume -device_fs=$(lsblk "${EBS_VOLUME_DEVICE_NAME}" --noheadings --output fsType) -if [ "${device_fs}" == "" ]; then - mkfs -t xfs "${EBS_VOLUME_DEVICE_NAME}" -fi -xfs_admin -L "${EBS_VOLUME_LABEL}" "${EBS_VOLUME_DEVICE_NAME}" -mkdir -p "${DOCKER_DATA_ROOT}" -mount -L "${EBS_VOLUME_LABEL}" "${DOCKER_DATA_ROOT}" -# Mount file system by label on reboot -echo "LABEL=${EBS_VOLUME_LABEL} ${DOCKER_DATA_ROOT} xfs defaults,nofail 0 2" >>'/etc/fstab' -umount "${DOCKER_DATA_ROOT}" -mount -a -# Install, configure, and enable Docker -yum update -y -amazon-linux-extras install docker -systemctl enable --now docker -sed -i -e 's/1024/262144/g' /etc/sysconfig/docker -sed -i -e 's/4096/262144/g' /etc/sysconfig/docker -usermod -a -G docker ec2-user -# Install jq for scripting -yum install -y jq -## Initialize the config file with empty json if it doesn't exist -if [ ! -f "${DOCKER_DAEMON_CONFIG_FILE}" ]; then - mkdir -p $(dirname "${DOCKER_DAEMON_CONFIG_FILE}") - echo '{}' >"${DOCKER_DAEMON_CONFIG_FILE}" -fi -## Point Docker storage to mounted volume -tmp_config=$(mktemp) -trap "rm -f ${tmp_config}" EXIT -cat "${DOCKER_DAEMON_CONFIG_FILE}" | jq --arg DATA_ROOT "${DOCKER_DATA_ROOT}" '.["data-root"]=$DATA_ROOT' >"${tmp_config}" -cat "${tmp_config}" >"${DOCKER_DAEMON_CONFIG_FILE}" -# Restart Docker daemon to pick up new changes -systemctl restart --now docker -# Install Docker Compose -curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose -curl -L "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose -# Start Sourcegraph with Docker Compose -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}"/docker-compose -docker-compose up -d --remove-orphans diff --git a/docker-compose/scripts/install-azure.sh b/docker-compose/scripts/install-azure.sh deleted file mode 100644 index 70d266cbc..000000000 --- a/docker-compose/scripts/install-azure.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail -############################################################################### -# ACTION REQUIRED: REPLACE THE URL AND REVISION WITH YOUR DEPLOYMENT REPO INFO -############################################################################### -# Please read the notes below the script if you are cloning a private repository -# Example: DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION='v4.1.3' -DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION="$1" -DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL="$2" -##################### NO CHANGES REQUIRED BELOW THIS LINE ##################### -if [ "$2" = "" ]; then - DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL='https://github.com/sourcegraph/deploy-sourcegraph-docker.git' -fi -DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT='/root/deploy-sourcegraph-docker' -DOCKER_COMPOSE_VERSION='1.29.2' -DOCKER_DAEMON_CONFIG_FILE='/etc/docker/daemon.json' -DOCKER_DATA_ROOT='/mnt/docker-data' -PERSISTENT_DISK_DEVICE_NAME='/dev/sdb' -PERSISTENT_DISK_LABEL='sourcegraph' -# Install git -sudo apt-get update -y -sudo apt-get install -y git -# Clone the deployment repository -git clone "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL}" "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -git checkout "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION}" -# Format (if unformatted) and then mount the attached volume -device_fs=$(sudo lsblk "${PERSISTENT_DISK_DEVICE_NAME}" --noheadings --output fsType) -if [ "${device_fs}" == "" ]; then - sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard "${PERSISTENT_DISK_DEVICE_NAME}" -fi -sudo e2label "${PERSISTENT_DISK_DEVICE_NAME}" "${PERSISTENT_DISK_LABEL}" -sudo mkdir -p "${DOCKER_DATA_ROOT}" -sudo mount -o discard,defaults "${PERSISTENT_DISK_DEVICE_NAME}" "${DOCKER_DATA_ROOT}" -# Mount file system by label on reboot -sudo echo "LABEL=${PERSISTENT_DISK_LABEL} ${DOCKER_DATA_ROOT} ext4 discard,defaults,nofail 0 2" | sudo tee -a /etc/fstab -sudo umount "${DOCKER_DATA_ROOT}" -sudo mount -a -# Install, configure, and enable Docker -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo apt-get update -y -sudo apt-get install -y software-properties-common -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -sudo apt-get update -y -apt-cache policy docker-ce -apt-get install -y docker-ce docker-ce-cli containerd.io -## Enable Docker at startup -sudo systemctl enable --now docker -## Install jq for scripting -sudo apt-get update -y -sudo apt-get install -y jq -## Initialize the config file with empty json if it doesn't exist -if [ ! -f "${DOCKER_DAEMON_CONFIG_FILE}" ]; then - mkdir -p $(dirname "${DOCKER_DAEMON_CONFIG_FILE}") - echo '{}' >"${DOCKER_DAEMON_CONFIG_FILE}" -fi -## Point Docker storage to mounted volume -tmp_config=$(mktemp) -trap "rm -f ${tmp_config}" EXIT -sudo cat "${DOCKER_DAEMON_CONFIG_FILE}" | sudo jq --arg DATA_ROOT "${DOCKER_DATA_ROOT}" '.["data-root"]=$DATA_ROOT' >"${tmp_config}" -sudo cat "${tmp_config}" >"${DOCKER_DAEMON_CONFIG_FILE}" -## Restart Docker daemon to pick up new changes -sudo systemctl restart --now docker -# Install Docker Compose -curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose -curl -L "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose -# Start Sourcegraph with Docker Compose -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}"/docker-compose -docker-compose up -d --remove-orphans diff --git a/docker-compose/scripts/install-digitalocean.sh b/docker-compose/scripts/install-digitalocean.sh deleted file mode 100644 index 767f468fd..000000000 --- a/docker-compose/scripts/install-digitalocean.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail -############################################################################### -# ACTION REQUIRED: REPLACE THE URL AND REVISION WITH YOUR DEPLOYMENT REPO INFO -############################################################################### -# Please read the notes below the script if you are cloning a private repository -# Example: DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION='v4.1.3' -DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION="$1" -DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL="$2" -##################### NO CHANGES REQUIRED BELOW THIS LINE ##################### -if [ "$2" = "" ]; then - DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL='https://github.com/sourcegraph/deploy-sourcegraph-docker.git' -fi -DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT='/root/deploy-sourcegraph-docker' -DOCKER_DATA_ROOT='/mnt/docker-data' -DOCKER_COMPOSE_VERSION='1.29.2' -DOCKER_DAEMON_CONFIG_FILE='/etc/docker/daemon.json' -PERSISTENT_DISK_DEVICE_NAME='/dev/sda' -# Install git -sudo apt-get update -y -sudo apt-get install -y git -# Clone the deployment repository -git clone "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL}" "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -git checkout "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION}" -# Format (if unformatted) and then mount the attached volume -device_fs=$(sudo lsblk "${PERSISTENT_DISK_DEVICE_NAME}" --noheadings --output fsType) -if [ "${device_fs}" == "" ]; then - sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard "${PERSISTENT_DISK_DEVICE_NAME}" -fi -sudo mkdir -p "${DOCKER_DATA_ROOT}" -sudo mount -o discard,defaults "${PERSISTENT_DISK_DEVICE_NAME}" "${DOCKER_DATA_ROOT}" -# Mount file system by UUID on reboot -DISK_UUID=$(sudo blkid -s UUID -o value "${PERSISTENT_DISK_DEVICE_NAME}") -sudo echo "UUID=${DISK_UUID} ${DOCKER_DATA_ROOT} ext4 discard,defaults,nofail 0 2" >>'/etc/fstab' -sudo umount "${DOCKER_DATA_ROOT}" -sudo mount -a -# Install, configure, and enable Docker -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -sudo apt-get update -y -apt-cache policy docker-ce -apt-get install -y docker-ce docker-ce-cli containerd.io -## Enable Docker at startup -sudo systemctl enable --now docker -# Install jq for scripting -sudo apt-get update -y -sudo apt-get install -y jq -## Initialize the config file with empty json if it doesn't exist -if [ ! -f "${DOCKER_DAEMON_CONFIG_FILE}" ]; then - mkdir -p $(dirname "${DOCKER_DAEMON_CONFIG_FILE}") - echo '{}' >"${DOCKER_DAEMON_CONFIG_FILE}" -fi -## Point Docker storage to mounted volume -tmp_config=$(mktemp) -trap "rm -f ${tmp_config}" EXIT -sudo cat "${DOCKER_DAEMON_CONFIG_FILE}" | sudo jq --arg DATA_ROOT "${DOCKER_DATA_ROOT}" '.["data-root"]=$DATA_ROOT' >"${tmp_config}" -sudo cat "${tmp_config}" >"${DOCKER_DAEMON_CONFIG_FILE}" -## Restart Docker daemon to pick up new changes -sudo systemctl restart --now docker -# Install Docker Compose -curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose -curl -L "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose -# Start Sourcegraph with Docker Compose -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}"/docker-compose -docker-compose up -d --remove-orphans diff --git a/docker-compose/scripts/install-gcp.sh b/docker-compose/scripts/install-gcp.sh deleted file mode 100644 index d61525ce2..000000000 --- a/docker-compose/scripts/install-gcp.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail -############################################################################### -# ACTION REQUIRED: REPLACE THE URL AND REVISION WITH YOUR DEPLOYMENT REPO INFO -############################################################################### -# Please read the notes below the script if you are cloning a private repository -# Example: DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION='v4.1.3' -DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION="$1" -DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL="$2" -##################### NO CHANGES REQUIRED BELOW THIS LINE ##################### -if [ "$2" = "" ]; then - DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL='https://github.com/sourcegraph/deploy-sourcegraph-docker.git' -fi -DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT='/root/deploy-sourcegraph-docker' -DOCKER_COMPOSE_VERSION='1.29.2' -DOCKER_DAEMON_CONFIG_FILE='/etc/docker/daemon.json' -DOCKER_DATA_ROOT='/mnt/docker-data' -PERSISTENT_DISK_DEVICE_NAME='/dev/sdb' -PERSISTENT_DISK_LABEL='sourcegraph' -# Install git -sudo apt-get update -y -sudo apt-get install -y git -# Clone the deployment repository -git clone "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_CLONE_URL}" "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}" -git checkout "${DEPLOY_SOURCEGRAPH_DOCKER_FORK_REVISION}" -# Format (if unformatted) and then mount the attached volume -device_fs=$(sudo lsblk "${PERSISTENT_DISK_DEVICE_NAME}" --noheadings --output fsType) -if [ "${device_fs}" == "" ]; then ## only format the volume if it isn't already formatted - sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard "${PERSISTENT_DISK_DEVICE_NAME}" -fi -sudo e2label "${PERSISTENT_DISK_DEVICE_NAME}" "${PERSISTENT_DISK_LABEL}" -sudo mkdir -p "${DOCKER_DATA_ROOT}" -sudo mount -o discard,defaults "${PERSISTENT_DISK_DEVICE_NAME}" "${DOCKER_DATA_ROOT}" -# Mount file system by label on reboot -sudo echo "LABEL=${PERSISTENT_DISK_LABEL} ${DOCKER_DATA_ROOT} ext4 discard,defaults,nofail 0 2" | sudo tee -a /etc/fstab -sudo umount "${DOCKER_DATA_ROOT}" -sudo mount -a -# Install, configure, and enable Docker -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo apt-get update -y -sudo apt-get install -y software-properties-common -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -sudo apt-get update -y -apt-cache policy docker-ce -apt-get install -y docker-ce docker-ce-cli containerd.io -## Enable Docker at startup -sudo systemctl enable --now docker -## Install jq for scripting -sudo apt-get update -y -sudo apt-get install -y jq -## Initialize the config file with empty json if it doesn't exist -if [ ! -f "${DOCKER_DAEMON_CONFIG_FILE}" ]; then - mkdir -p $(dirname "${DOCKER_DAEMON_CONFIG_FILE}") - echo '{}' >"${DOCKER_DAEMON_CONFIG_FILE}" -fi -## Point Docker storage to mounted volume -tmp_config=$(mktemp) -trap "rm -f ${tmp_config}" EXIT -sudo cat "${DOCKER_DAEMON_CONFIG_FILE}" | sudo jq --arg DATA_ROOT "${DOCKER_DATA_ROOT}" '.["data-root"]=$DATA_ROOT' >"${tmp_config}" -sudo cat "${tmp_config}" >"${DOCKER_DAEMON_CONFIG_FILE}" -## Restart Docker daemon to pick up new changes -sudo systemctl restart --now docker -# Install Docker Compose -curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose -curl -L "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose -# Start Sourcegraph with Docker Compose -cd "${DEPLOY_SOURCEGRAPH_DOCKER_CHECKOUT}"/docker-compose -docker-compose up -d --remove-orphans