Skip to content

Commit

Permalink
prepare to rename default branch to main
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Dec 7, 2022
1 parent 5b19dbb commit 5c611ad
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 54 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ name: Continuous Deployment
# ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
concurrency: deploy

# Only trigger the workflow when pushing to master or a label is applied to a
# Only trigger the workflow when pushing to main or a label is applied to a
# Pull Request
on:
push:
branches:
- master
- main
- test-this-pr/**
pull_request:
types: [labeled]
Expand Down Expand Up @@ -63,10 +63,10 @@ jobs:
# images that the jobs to deploy to the production environments depend on.
staging-deploy:
# Only run the job if the 'test-staging' label is present OR if the event
# is a push to master
# is a push to main
if: |
(github.event.label.name == 'test-staging') ||
((github.event_name == 'push') && (github.ref == 'refs/heads/master')) ||
((github.event_name == 'push') && (github.ref == 'refs/heads/main')) ||
((github.event_name == 'push') && contains(github.ref, 'test-this-pr'))
runs-on: ubuntu-20.04
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-preventing-a-specific-failing-matrix-job-from-failing-a-workflow-run
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:

- name: "Stage 1: Install and setup helm ${{ env.HELM_VERSION }}"
run: |
curl -sf https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | DESIRED_VERSION=${HELM_VERSION} bash
curl -sf https://raw.githubusercontent.com/helm/helm/HEAD/scripts/get-helm-3 | DESIRED_VERSION=${HELM_VERSION} bash
helm dependency update ./mybinder
# Action Repo: https://github.com/sliteteam/github-action-git-crypt-unlock
Expand Down Expand Up @@ -195,8 +195,8 @@ jobs:
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds
needs: staging-deploy

# Only run job if the event is a push to master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# Only run job if the event is a push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

runs-on: ubuntu-20.04

Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:

- name: "Stage 1: Install and setup helm ${{ env.HELM_VERSION }}"
run: |
curl -sf https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | DESIRED_VERSION=${HELM_VERSION} bash
curl -sf https://raw.githubusercontent.com/helm/helm/HEAD/scripts/get-helm-3 | DESIRED_VERSION=${HELM_VERSION} bash
helm dependency update ./mybinder
- name: "Stage 2: Unlock git-crypt secrets"
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/watch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
uses: peter-evans/[email protected]
# Don't try open PRs in forks or when the job is triggered by a push to
# a branch other than the default branch.
if: github.repository == 'jupyterhub/mybinder.org-deploy' && (github.event_name != 'push' || github.ref == 'refs/heads/master')
if: github.repository == 'jupyterhub/mybinder.org-deploy' && (github.event_name != 'push' || github.ref == 'refs/heads/main')
with:
token: "${{ secrets.jupyterhub_bot_pat }}"
author: JupterHub Bot Account <[email protected]>
Expand Down Expand Up @@ -131,29 +131,29 @@ jobs:
#
- chart_dep_name: binderhub
chart_dep_chart_changelog_url: ""
chart_dep_app_changelog_url: "https://github.com/jupyterhub/binderhub/blob/master/CHANGES.md"
chart_dep_source_url: "https://github.com/jupyterhub/binderhub/tree/master/helm-chart"
chart_dep_app_changelog_url: "https://github.com/jupyterhub/binderhub/blob/HEAD/CHANGES.md"
chart_dep_source_url: "https://github.com/jupyterhub/binderhub/tree/HEAD/helm-chart"
chart_dep_devel_flag: "--devel"
github_repo: jupyterhub/binderhub

- chart_dep_name: ingress-nginx
chart_dep_chart_changelog_url: "https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx#upgrading-chart"
chart_dep_app_changelog_url: "https://github.com/kubernetes/ingress-nginx/blob/master/Changelog.md"
chart_dep_source_url: "https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx"
chart_dep_chart_changelog_url: "https://github.com/kubernetes/ingress-nginx/tree/HEAD/charts/ingress-nginx#upgrading-chart"
chart_dep_app_changelog_url: "https://github.com/kubernetes/ingress-nginx/blob/HEAD/Changelog.md"
chart_dep_source_url: "https://github.com/kubernetes/ingress-nginx/tree/HEAD/charts/ingress-nginx"
chart_dep_devel_flag: ""
github_repo: ""

- chart_dep_name: prometheus
chart_dep_chart_changelog_url: "https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus#upgrading-chart"
chart_dep_app_changelog_url: "https://github.com/prometheus/prometheus/blob/master/CHANGELOG.md"
chart_dep_source_url: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus
chart_dep_chart_changelog_url: "https://github.com/prometheus-community/helm-charts/tree/HEAD/charts/prometheus#upgrading-chart"
chart_dep_app_changelog_url: "https://github.com/prometheus/prometheus/blob/HEAD/CHANGELOG.md"
chart_dep_source_url: https://github.com/prometheus-community/helm-charts/tree/HEAD/charts/prometheus
chart_dep_devel_flag: ""
github_repo: ""

- chart_dep_name: grafana
chart_dep_chart_changelog_url: "https://github.com/grafana/helm-charts/tree/main/charts/grafana#upgrading-an-existing-release-to-a-new-major-version"
chart_dep_app_changelog_url: "https://github.com/grafana/grafana/blob/master/CHANGELOG.md"
chart_dep_source_url: "https://github.com/grafana/helm-charts/tree/main/charts/grafana"
chart_dep_app_changelog_url: "https://github.com/grafana/grafana/blob/HEAD/CHANGELOG.md"
chart_dep_source_url: "https://github.com/grafana/helm-charts/tree/HEAD/charts/grafana"
chart_dep_devel_flag: ""
github_repo: ""

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
uses: peter-evans/[email protected]
# Don't try open PRs in forks or when the job is triggered by a push to
# a branch other than the default branch.
if: github.repository == 'jupyterhub/mybinder.org-deploy' && (github.event_name != 'push' || github.ref == 'refs/heads/master')
if: github.repository == 'jupyterhub/mybinder.org-deploy' && (github.event_name != 'push' || github.ref == 'refs/heads/main')
with:
token: "${{ secrets.jupyterhub_bot_pat }}"
author: JupterHub Bot Account <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Amongst other things the guide contains:
- [How to do a deployment](https://mybinder-sre.readthedocs.io/en/latest/deployment/how.html)
- [What happens during a deployment?](https://mybinder-sre.readthedocs.io/en/latest/deployment/what.html)
- [Incident reports for past incidents](https://mybinder-sre.readthedocs.io/en/latest/incident-reports/incident_reports_toc.html)
- [Incident report template](https://github.com/jupyterhub/mybinder.org-deploy/blob/master/docs/source/incident-reports/template-incident-report.md)
- [Incident report template](https://github.com/jupyterhub/mybinder.org-deploy/blob/HEAD/docs/source/incident-reports/template-incident-report.md)

## Key Links

Expand Down
14 changes: 7 additions & 7 deletions docs/source/analytics/events-archive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ file named ``events-<YYYY>-<MM>-<DD>.jsonl`` that contains data for
all the launches performed by mybinder.org on that date. All timestamps
and dates are in `UTC <https://en.wikipedia.org/wiki/Coordinated_Universal_Time>`_.

Each line is a JSON object that conforms to `this JSON Schema
<https://github.com/jupyterhub/binderhub/blob/master/binderhub/event-schemas/launch.json>`_.
Each line is a JSON object that conforms to `this JSON Schema
<https://github.com/jupyterhub/binderhub/blob/HEAD/binderhub/event-schemas/launch.json>`_.
A description of these fields is provided below.

#. **schema** and **version**
Expand All @@ -54,14 +54,14 @@ A description of these fields is provided below.
#. **provider**

Where the launched repository was hosted. Current options are ``GitHub``,
``GitLab`` and ``Git``.
``GitLab`` and ``Git``.

#. **spec**

Specification identifying the repository / commit immutably & uniquely in
the provider.

For GitHub, it is ``<repo>/<commit-spec>``. Example would be ``yuvipanda/example-requirements/master``.
For GitHub, it is ``<repo>/<commit-spec>``. Example would be ``yuvipanda/example-requirements/HEAD``.
For GitLab, it is ``<repo>/<commit-spec>``, except ``repo`` is URL escaped.
For raw Git repositories, it is ``<repo-url>/<commit-spec>``. ``repo-url`` is full URL escaped
to the repo and ``commit-spec`` is a full commit hash.
Expand All @@ -75,22 +75,22 @@ Example code
------------

Some popular ways of reading this event data into a useful data structure are
provided here.
provided here.

``pandas``
~~~~~~~~~~

.. code-block:: python
import pandas as pd
df = pd.read_json("https://archive.analytics.mybinder.org/events-2018-11-05.jsonl", lines=True)
df = pd.read_json("https://archive.analytics.mybinder.org/events-2018-11-05.jsonl", lines=True)
df
Plain Python
~~~~~~~~~~~~

.. code-block:: python
import requests
import json
Expand Down
2 changes: 1 addition & 1 deletion docs/source/components/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ the name of the repository + the commit hash. This lets us check if
the image has already been built, and if so, we can skip the building step.

The code for generating the image name from repository information is
in [binderhub's builder.py](https://github.com/jupyterhub/binderhub/blob/master/binderhub/builder.py),
in [binderhub's builder.py](https://github.com/jupyterhub/binderhub/blob/HEAD/binderhub/builder.py),
under `_generate_build_name`.

Sometimes, we _do_ want to invalidate all previously built images - for example,
Expand Down
6 changes: 3 additions & 3 deletions docs/source/components/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ we decided to use nginx instead for the following reasons:

### Installation

nginx-ingress is installed using the [nginx-ingress helm chart](https://github.com/helm/charts/tree/master/stable/nginx-ingress).
nginx-ingress is installed using the [nginx-ingress helm chart](https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx).
This installs the following components:

1. `nginx-ingress-controller` - keeps the HTTPS rules in sync with `Ingress`
Expand All @@ -55,7 +55,7 @@ The following ingress objects currently exist:
- `jupyterhub` - Directs traffic to `hub.mybinder.org`.
The zero-to-jupyterhub guide has more [documentation](https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/advanced.html#ingress).
- `binderhub` - Directs traffic to `mybinder.org`. You can find more details
about this in the [binderhub helm chart](https://github.com/jupyterhub/binderhub/tree/master/helm-chart).
about this in the [binderhub helm chart](https://github.com/jupyterhub/binderhub/tree/HEAD/helm-chart).
- `redirector` - Directs traffic to the HTTP redirector we run for `mybinder.org`.
This helps do redirects such as `docs.mybinder.org` or `beta.mybinder.org`.
The list of redirects is configured in `mybinder/values.yaml`. The code
Expand Down Expand Up @@ -84,7 +84,7 @@ Kube-lego is deprecated, and we should move to

### Installation

kube-lego is installed using the [kube-lego](https://github.com/helm/charts/tree/master/stable/kube-lego).
kube-lego is installed using the [kube-lego](https://github.com/helm/charts/tree/HEAD/stable/kube-lego).

### Configuration

Expand Down
6 changes: 3 additions & 3 deletions docs/source/components/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ these containers using right now', etc. These are usually prefixed with

#### HTTP request information

We use the [nginx-ingress helm chart](https://github.com/helm/charts/tree/master/stable/nginx-ingress)
We use the [nginx-ingress helm chart](https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx)
to let all HTTP traffic into our cluster. This allows us to use
the [nginx VTS exporter](https://hnlq715.github.io/nginx-vts-exporter/)
to collect information in prometheus about requests / responses.
Expand All @@ -103,7 +103,7 @@ These are currently somewhat limited, and prefixed with `binderhub_`
### Configuration

Prometheus is installed using the
[prometheus helm chart](https://github.com/helm/charts/tree/master/stable/prometheus).
[prometheus helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus).
This installs the following components:

1. Prometheus server (storage + querying)
Expand All @@ -115,6 +115,6 @@ kubernetes component), and the prometheus helm chart has configuration
that adds those as targets.

You can see the available options for configuring the prometheus
helm chart in its [values.yaml](https://github.com/helm/charts/blob/master/stable/prometheus/values.yaml)
helm chart in its [values.yaml](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus/values.yaml)
file. You can see the current configuration we have under the `prometheus`
section of `mybinder/values.yaml`, `config/prod.yaml` and `config/staging.yaml`.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
html_context = {
"github_user": "jupyterhub",
"github_repo": "mybinder.org-deploy",
"github_version": "master",
"github_version": "HEAD",
"doc_path": "docs/source",
}

Expand Down
12 changes: 6 additions & 6 deletions docs/source/deployment/how.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Deployments to mybinder.org should be:
not require specific sysadmin knowledge.

3. **Timely**. We deploy changes to repo2docker and BinderHub within a few days of
them being merged into master.
them being merged into main.

These are all **aspirational** - we strive for hitting the above points,
but recognize that work and life may get in the way of doing this perfectly.
Expand Down Expand Up @@ -98,7 +98,7 @@ The following lines describe how to point mybinder.org to the new repo2docker im

1. Merge changes to repo2docker.
2. Open the [branches page for repo2docker](https://travis-ci.org/jupyter/repo2docker/branches).
And click on the number for the latest build on "Master".
And click on the number for the latest build on "main".
3. Wait for the build for your PR merge to pass (it will say "#NNN passed").
If it does, then continue to step 4. If it doesn't, take a look at the error message, and debug as needed
until they pass.
Expand Down Expand Up @@ -144,15 +144,15 @@ The following lines describe how to point mybinder.org to the new repo2docker im
### Deploying to _both_ `staging` then `prod`

Deploying a change involves making a PR with your desired change and merging it to
master.
main.

1. Make the changes as described above [on your fork of this repo](https://github.com/jupyterhub/mybinder.org-deploy).
2. Keep track of the **hashes** that were updated. You should have both the _old_ hash that
was replaced, and the _new_ hash that replaced it.
3. If you haven't already, run the `list_new_commits.py` script in the `scripts/`
folder. This will print out a URL that describes the changes made to both
BinderHub and repo2docker.
4. Make a PR to the `master` branch with the changes you want.
4. Make a PR to the `main` branch with the changes you want.

- Name the PR like so: `<TOOL-CHANGED>: <OLD-HASH>...<NEW-HASH>`
- In the description of the PR, paste the full URL that you printed out
Expand Down Expand Up @@ -197,10 +197,10 @@ In this scenario, a user with `OWNER`, `COLLABORATOR` or `MEMBER` association wi
The final option to deploy to staging only is by editing `staging`-only config files. To deploy
to staging only, follow these steps:

1. Make changes to [`config/staging.yaml`](https://github.com/jupyterhub/mybinder.org-deploy/blob/master/config/staging.yaml)
1. Make changes to [`config/staging.yaml`](https://github.com/jupyterhub/mybinder.org-deploy/blob/HEAD/config/staging.yaml)
on your fork. This file contains configuration for Helm that will **override**
whatever is in `mybinder/values.yaml`.
2. Make a PR to the `master` branch, and review, accept, and merge this PR.
2. Make a PR to the `main` branch, and review, accept, and merge this PR.
**In this case, you can merge your own PR**.
This will make GitHub Actions deploy the changes
to [staging.mybinder.org](https://staging.mybinder.org), and run tests in the `tests/`
Expand Down
2 changes: 1 addition & 1 deletion docs/source/deployment/what.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ We run the tests in `tests/` with `pytest` to validate that the deployment succe
These try to be as thorough as possible, simulating the tests a human would do to
ensure that the site works as required.

Look at the docstrings in the files under [`tests/`](https://github.com/jupyterhub/mybinder.org-deploy/tree/master/tests)
Look at the docstrings in the files under [`tests/`](https://github.com/jupyterhub/mybinder.org-deploy/tree/HEAD/tests)
to see what are the tests being run.

If all the tests succeed, we can consider the staging deployment success!
Expand Down
2 changes: 1 addition & 1 deletion docs/source/operation_guide/federation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ There are 3 main files you may wish to edit in order to remove a cluster from
the Federation:

#. *Required.* Set the ``binderhub.config.BinderHub.pod_quota`` key to ``0`` in the
cluster's config file under the `config <https://github.com/jupyterhub/mybinder.org-deploy/tree/master/config>`_
cluster's config file under the `config <https://github.com/jupyterhub/mybinder.org-deploy/tree/HEAD/config>`_
directory
#. *Recommended.* Set the ``weight`` key for the cluster to ``0`` in the
`helm chart values file <https://github.com/jupyterhub/mybinder.org-deploy/blob/4f42d791f92dcb3156e7c4ea92a236246bbf9135/mybinder/values.yaml#L494>`_
Expand Down
2 changes: 1 addition & 1 deletion images/analytics-publisher/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1 class='display-3'>MyBinder.org Events Archive</h1>
<div id='footer' class='border-top row'>
<div class='col-sm font-weight-light text-right pb-2 pt-2'>
Generated by love with
<a href='https://github.com/jupyterhub/mybinder.org-deploy/tree/master/images/analytics-publisher'>
<a href='https://github.com/jupyterhub/mybinder.org-deploy/tree/HEAD/images/analytics-publisher'>
these scripts
</a> at {{ generated_time }}
</p>
Expand Down
12 changes: 6 additions & 6 deletions scripts/list_new_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

print("Fetching the SHA for live BinderHub and repo2docker...")

# Load master requirements
url_requirements = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/master/mybinder/Chart.yaml"
# Load latest requirements
url_requirements = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/HEAD/mybinder/Chart.yaml"
requirements = load(requests.get(url_requirements).text)
binderhub_dep = [
ii for ii in requirements["dependencies"] if ii["name"] == "binderhub"
Expand All @@ -18,8 +18,8 @@
][0]
jhub_live = jupyterhub_dep["version"].split("-")[-1]

# Load master repo2docker
url_helm_chart = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/master/mybinder/values.yaml"
# Load latest repo2docker
url_helm_chart = "https://raw.githubusercontent.com/jupyterhub/mybinder.org-deploy/HEAD/mybinder/values.yaml"
helm_chart = requests.get(url_helm_chart)
helm_chart = load(helm_chart.text)
r2d_live = helm_chart["binderhub"]["config"]["BinderHub"]["build_image"].split(":")[-1]
Expand All @@ -29,7 +29,7 @@
# Load latest r2d commit from dockerhub
url = "https://hub.docker.com/v2/repositories/jupyter/repo2docker/tags/"
resp = requests.get(url)
r2d_master = resp.json()["results"][0]["name"]
r2d_head = resp.json()["results"][0]["name"]

# Load latest binderhub and jupyterhub commits
url_helm_chart = (
Expand All @@ -48,7 +48,7 @@
bhub_live, latest_hash["binderhub"]
)
url_r2d = (
f"https://github.com/jupyterhub/repo2docker/compare/{r2d_live}...{r2d_master[:8]}"
f"https://github.com/jupyterhub/repo2docker/compare/{r2d_live}...{r2d_head[:8]}"
)
url_jhub = (
"https://github.com/jupyterhub/zero-to-jupyterhub-k8s/compare/{}...{}".format(
Expand Down
Loading

0 comments on commit 5c611ad

Please sign in to comment.