From ed5b0a770c1e13c33fed7b0661372e2879fb2509 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Thu, 24 Feb 2022 13:34:37 -0500 Subject: [PATCH 1/4] feat(github): add CODEOWNERS file --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..a652454d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @themightychris From 9efb119d7bfec4aa9b64826012aaf02ed28ebfa8 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Thu, 24 Feb 2022 14:21:04 -0500 Subject: [PATCH 2/4] docs: add article on accessing prod --- docs/operations/accessing-prod.md | 78 +++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 docs/operations/accessing-prod.md diff --git a/docs/operations/accessing-prod.md b/docs/operations/accessing-prod.md new file mode 100644 index 00000000..d628ee7b --- /dev/null +++ b/docs/operations/accessing-prod.md @@ -0,0 +1,78 @@ +# Accessing Production + +The production instance of `codeforphilly.org` is deployed via the [`cfp-live-cluster`](https://github.com/CodeForPhilly/cfp-live-cluster) via the release configured at [`cfp-live-cluster/code-for-philly`](https://github.com/CodeForPhilly/cfp-live-cluster/tree/main/code-for-philly) + +## Deployment process + +1. Merge one or more PRs into `develop` under the [`codeforphilly.org`](https://github.com/CodeForPhilly/codeforphilly.org) repository + - A release PR will automatically be generated with a suggested version number in the title, a template for release notes in the description, and a copyable draft changelog in the first comment + - The first comment with the draft changelog will be automatically updated as additional commits/PRs are added to `develop` + - The title or description will not be automatically changed after the PR is initially created, so they are safe to manually edit +2. Copy bullet points from the generated changelog comment and use them to fill out the release notes template in the description, deleting any unused section. The suggested version number in the title will default to incrementing the patch number, and may be manually edited to switch to incrementing the minor number +3. Merge the release PR when ready + - A GitHub release+tag will automatically get created + - The new release/tag will kick off automatically building and tagging a new Docker container image +4. After the new image is built, edit [`code-for-philly/release-values.yaml`](https://github.com/CodeForPhilly/cfp-live-cluster/blob/main/code-for-philly/release-values.yaml) in the `cfp-live-cluster` repository to update the image tag to the new version either as a direct commit to the `main` branch or a PR (see [this example commit](https://github.com/CodeForPhilly/cfp-live-cluster/commit/67ce5a73b94ebd6e12a5aff34f2f7b02a9fd42f2)) +5. Ask the Code for Philly ops team to merge your version bump PR if needed + - A deployment PR will automatically be generated after that, previewing the pending changes to the cluster +6. Ask the Code for Philly ops team to merge the pending deployment + - The cluster will automatically be updated and the new image deployed + +## Accessing instance + +The production database runs within the Kubernetes cluster, and is snapshotted every hour by `restic` to a Linode cloud storage bucket. + +The database, as well as application logs and shell, can be accessed via a `KUBECONFIG` file with access to the needed resources. Ask Code for Philly ops to provide one if needed. + +### Using admin service account + +1. Activate the provided `KUBECONFIG` in your current terminal session: + + ```bash + export KUBECONFIG=~/.kube/code-for-philly-admin.yaml + ``` + +2. Get the name of the currently running pods and store them in shell variables: + + ```bash + POD_NAME=$(kubectl -n code-for-philly get pod -l app.kubernetes.io/name=code-for-philly -o jsonpath='{.items[0].metadata.name}') + ``` + +### Open interactive backend shell + +```bash +kubectl -n code-for-philly exec -it $POD_NAME -- bash +``` + +### Open interactive database shell + +```bash +kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite mysql +``` + +### Run an emergence-console command + +```bash +kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite emergence-console-run migrations:execute +``` + +### Run an SQL query + +```bash +echo 'SELECT * FROM people' | kubectl -n code-for-philly exec -i $POD_NAME -- hab pkg exec codeforphilly/site-composite mysql +``` + +### Dump the entire database + +```bash +kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite mysqldump 'codeforphilly' > /tmp/codeforphilly.sql +``` + +### Forward MySQL port + +```bash +kubectl -n code-for-philly port-forward pods/$POD_NAME 3306:3306 +``` + +!!! tip "Database logins" + Default database credentials can be found in `helm-chart/values.yaml` (typically `admin` / `admin`) From d2976c7f301f467f7233e4ddc22b1dce49a38f0e Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Fri, 11 Mar 2022 13:24:13 -0500 Subject: [PATCH 3/4] content: change leadership openings to a page --- html-templates/includes/site.nav-sitelinks.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html-templates/includes/site.nav-sitelinks.tpl b/html-templates/includes/site.nav-sitelinks.tpl index 48b07dba..ad0bcd88 100644 --- a/html-templates/includes/site.nav-sitelinks.tpl +++ b/html-templates/includes/site.nav-sitelinks.tpl @@ -23,7 +23,7 @@ {_ "Mission"} {_ "Code of Conduct"} {_ "Organizing Team"} - {_ "Join the Organizing Team"} + {_ "Join the Organizing Team"} {_ "Contact Us"} - \ No newline at end of file + From 713935944a60164df982bedec4c4878e6fd2c3f3 Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Wed, 16 Mar 2022 10:27:23 -0400 Subject: [PATCH 4/4] Content: update Choose Native Plants project title --- html-templates/home.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html-templates/home.tpl b/html-templates/home.tpl index 361f81fe..103a59b4 100644 --- a/html-templates/home.tpl +++ b/html-templates/home.tpl @@ -116,7 +116,7 @@ {projectTile name="PHLASK" portfolioModal="#portfolioModal1" short="Access to Public Water" image="phlask.png" } {projectTile name="PAWS" portfolioModal="#portfolioModal2" short="Homes for all Pets" image="paws.png" } {projectTile name="PLSE" portfolioModal="#portfolioModal4" short="Legal Support and Expungement" image="plse.png" } - {projectTile name="Only Plant Natives PA" portfolioModal="#portfolioModal5" short="Propagate PA Wildflowers" image="flowers.jpg" } + {projectTile name="Choose Native Plants PA" portfolioModal="#portfolioModal5" short="Propagate PA Wildflowers" image="flowers.jpg" } {projectTile name="CfP Website Design" portfolioModal="#portfolioModal6" short="Homepage" image="code-for-philly.png" } @@ -522,7 +522,7 @@ On July 1st, they will encounter a problem that will severely hinder their abili This project involves 'scraping' criminal history record information from a publicly-available database and storing it on secure servers only available to PLSE staff for the purpose of expungements. The data will need to be properly organized in order to easily pull up an individual's full record. This project is the only way they could continue providing quick, life-changing services to Philadelphia communities." project="prevention_point_unified_reporting_system" site="https://www.plsephilly.org/" github="https://github.com/CodeForPhilly/prevention-point" slack="preventionpoint" } -{projectModal name="Only Plant Natives PA" modal="portfolioModal5" image="flowers.jpg" +{projectModal name="Choose Native Plants PA" modal="portfolioModal5" image="flowers.jpg" description="Native plants are really important...

But it is a bit overwhelming to select plants (e.g. wildflowers and grasses). This google sheet + tableau solution is designed to assist as a entry point to further research. I'm seeking user experience feedback from the Code for Philly community. Also - If anyone wants to help with the database, please join the project."