{"id":15008223,"url":"https://github.com/python/bpo-builder","last_synced_at":"2025-10-03T16:31:19.842Z","repository":{"id":65980308,"uuid":"114343554","full_name":"python/bpo-builder","owner":"python","description":"bugs.python.org builder image \u0026 other deployment artifacts","archived":true,"fork":false,"pushed_at":"2018-05-18T23:29:39.000Z","size":35,"stargazers_count":7,"open_issues_count":5,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T16:01:47.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://www.python.org/psf/donations/python-dev/","github":["python"]}},"created_at":"2017-12-15T08:00:38.000Z","updated_at":"2023-01-27T20:54:24.000Z","dependencies_parsed_at":"2023-02-19T18:45:24.681Z","dependency_job_id":null,"html_url":"https://github.com/python/bpo-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fbpo-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fbpo-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fbpo-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fbpo-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python","download_url":"https://codeload.github.com/python/bpo-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235155944,"owners_count":18944816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:15:38.737Z","updated_at":"2025-10-03T16:31:14.558Z","avatar_url":"https://github.com/python.png","language":"Python","funding_links":["https://www.python.org/psf/donations/python-dev/","https://github.com/sponsors/python"],"categories":[],"sub_categories":[],"readme":"About\n------\nThis repository contains the code allowing to deploy http://bugs.python.org\non [OpenShift](https://www.openshift.org/).\n\n\nUsage\n-----\n1. Download latest [OpenShift client](https://github.com/openshift/origin/releases)\n  and run `oc cluster up` to setup a local cluster.  If you encounter any problems\n  follow the diagnostic messages that appear on the screen, it is probably missing\n  packages (eg. docker) or necessary configuration changes.\n\n2. Instantiate a postgresql instance.  Depending on your needs there are two possibilies\n  here. You can either proceed with a single development instance (A) or a full HA\n  production one (B).\n\n    A. To deploy single development instance you can either use the web console or\n    the following command.  With the former make sure to use the exact same values\n    as below command.\n\n    ```\n    oc new-app postgresql:9.5 \\\n        --name=bpo-db \\\n        --labels=app=bugs.python.org \\\n        --env=POSTGRESQL_USER=roundup \\\n        --env=POSTGRESQL_PASSWORD=roundup \\\n        --env=POSTGRESQL_DATABASE=roundup\n    ```\n\n    This will create the following resources:\n    - [Deployment Configuration](https://docs.openshift.org/latest/dev_guide/deployments/how_deployments_work.html)\n    - [Service](https://docs.openshift.org/latest/architecture/core_concepts/pods_and_services.html#services)\n\n    This deployment configuration will kick of an actual deployment of our postgresql\n    instance which leads to creating a [Replication Controller](https://docs.openshift.org/latest/architecture/core_concepts/deployments.html#replication-controllers)\n    and a [Pod](https://docs.openshift.org/latest/architecture/core_concepts/pods_and_services.html#pods).\n\n    **NOTE:** This setup uses an ephemeral storage, if you want to save your data you\n    should read about [Persistence Volumes](https://docs.openshift.org/latest/dev_guide/persistent_volumes.html).\n\n    When the postgresql instance is up we need to drop the database and allow roundup\n    initialize it from scratch.  To do so invoke the following commands, which will\n    get you connected to bpo-db pod and drop the database and add necessary access\n    rights to create a new one, instead:\n\n    ```\n    oc rsh $(oc get pod -l deploymentconfig=bpo-db -o jsonpath='{.items[*].metadata.name}')\n    # psql\n    # drop database roundup;\n    # alter user roundup createdb;\n    ```\n\n    B. To deploy full HA PostgreSQL using [patroni project](https://github.com/zalando/patroni/)\n    invoke the following command:\n\n    ```\n    oc create -f \\\n      https://raw.githubusercontent.com/python/bpo-builder/master/template_patroni.yaml\n    ```\n\n    This will create the following resources:\n    - [Stateful Set](https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/)\n    - [Services](https://docs.openshift.org/latest/architecture/core_concepts/pods_and_services.html#services)\n    - [Service Account](https://docs.openshift.org/latest/dev_guide/service_accounts.html)\n    - [Role and RoleBinding](https://kubernetes.io/docs/admin/authorization/rbac/)\n\n    **NOTE:** You should copy the above template file and change `superuser-password`\n    and `replication-password`.  These are `base64` encoded passwords.\n\n    When the postgresql instance is up we need to create user roundup with appropriate\n    password and add it rights to create a database.\n\n    ```\n    oc rsh patroni-0\n    # psql -U postgres\n    # create user roundup with createdb encrypted password 'changeme';\n    ```\n\n3. Now it is time to prepare all the bits necessary to deploy bugs.python.org itself:\n\n  ```\n  oc create -f \\\n    https://raw.githubusercontent.com/python/bpo-builder/master/template_bpo.yaml\n  ```\n\n  This will create the following resources:\n  - [Build Configuration](https://docs.openshift.org/latest/dev_guide/builds/index.html)\n  - [Image Stream](https://docs.openshift.org/latest/dev_guide/managing_images.html)\n  - [Deployment Configuration](https://docs.openshift.org/latest/dev_guide/deployments/how_deployments_work.html)\n  - [Service](https://docs.openshift.org/latest/architecture/core_concepts/pods_and_services.html#services)\n  - [Route](https://docs.openshift.org/latest/dev_guide/routes.html)\n\n  **NOTE:** This needs to be performed only when you're using a temporary database.\n\n  Since we need to initiate the database only once, we need to set an environment\n  variable (`INIT_DATABASE`), to tell the `run` script to do it:\n\n  ```\n  oc set env deploymentconfig/bpo INIT_DATABASE=true\n  ```\n\n  After the initial rollout this value should be cleared out:\n\n  ```\n  oc set env deploymentconfig/bpo INIT_DATABASE-\n  ```\n\n4. Edit `config/roundup.ini` and change the line:\n\n  ```\n  web = http://localhost:9999/python-dev/\n  ```\n\n  So that it matches the route the app will be exposed under.  You can easily check\n  that with `oc get route/bpo`.  Afterwards you can create the necessary configuration:\n\n  ```\n  oc create secret generic config \\\n      --from-file=roundup=config/roundup.ini \\\n      --from-file=detectors=config/detectors.ini\n  ```\n\n5. With all the pieces in place we can finally start the application.  To do so\n  we need to build the actual image that will serve bugs.python.org:\n\n  ```\n  oc start-build bpo\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fbpo-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython%2Fbpo-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fbpo-builder/lists"}