Switch branches/tags
v2.2.0-alpha.00000000 v2.1.0-beta.20181015 v2.1.0-beta.20181008 v2.1.0-beta.20181001 v2.1.0-beta.20180924 v2.1.0-beta.20180917 v2.1.0-beta.20180910 v2.1.0-beta.20180904 v2.1.0-beta.20180827 v2.1.0-alpha.20180730 v2.1.0-alpha.20180702 v2.1.0-alpha.20180604 v2.1.0-alpha.20180507 v2.1.0-alpha.20180416 v2.1.0-alpha.00000000 v2.0.6 v2.0.6-rc.1 v2.0.5 v2.0.4 v2.0.3 v2.0.2 v2.0.1 v2.0.0 v2.0-rc.1 v2.0-beta.20180326 v2.0-beta.20180319 v2.0-beta.20180312 v2.0-beta.20180305 v2.0-alpha.20180212 v2.0-alpha.20180129 v2.0-alpha.20180122 v2.0-alpha.20180116 v2.0-alpha.20171218 v2.0-alpha.20171218-plus-left-join-fix v1.2-alpha.20171211 v1.2-alpha.20171204 v1.2-alpha.20171113 v1.2-alpha.20171026 v1.2-alpha.20170901 v1.1.9 v1.1.9-rc.1 v1.1.8 v1.1.7 v1.1.6 v1.1.5 v1.1.4 v1.1.3 v1.1.2 v1.1.1 v1.1.0 v1.1.0-rc.1 v1.1-beta.20170928 v1.1-beta.20170921 v1.1-beta.20170907 v1.1-alpha.20170817 v1.1-alpha.20170810 v1.1-alpha.20170803 v1.1-alpha.20170720 v1.1-alpha.20170713 v1.1-alpha.20170629 v1.1-alpha.20170622 v1.1-alpha.20170608 v1.1-alpha.20170601 v1.0.7 v1.0.6 v1.0.5 v1.0.4 v1.0.3 v1.0.2 v1.0.1 v1.0 v1.0-rc.3 v1.0-rc.2 v1.0-rc.1 v0.1-alpha beta-20170420 beta-20170413 beta-20170406 beta-20170330 beta-20170323 beta-20170309 beta-20170223 beta-20170216 beta-20170209 beta-20170126 beta-20170112 beta-20170105 beta-20161215 beta-20161208 beta-20161201 beta-20161110 beta-20161103 beta-20161027 beta-20161013 beta-20161006 beta-20160929 beta-20160915 beta-20160908 beta-20160829 beta-20160728
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
deploy
xgo
.gitignore
.gitkeep
Dockerfile
README.md
authors.sh
build-common.sh
build-docker-deploy.sh
build-osx.sh
build-static-binaries.sh
builder.sh
checkdeps.sh
cockroach.rb
deplicense.sh
errcheck_excludes.txt
init-docker.sh
ldflags.sh
package.json
protobuf.mk
push-aws.sh
push-docker-deploy.sh
push-one-binary.sh
push-release-tarball.sh
push-tagged-aws.sh
style_test.go
teamcity-acceptance.sh
teamcity-check.sh
teamcity-checkdeps.sh
teamcity-jepsen.sh
teamcity-release-upload.sh
teamcity-stress-meta.sh
teamcity-stress.sh
teamcity-test.sh
teamcity-testrace.sh
tool_imports.go
upload-coverage.sh
verify-release-binaries.sh
yarn.lock

README.md

Docker Deploy

Installing docker is a prerequisite. The instructions differ depending on the environment. Docker is comprised of two parts: the daemon server which runs on Linux and accepts commands, and the client which is a Go program capable of running on MacOS, all Unix variants and Windows.

Docker Installation

Follow the Docker install instructions.

Available images

There are development and deploy images available.

Development

The development image is a bulky image containing a complete build toolchain. It is well suited to hacking around and running the tests (including the acceptance tests). To fetch this image, run ./builder.sh pull. The image can be run conveniently via ./builder.sh.

Deployment

The deploy image is a downsized image containing a minimal environment for running CockroachDB. It is based on Debian Jessie and contains only the main CockroachDB binary. To fetch this image, run docker pull cockroachdb/cockroach in the usual fashion.

To build the image yourself, use ./build-docker-deploy.sh. The script will build and run a development container. The CockroachDB binary will be built inside of that container. That binary is built into our minimal container. The resulting image cockroachdb/cockroach can be run via docker run in the usual fashion.

Dependencies

A snapshot of CockroachDB's dependencies is maintained at https://github.com/cockroachdb/vendored and checked out as a sub-module at ./vendor.

Updating Dependencies

This snapshot was built and is managed using glide.

The docs have detailed instructions, but in brief:

  • run ./scripts/glide.sh in cockroachdb/cockroach.
  • add new dependencies with ./scripts/glide.sh get -s github.com/my/dependency
    • Note: if you are adding a non-import dependency (e.g. a binary tool to be used in development), please add a dummy import to build/tool_imports.go. This is a workaround for an upstream issue: https://github.com/Masterminds/glide/issues/690.
  • update dependencies to their latest version with ./scripts/glide.sh up
    • to pin a dependency to a particular version, add a version: ... line to glide.yaml, then update.
    • to update a pinned dependency, change the version in glide.yaml, then update.

Updating a single dependency? glide does not expose a method to just update a single dependency. Since glide attempts to consider the expressed version requirements for all transitive dependencies, updating a single dependency could transitively change the resolution of others, and glide currently chooses to always do a full resolution to address this.

If an attempt to update a dependency is pulling in unwanted/risky changes to another library, you can and perhaps should pin the other library.

You can also, if you really want to, just change the resolution of a single dependency, by editing its resolved version in glide.lock, then re-generating vendor from the edited resolution with scripts/glide.sh install. This is not recommended, as it circumvents the normal resolution logic.

Working with Sub-modules

Since dependencies are stored in their own repository, and cockroachdb/cockroach depends on it, changing a dependency requires pushing two things, in order: first the changes to the vendored repository, then the reference to those changes to the main repository.

After adding or updating dependencies (and running all tests), switch into the vendor sub-module and commit changes (or use git -C). The commit must be available on github.com/cockroachdb/vendored before submitting a pull request to cockroachdb/cockroach that references it.

  • Organization members can push new refs directly.
    • Likely want to git remote set-url origin git@github.com:cockroachdb/vendored.git.
    • If not pushing to master, be sure to tag the ref so that it will not be GC'ed.
  • Non-members should fork the vendored repo, add their fork as a second remote, and submit a pull request.
    • After the pull request is merged, fetch and checkout the new origin/master, and commit that as the new ref in cockroachdb/cockroach.

Repository Name

We only want the vendor directory used by builds when it is explicitly checked out and managed as a sub-module at ./vendor.

If a go build fails to find a dependency in ./vendor, it will continue searching anything named "vendor" in parent directories. Thus the vendor repository is not named "vendor", to minimize the risk of it ending up somewhere in GOPATH with the name vendor (e.g. if it is manually cloned), where it could end up being unintentionally used by builds and causing confusion.