-
The vast majority of the time, Renovate will open PRs in a timely manner.
-
If you want to update them manually, you can update the Docker image versions in
*.Deployment.yamlto match the tagged version that you are releasing.-
You should look at our DockerHub repositories to see what the latest versions are.
-
Make sure to include the sha256 digest for each image, which ensures that each image pull is immutable. Use
docker inspect --format='{{index .RepoDigests 0}}' $IMAGEto get the digest.
-
Wait for buildkite to pass and for your changes to be approved, then merge and check out master.
Test what is currently checked in to master by installing Sourcegraph on a fresh cluster.
Clone https://github.com/sourcegraph/deploy-k8s-helper to your machine and follow the README to set up all the prerequisistes.
- Ensure that the
deploySourcegraphRootvalue in your stack configuration (see https://github.com/sourcegraph/deploy-k8s-helper/blob/master/README.md) is pointing to your deploy-sourcegraph checkout (ex:pulumi config set deploySourcegraphRoot /Users/ggilmore/dev/go/src/github.com/sourcegraph/deploy-sourcegraph) - In your deploy-sourcegraph checkout, make sure that you're on the latest
master - Run
yarn upin your https://github.com/sourcegraph/deploy-k8s-helper checkout - It'll take a few minutes for the cluster to be provisioned and for sourcegraph to be installed. Pulumi will show you the progresss that it's making, and will tell you when it's done.
- Use the instructions in configure.md to:
- Add a repository (e.g. sourcegraph/sourcegraph)
- Enable a language extension (e.g. Go), and test that code intelligence is working on the above repository
- Do a few test searches
- When you're done, run
yarn destroyto tear the cluster down. This can take ~10 minutes.
- In your deploy-sourcegraph checkout, checkout the commit that contains the configuration for the previous release (e.g. the commit that has
2.11.ximages if you're currently trying to release2.12.x, etc.) - Run
yarn upin your https://github.com/sourcegraph/deploy-k8s-helper checkout - Do the same smoke tests that you did above
- In your deploy-sourcegraph checkout, checkout the latest
mastercommit again and runyarn upto deploy the new images. Check to see that the same smoke tests pass after the upgrade process. - When you're done, run
yarn destroyto tear the cluster down.
- Create a cluster unique name that is identifiable to you (e.g
ggilmore-test) in the Sourcegraph Auxiliary GCP Project. - It’ll take a few minutes for it to be provisioned. You’ll see a green checkmark when it is done.
- Click on the
connectbutton next to your cluster, it’ll give you a command to copy+paste in your terminal. - Run the command in your terminal. Once it finishes, run
kubectl config current-context. It should tell you that it’s set up to talk to the cluster that you just created.
- Deploy the latest
masterto your new cluster by running through the quickstart steps in docs/install.md- You'll need to create a GCP Storage Class named
sourcegraphwith the samezonethat you created your cluster in (see "Configure a storage class") - In order to give yourself permissions to create roles on the cluster, run:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $YOUR_NAME@sourcegraph.com
- You'll need to create a GCP Storage Class named
- Use the instructions in configure.md to:
- Add a repository (e.g. sourcegraph/sourcegraph)
- Enable a language extension (e.g. Go), and test that code intelligence is working on the above repository
- Do a couple test searches
- Tear down the cluster that you created above by deleting it through from the Sourcegraph Auxiliary GCP Project.
- Checkout the commit that contains the configuration for the previous release (e.g. the commit has
2.11.ximages if you're currently trying to release2.12.x, etc.) - Use the "Provision a new cluster" instructions above to create a new cluster.
- Deploy the older commit to the new cluster, and do the same smoke tests with the older version.
- Checkout the latest
master, deploy the newer images to the same cluster (without tearing it down in between) by running./kubectl-apply-all.sh, and check to see that the smoke test passes after the upgrade process.
The version numbers for sourcegraph/deploy-sourcegraph largely follow sourcegraph/sourcegraph's version numbers (i.e. deploy-sourcegraph@v2.11.2 uses sourcegraph/sourcegraph's v2.11.2 image tags).
sourcegraph/deploy-sourcegraph's branching strategy
-
Make a branch named
2.12that stems from the currentmasterbranch and push it.2.12will be used as the base for allv2.12.ximages, and future changes to thev2.12.xseries will be cherry-picked onto it and tagged from there.git checkout master git pull # make sure that you're up to date git checkout -b 2.12 git push --set-upstream origin 2.12 -
Follow the tagging instructions below to tag the
v2.12.0release from the2.12branch.
-
Cherry-pick the relevant commits from
masterthat update the image tags tov2.12.1onto the2.12branch (which should have been created as mentioned above).git checkout 2.12 git pull # make sure that you're up to date git cherry-pick commit0 commit1 ... # all relevant commits from the master branch git push
-
Follow the tagging instructions below to tag the
v2.12.1release from the2.12branch.
See this commit as an example of a change that would fall into this category.
-
Cherry-pick the relevant commits from
masterthat update the manifests/docs onto the2.12branch.git checkout 2.12 git pull # make sure that you're up to date git cherry-pick commit0 commit1 ... # all relevant commits from the master branch git push
-
We mark these kinds of releases with a version number that looks like
v2.12.0-2. Note the-2suffix, which increments with each update like this that affects thev2.12.0series. Look at the releases page, and pick thesuffixthat's next in the series. -
Follow the tagging instructions below to tag the
v2.12.0-2release from the2.12branch.
VERSION = vX.Y.Z
# If this is a release candidate: VERSION = `vX.Y.Z-pre${N}` (where `N` starts at 0 and increments as you test/cut new versions)
# 🚨 Make sure that you have the commit that you want to tag as $VERSION checked out!
git tag $VERSION
git push origin $VERSIONYou can use minikube to run Sourcegraph Cluster on your development machine. However, due to minikube requirements and reduced available resources we need to modify the resources to remove resources requests/limits and storageClassNames. Here is the shell commands you can use to spin up minikube:
find base -name '*Deployment.yaml' | while read i; do yj < $i | jq 'walk(if type == "object" then del(.resources) else . end)' | jy -o $i; done
find base -name '*PersistentVolumeClaim.yaml' | while read i; do yj < $i | jq 'del(.spec.storageClassName)' | jy -o $i; done
find base -name '*StatefulSet.yaml' | while read i; do yj < $i | jq 'del(.spec.volumeClaimTemplates[] | .spec.storageClassName) | del(.spec.template.spec.containers[] | .resources)' | jy -o $i; done
minikube start
kubectl create ns src
kubens src
./kubectl-apply-all.sh
kubectl expose deployment sourcegraph-frontend --type=NodePort --name sourcegraph
kubectl expose deployment management-console --type=NodePort --name admin
minikube service listAdditionally you may want to deploy a modified version of a service locally. Minikube allows us to directly connect to its docker instance, making it easy to use unpublished images from the sourcegraph repository:
eval $(minikube docker-env)
IMAGE=repo-updater:dev ./cmd/repo-updater/build.sh
kubectl edit deployment/repo-updater # set imagePullPolicy to Never
kubectl set image deployment repo-updater '*=repo-updater:dev'