{"owner":"quantumlib","repo":"Cirq","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":2155,"categories":["plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":["dev_tools/ci/README.md","dev_tools/cirq-infra/README.md","dev_tools/triage-party/README.md"],"skills":{"dev_tools/ci/README.md":"# Continuous integration scripts\n\nThe scripts in this directory are used by the workflows in\n[`../../.github/workflows/`](../../.github/workflows/).\n","dev_tools/cirq-infra/README.md":"# Cirq infra\n\n_Cirq-infra_ is the name of a the Google Cloud Platform (GCP) project implemented and managed by the\nGoogle Quantum AI team in support of open-source projects like Cirq. It was originally introduced\naround the years 2020–2021 to implement several systems:\n\n*   Automatic merging of pull requests on GitHub\n*   Automatic labeling of the sizes of changes in pull requests\n*   Running [Triage Party](https://github.com/google/triage-party), a tool for collaborative\n    triaging of GitHub issues and pull requests\n\nThe automerge and automatic labeling capabilities were implemented using a homegrown tool called\n`pr_monitor`, whose source code was in the [`dev_tools`](../) subdirectory of the Cirq\nrepository. In 2025, the automerge system was discontinued in favor of using GitHub's \"merge\nqueues\", and the size-labeling facility was reimplemented using a GitHub Actions workflow.\n`pr_monitor` was retired in the Cirq 1.5 release.\n\n_Cirq-infra_ is still being used to support Triage Party.\n\n## GCP Configuration\n\nAccess is granted to Cirq maintainers only.\n\n### Requirements\n\nThe tools below are required to manage our infra:\n\n*   Cloud SDK: https://cloud.google.com/sdk/docs/quickstart\n*   kubectl: `gcloud components install kubectl`.\n*   skaffold: `gcloud components install skaffold`.\n\n### GKE Cluster\n\nWe have a 3 node GKE cluster called cirq-infra. To connect to it using kubectl\nuse:\n\n```shell\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a --project cirq-infra\n```\n\nNote that we have Workload Identity setup so that in order to access Cloud APIs\nfrom workloads, you'll have to add permissions to the\ngke-service-account@cirq-infra.iam.gserviceaccount.com service account.\nCurrently, it is able to access Secrets, and no other APIs.\n\n### Secret manager\n\nIt is important to know that the Github API key in case of the Kubernetes\ndeployment is stored in the Cloud Secret Manager under `cirq-bot-api-key`.\n","dev_tools/triage-party/README.md":"# Cirq Triage Party\n\n[Triage Party](https://github.com/google/triage-party) is an issue and pull request triaging tool\nfor GitHub. For more information about the triaging process used in the Cirq project, please refer\nto the [triage process documentation for Cirq](../../docs/dev/triage.md).\n\n## Local testing\n\nIt is possible to run an instance of Triage Party on your local host. This is useful for testing\nconfiguration changes.\n\n1.  Generate a personal access token on GitHub with read-only permissions for `public_repo`. (Please\n    refer to the GitHub documentation for [personal access tokens] for information on how to do\n    that.) The token will be a string of characters that begins with the letters `gho_`.\n\n2.  Store this token string in the environment variable `GITHUB_TOKEN`:\n\n    ```shell\n    export GITHUB_TOKEN=\"yourtokenhere\"\n    ```\n\n3.  Run Triage Party locally in a container using either Podman or Docker. The script\n    `./run-local.sh` makes this convenient; it pulls an image for Triage Party from a container\n    registry and runs it with the appropriate Cirq configuration files. (Note: this produces\n    _a lot_ of output.)\n\n    ```shell\n    ./run-local.sh\n    ```\n\nAfter some time and many lines of logs printed, if all went well, the output should end with a line\nthat looks more or less something like this:\n\n```text\nI0601 21:40:01.954553       1 updater.go:250] update cycle #1 took 7.005642265s\n```\n\nThe exact numbers printed in the output are not important; what matters is that it did not end with\nan error message and did not return to the shell, but rather paused with `update cycle #1` as the\nfinal message. The Triage Party server will then be listening for web browser connections on port\n8080 on your local host. It will produce more output as it detects that files have changed.\n\n[personal access tokens]: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line\n\n## Cloud configuration & Setup\n\nThe deployment of Cirq's Triage Party instance on a Google Cloud server is managed using Kubernetes,\nan open-source platform that automates the deployment, scaling, and management of containerized\napplications. Specifically, we use the tools Kustomize and Skaffold.\n\n### 1. Application Configuration\n\nTo customize the Triage Party dashboard (e.g., modifying collections, rules, and members), edit the\nstandalone YAML configuration file located at [kubernetes/02_deployment/config.yaml][config].\nThis file is read by the program `kustomize` to generate the `triage-party-config` ConfigMap for\nKubernetes.\n\nPlease refer to the official [Triage Party documentation] for details on the available configuration\noptions.\n\n[Triage Party documentation]: https://github.com/google/triage-party/blob/main/docs/config.md\n\n### 2. Static Resources & Theming (CSS & Favicon)\n\nExtra resources like custom styling and the site's favicon are also managed automatically via\nKustomize:\n\n-   **Custom CSS**: Overrides to the default Triage Party look and feel are defined in\n    [kubernetes/02_deployment/custom.css][custom_css] as a ConfigMap.\n\n-   **Favicon**: The favicon is bundled directly from the image file\n    [kubernetes/02_deployment/cirq-icon-very-small.png][cirq_icon]. Kustomize reads this binary\n    file and creates the `triage-party-favicon` ConfigMap automatically as defined in\n    [kubernetes/kustomization.yaml][kustomization].\n\nThere is no need to manually run `kubectl create configmap` commands for these resources.\n\n[cirq_icon]: kubernetes/02_deployment/cirq-icon-very-small.png\n[config]: kubernetes/02_deployment/config.yaml\n[custom_css]: kubernetes/02_deployment/custom.css\n[kustomization]: kubernetes/kustomization.yaml\n\n### 3. GitHub Token Secret (One-time Setup)\n\nTriage Party requires a GitHub personal access token so that it can query the GitHub API to get data\nabout issues and pull requests. The token creation and assignment is a one-time setup. You must\ncreate a Kubernetes Secret containing a GitHub token. Follow these steps:\n\n1.  Obtain a new token from GitHub.\n\n2.  Set the environment variable `GITHUB_TOKEN` to the token to be used.\n\n3.  Run the following command in a terminal on your local host:\n\n    ```shell\n    # Authenticate to Google Cloud.\n    gcloud auth login\n\n    # Provision your underlying Application Default Credentials (ADC).\n    gcloud auth application-default login\n\n    # Authenticate your local terminal with the Kubernetes cluster running\n    # on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\n    gcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n    # Finally, create the secret inside the cluster.\n    kubectl create secret generic triage-party-github-token \\\n        -n triage-party --from-literal=token=\"${GITHUB_TOKEN}\"\n    ```\n\n## Deployment\n\nGoogle Cloud Build is Google Cloud Platform's (GCP) serverless CI/CD service. When code is pushed,\nCloud Build automatically imports the changes, executes the build files, compiles the necessary\ncontainers, and safely applies them to the production environment without manual intervention.\nPlease refer to the [cirq-infra documentation](../cirq-infra/README.md) to find out more about the\nsoftware tools needed and how to install them.\n\n### Google Cloud Build deployment\n\nOn every push to the `main` branch that involves files in `dev_tools/triage-party/`, the Cirq Triage\nParty instance is automatically redeployed using the steps defined in the file\n[cloudbuild-deploy.yaml](./cloudbuild-deploy.yaml). This is achieved thanks to a Cloud Build Trigger\ndefined in the `cirq-infra` project in GCP. Thus, when changes to the Triage Party configuration are\nmerged into the `main` branch on GitHub, the server instance will be updated automatically.\n\n### Manual Deployment\n\nIt is possible to update the Triage Party deployment manually (e.g., for applying an immediate fix).\nThis can be done using the command-line tool `skaffold`. Execute these commands from the top level\nof the Cirq repository:\n\n```shell\n# Authenticate to Google Cloud.\ngcloud auth login\n\n# Provision your underlying Application Default Credentials (ADC).\ngcloud auth application-default login\n\n# Authenticate your local terminal with the remote Kubernetes cluster running\n# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n# Bundle the config, generate ConfigMaps, and deploy.\nskaffold run --force -f=dev_tools/triage-party/skaffold.yaml\n```\n"},"files":{"dev_tools/ci/README.md":"# Continuous integration scripts\n\nThe scripts in this directory are used by the workflows in\n[`../../.github/workflows/`](../../.github/workflows/).\n","dev_tools/cirq-infra/README.md":"# Cirq infra\n\n_Cirq-infra_ is the name of a the Google Cloud Platform (GCP) project implemented and managed by the\nGoogle Quantum AI team in support of open-source projects like Cirq. It was originally introduced\naround the years 2020–2021 to implement several systems:\n\n*   Automatic merging of pull requests on GitHub\n*   Automatic labeling of the sizes of changes in pull requests\n*   Running [Triage Party](https://github.com/google/triage-party), a tool for collaborative\n    triaging of GitHub issues and pull requests\n\nThe automerge and automatic labeling capabilities were implemented using a homegrown tool called\n`pr_monitor`, whose source code was in the [`dev_tools`](../) subdirectory of the Cirq\nrepository. In 2025, the automerge system was discontinued in favor of using GitHub's \"merge\nqueues\", and the size-labeling facility was reimplemented using a GitHub Actions workflow.\n`pr_monitor` was retired in the Cirq 1.5 release.\n\n_Cirq-infra_ is still being used to support Triage Party.\n\n## GCP Configuration\n\nAccess is granted to Cirq maintainers only.\n\n### Requirements\n\nThe tools below are required to manage our infra:\n\n*   Cloud SDK: https://cloud.google.com/sdk/docs/quickstart\n*   kubectl: `gcloud components install kubectl`.\n*   skaffold: `gcloud components install skaffold`.\n\n### GKE Cluster\n\nWe have a 3 node GKE cluster called cirq-infra. To connect to it using kubectl\nuse:\n\n```shell\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a --project cirq-infra\n```\n\nNote that we have Workload Identity setup so that in order to access Cloud APIs\nfrom workloads, you'll have to add permissions to the\ngke-service-account@cirq-infra.iam.gserviceaccount.com service account.\nCurrently, it is able to access Secrets, and no other APIs.\n\n### Secret manager\n\nIt is important to know that the Github API key in case of the Kubernetes\ndeployment is stored in the Cloud Secret Manager under `cirq-bot-api-key`.\n","dev_tools/triage-party/README.md":"# Cirq Triage Party\n\n[Triage Party](https://github.com/google/triage-party) is an issue and pull request triaging tool\nfor GitHub. For more information about the triaging process used in the Cirq project, please refer\nto the [triage process documentation for Cirq](../../docs/dev/triage.md).\n\n## Local testing\n\nIt is possible to run an instance of Triage Party on your local host. This is useful for testing\nconfiguration changes.\n\n1.  Generate a personal access token on GitHub with read-only permissions for `public_repo`. (Please\n    refer to the GitHub documentation for [personal access tokens] for information on how to do\n    that.) The token will be a string of characters that begins with the letters `gho_`.\n\n2.  Store this token string in the environment variable `GITHUB_TOKEN`:\n\n    ```shell\n    export GITHUB_TOKEN=\"yourtokenhere\"\n    ```\n\n3.  Run Triage Party locally in a container using either Podman or Docker. The script\n    `./run-local.sh` makes this convenient; it pulls an image for Triage Party from a container\n    registry and runs it with the appropriate Cirq configuration files. (Note: this produces\n    _a lot_ of output.)\n\n    ```shell\n    ./run-local.sh\n    ```\n\nAfter some time and many lines of logs printed, if all went well, the output should end with a line\nthat looks more or less something like this:\n\n```text\nI0601 21:40:01.954553       1 updater.go:250] update cycle #1 took 7.005642265s\n```\n\nThe exact numbers printed in the output are not important; what matters is that it did not end with\nan error message and did not return to the shell, but rather paused with `update cycle #1` as the\nfinal message. The Triage Party server will then be listening for web browser connections on port\n8080 on your local host. It will produce more output as it detects that files have changed.\n\n[personal access tokens]: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line\n\n## Cloud configuration & Setup\n\nThe deployment of Cirq's Triage Party instance on a Google Cloud server is managed using Kubernetes,\nan open-source platform that automates the deployment, scaling, and management of containerized\napplications. Specifically, we use the tools Kustomize and Skaffold.\n\n### 1. Application Configuration\n\nTo customize the Triage Party dashboard (e.g., modifying collections, rules, and members), edit the\nstandalone YAML configuration file located at [kubernetes/02_deployment/config.yaml][config].\nThis file is read by the program `kustomize` to generate the `triage-party-config` ConfigMap for\nKubernetes.\n\nPlease refer to the official [Triage Party documentation] for details on the available configuration\noptions.\n\n[Triage Party documentation]: https://github.com/google/triage-party/blob/main/docs/config.md\n\n### 2. Static Resources & Theming (CSS & Favicon)\n\nExtra resources like custom styling and the site's favicon are also managed automatically via\nKustomize:\n\n-   **Custom CSS**: Overrides to the default Triage Party look and feel are defined in\n    [kubernetes/02_deployment/custom.css][custom_css] as a ConfigMap.\n\n-   **Favicon**: The favicon is bundled directly from the image file\n    [kubernetes/02_deployment/cirq-icon-very-small.png][cirq_icon]. Kustomize reads this binary\n    file and creates the `triage-party-favicon` ConfigMap automatically as defined in\n    [kubernetes/kustomization.yaml][kustomization].\n\nThere is no need to manually run `kubectl create configmap` commands for these resources.\n\n[cirq_icon]: kubernetes/02_deployment/cirq-icon-very-small.png\n[config]: kubernetes/02_deployment/config.yaml\n[custom_css]: kubernetes/02_deployment/custom.css\n[kustomization]: kubernetes/kustomization.yaml\n\n### 3. GitHub Token Secret (One-time Setup)\n\nTriage Party requires a GitHub personal access token so that it can query the GitHub API to get data\nabout issues and pull requests. The token creation and assignment is a one-time setup. You must\ncreate a Kubernetes Secret containing a GitHub token. Follow these steps:\n\n1.  Obtain a new token from GitHub.\n\n2.  Set the environment variable `GITHUB_TOKEN` to the token to be used.\n\n3.  Run the following command in a terminal on your local host:\n\n    ```shell\n    # Authenticate to Google Cloud.\n    gcloud auth login\n\n    # Provision your underlying Application Default Credentials (ADC).\n    gcloud auth application-default login\n\n    # Authenticate your local terminal with the Kubernetes cluster running\n    # on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\n    gcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n    # Finally, create the secret inside the cluster.\n    kubectl create secret generic triage-party-github-token \\\n        -n triage-party --from-literal=token=\"${GITHUB_TOKEN}\"\n    ```\n\n## Deployment\n\nGoogle Cloud Build is Google Cloud Platform's (GCP) serverless CI/CD service. When code is pushed,\nCloud Build automatically imports the changes, executes the build files, compiles the necessary\ncontainers, and safely applies them to the production environment without manual intervention.\nPlease refer to the [cirq-infra documentation](../cirq-infra/README.md) to find out more about the\nsoftware tools needed and how to install them.\n\n### Google Cloud Build deployment\n\nOn every push to the `main` branch that involves files in `dev_tools/triage-party/`, the Cirq Triage\nParty instance is automatically redeployed using the steps defined in the file\n[cloudbuild-deploy.yaml](./cloudbuild-deploy.yaml). This is achieved thanks to a Cloud Build Trigger\ndefined in the `cirq-infra` project in GCP. Thus, when changes to the Triage Party configuration are\nmerged into the `main` branch on GitHub, the server instance will be updated automatically.\n\n### Manual Deployment\n\nIt is possible to update the Triage Party deployment manually (e.g., for applying an immediate fix).\nThis can be done using the command-line tool `skaffold`. Execute these commands from the top level\nof the Cirq repository:\n\n```shell\n# Authenticate to Google Cloud.\ngcloud auth login\n\n# Provision your underlying Application Default Credentials (ADC).\ngcloud auth application-default login\n\n# Authenticate your local terminal with the remote Kubernetes cluster running\n# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n# Bundle the config, generate ConfigMaps, and deploy.\nskaffold run --force -f=dev_tools/triage-party/skaffold.yaml\n```\n"},"items":[{"name":"README.md","path":"dev_tools/ci/README.md","rawUrl":"https://raw.githubusercontent.com/quantumlib/Cirq/HEAD/dev_tools/ci/README.md","title":"ci Documentation","category":"plugin-manifest","format":"markdown","content":"# Continuous integration scripts\n\nThe scripts in this directory are used by the workflows in\n[`../../.github/workflows/`](../../.github/workflows/).\n","isInternal":false,"tokens":38,"sizeBytes":149},{"name":"README.md","path":"dev_tools/cirq-infra/README.md","rawUrl":"https://raw.githubusercontent.com/quantumlib/Cirq/HEAD/dev_tools/cirq-infra/README.md","title":"cirq-infra Documentation","category":"plugin-manifest","format":"markdown","content":"# Cirq infra\n\n_Cirq-infra_ is the name of a the Google Cloud Platform (GCP) project implemented and managed by the\nGoogle Quantum AI team in support of open-source projects like Cirq. It was originally introduced\naround the years 2020–2021 to implement several systems:\n\n*   Automatic merging of pull requests on GitHub\n*   Automatic labeling of the sizes of changes in pull requests\n*   Running [Triage Party](https://github.com/google/triage-party), a tool for collaborative\n    triaging of GitHub issues and pull requests\n\nThe automerge and automatic labeling capabilities were implemented using a homegrown tool called\n`pr_monitor`, whose source code was in the [`dev_tools`](../) subdirectory of the Cirq\nrepository. In 2025, the automerge system was discontinued in favor of using GitHub's \"merge\nqueues\", and the size-labeling facility was reimplemented using a GitHub Actions workflow.\n`pr_monitor` was retired in the Cirq 1.5 release.\n\n_Cirq-infra_ is still being used to support Triage Party.\n\n## GCP Configuration\n\nAccess is granted to Cirq maintainers only.\n\n### Requirements\n\nThe tools below are required to manage our infra:\n\n*   Cloud SDK: https://cloud.google.com/sdk/docs/quickstart\n*   kubectl: `gcloud components install kubectl`.\n*   skaffold: `gcloud components install skaffold`.\n\n### GKE Cluster\n\nWe have a 3 node GKE cluster called cirq-infra. To connect to it using kubectl\nuse:\n\n```shell\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a --project cirq-infra\n```\n\nNote that we have Workload Identity setup so that in order to access Cloud APIs\nfrom workloads, you'll have to add permissions to the\ngke-service-account@cirq-infra.iam.gserviceaccount.com service account.\nCurrently, it is able to access Secrets, and no other APIs.\n\n### Secret manager\n\nIt is important to know that the Github API key in case of the Kubernetes\ndeployment is stored in the Cloud Secret Manager under `cirq-bot-api-key`.\n","isInternal":false,"tokens":488,"sizeBytes":1952},{"name":"README.md","path":"dev_tools/triage-party/README.md","rawUrl":"https://raw.githubusercontent.com/quantumlib/Cirq/HEAD/dev_tools/triage-party/README.md","title":"triage-party Documentation","category":"plugin-manifest","format":"markdown","content":"# Cirq Triage Party\n\n[Triage Party](https://github.com/google/triage-party) is an issue and pull request triaging tool\nfor GitHub. For more information about the triaging process used in the Cirq project, please refer\nto the [triage process documentation for Cirq](../../docs/dev/triage.md).\n\n## Local testing\n\nIt is possible to run an instance of Triage Party on your local host. This is useful for testing\nconfiguration changes.\n\n1.  Generate a personal access token on GitHub with read-only permissions for `public_repo`. (Please\n    refer to the GitHub documentation for [personal access tokens] for information on how to do\n    that.) The token will be a string of characters that begins with the letters `gho_`.\n\n2.  Store this token string in the environment variable `GITHUB_TOKEN`:\n\n    ```shell\n    export GITHUB_TOKEN=\"yourtokenhere\"\n    ```\n\n3.  Run Triage Party locally in a container using either Podman or Docker. The script\n    `./run-local.sh` makes this convenient; it pulls an image for Triage Party from a container\n    registry and runs it with the appropriate Cirq configuration files. (Note: this produces\n    _a lot_ of output.)\n\n    ```shell\n    ./run-local.sh\n    ```\n\nAfter some time and many lines of logs printed, if all went well, the output should end with a line\nthat looks more or less something like this:\n\n```text\nI0601 21:40:01.954553       1 updater.go:250] update cycle #1 took 7.005642265s\n```\n\nThe exact numbers printed in the output are not important; what matters is that it did not end with\nan error message and did not return to the shell, but rather paused with `update cycle #1` as the\nfinal message. The Triage Party server will then be listening for web browser connections on port\n8080 on your local host. It will produce more output as it detects that files have changed.\n\n[personal access tokens]: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line\n\n## Cloud configuration & Setup\n\nThe deployment of Cirq's Triage Party instance on a Google Cloud server is managed using Kubernetes,\nan open-source platform that automates the deployment, scaling, and management of containerized\napplications. Specifically, we use the tools Kustomize and Skaffold.\n\n### 1. Application Configuration\n\nTo customize the Triage Party dashboard (e.g., modifying collections, rules, and members), edit the\nstandalone YAML configuration file located at [kubernetes/02_deployment/config.yaml][config].\nThis file is read by the program `kustomize` to generate the `triage-party-config` ConfigMap for\nKubernetes.\n\nPlease refer to the official [Triage Party documentation] for details on the available configuration\noptions.\n\n[Triage Party documentation]: https://github.com/google/triage-party/blob/main/docs/config.md\n\n### 2. Static Resources & Theming (CSS & Favicon)\n\nExtra resources like custom styling and the site's favicon are also managed automatically via\nKustomize:\n\n-   **Custom CSS**: Overrides to the default Triage Party look and feel are defined in\n    [kubernetes/02_deployment/custom.css][custom_css] as a ConfigMap.\n\n-   **Favicon**: The favicon is bundled directly from the image file\n    [kubernetes/02_deployment/cirq-icon-very-small.png][cirq_icon]. Kustomize reads this binary\n    file and creates the `triage-party-favicon` ConfigMap automatically as defined in\n    [kubernetes/kustomization.yaml][kustomization].\n\nThere is no need to manually run `kubectl create configmap` commands for these resources.\n\n[cirq_icon]: kubernetes/02_deployment/cirq-icon-very-small.png\n[config]: kubernetes/02_deployment/config.yaml\n[custom_css]: kubernetes/02_deployment/custom.css\n[kustomization]: kubernetes/kustomization.yaml\n\n### 3. GitHub Token Secret (One-time Setup)\n\nTriage Party requires a GitHub personal access token so that it can query the GitHub API to get data\nabout issues and pull requests. The token creation and assignment is a one-time setup. You must\ncreate a Kubernetes Secret containing a GitHub token. Follow these steps:\n\n1.  Obtain a new token from GitHub.\n\n2.  Set the environment variable `GITHUB_TOKEN` to the token to be used.\n\n3.  Run the following command in a terminal on your local host:\n\n    ```shell\n    # Authenticate to Google Cloud.\n    gcloud auth login\n\n    # Provision your underlying Application Default Credentials (ADC).\n    gcloud auth application-default login\n\n    # Authenticate your local terminal with the Kubernetes cluster running\n    # on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\n    gcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n    # Finally, create the secret inside the cluster.\n    kubectl create secret generic triage-party-github-token \\\n        -n triage-party --from-literal=token=\"${GITHUB_TOKEN}\"\n    ```\n\n## Deployment\n\nGoogle Cloud Build is Google Cloud Platform's (GCP) serverless CI/CD service. When code is pushed,\nCloud Build automatically imports the changes, executes the build files, compiles the necessary\ncontainers, and safely applies them to the production environment without manual intervention.\nPlease refer to the [cirq-infra documentation](../cirq-infra/README.md) to find out more about the\nsoftware tools needed and how to install them.\n\n### Google Cloud Build deployment\n\nOn every push to the `main` branch that involves files in `dev_tools/triage-party/`, the Cirq Triage\nParty instance is automatically redeployed using the steps defined in the file\n[cloudbuild-deploy.yaml](./cloudbuild-deploy.yaml). This is achieved thanks to a Cloud Build Trigger\ndefined in the `cirq-infra` project in GCP. Thus, when changes to the Triage Party configuration are\nmerged into the `main` branch on GitHub, the server instance will be updated automatically.\n\n### Manual Deployment\n\nIt is possible to update the Triage Party deployment manually (e.g., for applying an immediate fix).\nThis can be done using the command-line tool `skaffold`. Execute these commands from the top level\nof the Cirq repository:\n\n```shell\n# Authenticate to Google Cloud.\ngcloud auth login\n\n# Provision your underlying Application Default Credentials (ADC).\ngcloud auth application-default login\n\n# Authenticate your local terminal with the remote Kubernetes cluster running\n# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n# Bundle the config, generate ConfigMaps, and deploy.\nskaffold run --force -f=dev_tools/triage-party/skaffold.yaml\n```\n","isInternal":false,"tokens":1629,"sizeBytes":6515}],"systemPromptSnippet":"<agent_rules repository=\"quantumlib/Cirq\">\n\n<!-- Skill/Rule: ci Documentation (dev_tools/ci/README.md) -->\n# Continuous integration scripts\n\nThe scripts in this directory are used by the workflows in\n[`../../.github/workflows/`](../../.github/workflows/).\n\n\n<!-- Skill/Rule: cirq-infra Documentation (dev_tools/cirq-infra/README.md) -->\n# Cirq infra\n\n_Cirq-infra_ is the name of a the Google Cloud Platform (GCP) project implemented and managed by the\nGoogle Quantum AI team in support of open-source projects like Cirq. It was originally introduced\naround the years 2020–2021 to implement several systems:\n\n*   Automatic merging of pull requests on GitHub\n*   Automatic labeling of the sizes of changes in pull requests\n*   Running [Triage Party](https://github.com/google/triage-party), a tool for collaborative\n    triaging of GitHub issues and pull requests\n\nThe automerge and automatic labeling capabilities were implemented using a homegrown tool called\n`pr_monitor`, whose source code was in the [`dev_tools`](../) subdirectory of the Cirq\nrepository. In 2025, the automerge system was discontinued in favor of using GitHub's \"merge\nqueues\", and the size-labeling facility was reimplemented using a GitHub Actions workflow.\n`pr_monitor` was retired in the Cirq 1.5 release.\n\n_Cirq-infra_ is still being used to support Triage Party.\n\n## GCP Configuration\n\nAccess is granted to Cirq maintainers only.\n\n### Requirements\n\nThe tools below are required to manage our infra:\n\n*   Cloud SDK: https://cloud.google.com/sdk/docs/quickstart\n*   kubectl: `gcloud components install kubectl`.\n*   skaffold: `gcloud components install skaffold`.\n\n### GKE Cluster\n\nWe have a 3 node GKE cluster called cirq-infra. To connect to it using kubectl\nuse:\n\n```shell\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a --project cirq-infra\n```\n\nNote that we have Workload Identity setup so that in order to access Cloud APIs\nfrom workloads, you'll have to add permissions to the\ngke-service-account@cirq-infra.iam.gserviceaccount.com service account.\nCurrently, it is able to access Secrets, and no other APIs.\n\n### Secret manager\n\nIt is important to know that the Github API key in case of the Kubernetes\ndeployment is stored in the Cloud Secret Manager under `cirq-bot-api-key`.\n\n\n<!-- Skill/Rule: triage-party Documentation (dev_tools/triage-party/README.md) -->\n# Cirq Triage Party\n\n[Triage Party](https://github.com/google/triage-party) is an issue and pull request triaging tool\nfor GitHub. For more information about the triaging process used in the Cirq project, please refer\nto the [triage process documentation for Cirq](../../docs/dev/triage.md).\n\n## Local testing\n\nIt is possible to run an instance of Triage Party on your local host. This is useful for testing\nconfiguration changes.\n\n1.  Generate a personal access token on GitHub with read-only permissions for `public_repo`. (Please\n    refer to the GitHub documentation for [personal access tokens] for information on how to do\n    that.) The token will be a string of characters that begins with the letters `gho_`.\n\n2.  Store this token string in the environment variable `GITHUB_TOKEN`:\n\n    ```shell\n    export GITHUB_TOKEN=\"yourtokenhere\"\n    ```\n\n3.  Run Triage Party locally in a container using either Podman or Docker. The script\n    `./run-local.sh` makes this convenient; it pulls an image for Triage Party from a container\n    registry and runs it with the appropriate Cirq configuration files. (Note: this produces\n    _a lot_ of output.)\n\n    ```shell\n    ./run-local.sh\n    ```\n\nAfter some time and many lines of logs printed, if all went well, the output should end with a line\nthat looks more or less something like this:\n\n```text\nI0601 21:40:01.954553       1 updater.go:250] update cycle #1 took 7.005642265s\n```\n\nThe exact numbers printed in the output are not important; what matters is that it did not end with\nan error message and did not return to the shell, but rather paused with `update cycle #1` as the\nfinal message. The Triage Party server will then be listening for web browser connections on port\n8080 on your local host. It will produce more output as it detects that files have changed.\n\n[personal access tokens]: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line\n\n## Cloud configuration & Setup\n\nThe deployment of Cirq's Triage Party instance on a Google Cloud server is managed using Kubernetes,\nan open-source platform that automates the deployment, scaling, and management of containerized\napplications. Specifically, we use the tools Kustomize and Skaffold.\n\n### 1. Application Configuration\n\nTo customize the Triage Party dashboard (e.g., modifying collections, rules, and members), edit the\nstandalone YAML configuration file located at [kubernetes/02_deployment/config.yaml][config].\nThis file is read by the program `kustomize` to generate the `triage-party-config` ConfigMap for\nKubernetes.\n\nPlease refer to the official [Triage Party documentation] for details on the available configuration\noptions.\n\n[Triage Party documentation]: https://github.com/google/triage-party/blob/main/docs/config.md\n\n### 2. Static Resources & Theming (CSS & Favicon)\n\nExtra resources like custom styling and the site's favicon are also managed automatically via\nKustomize:\n\n-   **Custom CSS**: Overrides to the default Triage Party look and feel are defined in\n    [kubernetes/02_deployment/custom.css][custom_css] as a ConfigMap.\n\n-   **Favicon**: The favicon is bundled directly from the image file\n    [kubernetes/02_deployment/cirq-icon-very-small.png][cirq_icon]. Kustomize reads this binary\n    file and creates the `triage-party-favicon` ConfigMap automatically as defined in\n    [kubernetes/kustomization.yaml][kustomization].\n\nThere is no need to manually run `kubectl create configmap` commands for these resources.\n\n[cirq_icon]: kubernetes/02_deployment/cirq-icon-very-small.png\n[config]: kubernetes/02_deployment/config.yaml\n[custom_css]: kubernetes/02_deployment/custom.css\n[kustomization]: kubernetes/kustomization.yaml\n\n### 3. GitHub Token Secret (One-time Setup)\n\nTriage Party requires a GitHub personal access token so that it can query the GitHub API to get data\nabout issues and pull requests. The token creation and assignment is a one-time setup. You must\ncreate a Kubernetes Secret containing a GitHub token. Follow these steps:\n\n1.  Obtain a new token from GitHub.\n\n2.  Set the environment variable `GITHUB_TOKEN` to the token to be used.\n\n3.  Run the following command in a terminal on your local host:\n\n    ```shell\n    # Authenticate to Google Cloud.\n    gcloud auth login\n\n    # Provision your underlying Application Default Credentials (ADC).\n    gcloud auth application-default login\n\n    # Authenticate your local terminal with the Kubernetes cluster running\n    # on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\n    gcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n    # Finally, create the secret inside the cluster.\n    kubectl create secret generic triage-party-github-token \\\n        -n triage-party --from-literal=token=\"${GITHUB_TOKEN}\"\n    ```\n\n## Deployment\n\nGoogle Cloud Build is Google Cloud Platform's (GCP) serverless CI/CD service. When code is pushed,\nCloud Build automatically imports the changes, executes the build files, compiles the necessary\ncontainers, and safely applies them to the production environment without manual intervention.\nPlease refer to the [cirq-infra documentation](../cirq-infra/README.md) to find out more about the\nsoftware tools needed and how to install them.\n\n### Google Cloud Build deployment\n\nOn every push to the `main` branch that involves files in `dev_tools/triage-party/`, the Cirq Triage\nParty instance is automatically redeployed using the steps defined in the file\n[cloudbuild-deploy.yaml](./cloudbuild-deploy.yaml). This is achieved thanks to a Cloud Build Trigger\ndefined in the `cirq-infra` project in GCP. Thus, when changes to the Triage Party configuration are\nmerged into the `main` branch on GitHub, the server instance will be updated automatically.\n\n### Manual Deployment\n\nIt is possible to update the Triage Party deployment manually (e.g., for applying an immediate fix).\nThis can be done using the command-line tool `skaffold`. Execute these commands from the top level\nof the Cirq repository:\n\n```shell\n# Authenticate to Google Cloud.\ngcloud auth login\n\n# Provision your underlying Application Default Credentials (ADC).\ngcloud auth application-default login\n\n# Authenticate your local terminal with the remote Kubernetes cluster running\n# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.\ngcloud container clusters get-credentials cirq-infra --zone us-central1-a\n\n# Bundle the config, generate ConfigMaps, and deploy.\nskaffold run --force -f=dev_tools/triage-party/skaffold.yaml\n```\n\n\n</agent_rules>"}