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
Pull request Compare This branch is even with master.
Latest commit 586fbdc Oct 15, 2018
Permalink
..
Failed to load latest commit information.
archive Makefile: get smarter about GOPATHs Mar 30, 2018
bootstrap Revert "builder: upgrade to go1.11" Sep 17, 2018
builder build: bake aws into the builder image Oct 16, 2018
deploy build: bump RHEL docker image to v2.0.6 Oct 1, 2018
packer packer: fix build and cache warming Sep 29, 2018
.dockercfg.in move .dockercfg template closer to use Jan 26, 2017
.gitignore build: improve Make startup time Jun 1, 2018
README.md readme: update `dep` usage instructions in build/README.md Jul 25, 2018
builder.sh build: bake aws into the builder image Oct 16, 2018
disable-hyperv-timesync.sh acceptance: remove nodectl Aug 19, 2017
go-version-check.sh Revert "builder: upgrade to go1.11" Sep 17, 2018
node-run.sh lint: 🇺🇸🇺🇸🇺🇸 use US locale in TestMisspell 🇺🇸🇺🇸🇺🇸 Nov 30, 2017
shlib.sh build: relieve the Makefile of release configurations Jul 9, 2018
teamcity-acceptance.sh build: relieve the Makefile of release configurations Jul 9, 2018
teamcity-assert-clean.sh build: assert clean for submodules Jun 28, 2018
teamcity-bench.sh build: add teamcity-bench.sh script to run benchshort on CI Jul 27, 2018
teamcity-benchmarks.sh build: upload nightly benchmarks to perfdata.golang.org Jun 1, 2017
teamcity-build-test-binary.sh build: relieve the Makefile of release configurations Jul 9, 2018
teamcity-check.sh Makefile: don't globally install binaries during lint Jul 5, 2018
teamcity-local-roachtest.sh roachtest: squirrel away pre-teamcity logs Sep 21, 2018
teamcity-post-failures.py build: in python issue poster, ignore roachtest/acceptance Sep 25, 2018
teamcity-publish-artifacts.sh teamcity-publish-artifacts: use updated name for cockroach release bi… Jul 30, 2018
teamcity-publish-s3-binaries.sh build: avoid Git race condition when computing build tag Aug 1, 2017
teamcity-rebuild-agent.sh packer: simplify local packer invocation Sep 29, 2018
teamcity-reset-nightlies.sh teamcity-reset-nightlies: clean up storage accounts too Sep 27, 2017
teamcity-sqllogictest.sh build: update configs in nightly sqllogictest runs Jun 5, 2018
teamcity-stress.sh build: fix exit status in teamcity-stress Oct 1, 2018
teamcity-support.sh build: use ccache in nightly stress builds May 23, 2018
teamcity-test-deadlock.sh build: run nightly deadlock build without stress Jul 10, 2018
teamcity-test.sh Merge #25239 May 11, 2018
teamcity-testlogic-verbose.sh build: add test config for logictests with vmodule Sep 26, 2018
teamcity-testlogicrace.sh build: Enable rocksdb assertions in race CI builds Mar 13, 2018
teamcity-testrace.sh build: fix TeamCity race builds Jul 9, 2018
teamcity-trigger.sh teamcity-trigger: plumb TC_BUILD_BRANCH env var into builder Sep 12, 2018
teamcity-urlcheck.sh check: add a new linter that checks that quoted URLs are live. May 14, 2017
teamcity-verify-archive.sh build: make TeamCity build logs more readable Feb 7, 2018
upload-coverage.sh sql: move benchmark tests to a new bench package Nov 20, 2017
variables.mk build: add roachprod-stress tool and make target Sep 28, 2018
verify-archive.sh cli: bump the libedit dep and fix linking isues Apr 5, 2018
werror.sh build: interpret all protoc warnings as errors Nov 30, 2017

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 the Dockerfile in the deploy directory after building a release version of the binary with the development image described in the previous section. The CockroachDB binary will be built inside of that development container, then placed into the minimal deployment container. The resulting image cockroachdb/cockroach can be run via docker run in the usual fashion. To be more specific, the steps to do this are:

go/src/github.com/cockroachdb/cockroach $ ./build/builder.sh make build TYPE=release-linux-gnu
go/src/github.com/cockroachdb/cockroach $ cp ./cockroach-linux-2.6.32-gnu-amd64 build/deploy/cockroach
go/src/github.com/cockroachdb/cockroach $ cd build/deploy && docker build -t cockroachdb/cockroach .

Upgrading / extending the Docker image

Process:

  • edit build/Dockerfile as desired
  • run build/builder.sh init to test -- this will build the image locally. Beware this can take a lot of time. The result of init is a docker image version which you can subsequently stick into the version variable inside the builder.sh script for testing locally.
  • Once you are happy with the result, run build/builder.sh push which pushes your image towards Docker hub, so that it becomes available to others. The result is again a version number, which you then must copy back into builder.sh. Then commit the change to both Dockerfile and builder.sh and submit a PR.

Dependencies

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

Updating Dependencies

This snapshot was built and is managed using dep and we manage vendor as a submodule.

Use the version of dep in .bin (may need to make first): import your new dependency from the Go source you're working on, then run .bin/dep ensure.

Working with Submodules

To keep the bloat of all the changes in all our dependencies out of our main repository, we embed vendor as a git submodule, storing its content and history in vendored instead.

This split across two repositories however means that changes involving changed dependencies require a two step process.

  • After using dep to add or update dependencies and making related code changes, git status in cockroachdb/cockroach checkout will report that the vendor submodule has modified/untracked content.

  • Switch into vendor and commit all changes (or use git -C vendor), on a new named branch.

    • At this point the git status in your cockroachdb/cockroach checkout will report new commits for vendor instead of modified content.
  • Commit your code changes and new vendor submodule ref.

  • Before this commit can be submitted in a pull request to cockroachdb/cockroach, the submodule commit it references must be available on github.com/cockroachdb/vendored.

  • Organization members can push their named branches there directly.

  • Non-members should fork the vendored repo and submit a pull request to cockroachdb/vendored, and need wait for it to merge before they will be able to use it in a cockroachdb/cockroach PR.

master Branch Pointer in Vendored Repo

Since the cockroachdb/cockroach submodule references individual commit hashes in vendored, there is little significance to the master branch in vendored -- as outlined above, new commits are always authored with the previously referenced commit as their parent, regardless of what master happens to be.

That said, it is critical that any ref in vendored that is referenced from cockroachdb/cockroach remain available in vendored in perpetuity: after a PR referencing a ref merges, the vendored master branch should be updated to point to it before the named feature branch can be deleted, to ensure the ref remains reachable and thus is never garbage collected.

Conflicting Submodule Changes

The canonical linearization of history is always the main repo. In the event of concurrent changes to vendor, the first should cause the second to see a conflict on the vendor submodule pointer. When resolving that conflict, it is important to re-run dep against the fetched, updated vendor ref, thus generating a new commit in the submodule that has as its parent the one from the earlier change.

Repository Name

We only want the vendor directory used by builds when it is explicitly checked out and managed as a submodule 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.