Coder Social home page Coder Social logo

deploy-sourcegraph-docker's Introduction

Pure-Docker Sourcegraph cluster deployment reference

sourcegraph: search

There are two recommended ways to deploy Sourcegraph:

But what if your organization wants a multi-machine deployment without using Kubernetes? What if you use a different container management platform, for example? This project aims to solve that, by providing a pure-Docker deployment option.

The goal is that anyone using a container management platform other than Kubernetes (Netflix's Titus, Apache's Mesos, etc.) would be able to use this repository as a reference for how to deploy Sourcegraph.

Deploying

First clone the repository, then:

./deploy.sh

Visit http://localhost:3080 to visit the running Sourcegraph instance!

Tearing down the deployment

./teardown.sh

System topology

To understand the system topology:

  1. Look at deploy.sh to get an overview of services.
  2. Every service (deploy-*.sh) has documentation inline indicating:
    • What the service does / provides.
    • What ports the service exposes.
    • What other services it talks to (see environment variables).

Service system requirements

Every service (deploy-*.sh) documents inline what the system requirements are (CPU/Memory/Disk allocation). For example, the frontend service.

Scaling / replicas

To scale the cluster deployment, you will need to:

  1. Deploy more instances of gitserver, indexed-search, searcher and symbols services as desired.
  2. Configure the frontend and frontend-internal to communicate with the new instances.
  3. You're done! You do not need to configure or restart any other services.

Metrics and Tracing

This deployment comes with metrics and tracing built-in. See metrics and tracing for details.

Configuring HTTPS

See https://docs.sourcegraph.com/admin/nginx#nginx-for-other-sourcegraph-clusters-e-g-pure-docker

Configuring SSH cloning

  1. Ensure your Site admin > External services code host configuration is configured to use SSH. For example, by setting the gitURLType field to "ssh". You may still need to configure an access token or other codehost authentication method in order for Sourcegraph to discover your repositories.

Alternatively, you may use the OTHER codehost type under External services, which allows you to directly specify Git repository URLs for cloning.

  1. Provide your gitserver instances with your SSH / Git configuration (usually just .ssh/id_rsa, .ssh/id_rsa.pub, and .ssh/known_hosts -- but you can also provide other files like .netrc, .gitconfig, etc. if needed) by mounting it into the sourcegraph users home directory in the gitserver containers. For example, by adding the following flag:
-v ~/my-sourcegraph-ssh-config/.ssh:/home/sourcegraph/.ssh

All future Git cloning operations will use the credentials configured there.

If you wish, you can test that cloning with your configuration is working by performing the clone in a gitserver container shell, e.g. first acquire shell access:

$ docker exec -it gitserver-0 sh

Then try cloning the repository:

$ git clone ssh://[email protected]/my/repo /tmp/my-repo

Questions & Issues

Open an issue (in sourcegraph/sourcegraph) or contact us ([email protected]), we are happy to help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.