From 864140709b4179bcf2da62384992b8b26c1941ff Mon Sep 17 00:00:00 2001 From: Balaji Alwar Date: Tue, 27 Aug 2024 12:29:11 -0700 Subject: [PATCH 1/3] Add elevated privileges for PH 142 and Data 101 course staff --- deployments/data101/config/common.yaml | 15 +++++++++++++++ deployments/publichealth/config/common.yaml | 14 +++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/deployments/data101/config/common.yaml b/deployments/data101/config/common.yaml index 8720901ee..7936ed10f 100644 --- a/deployments/data101/config/common.yaml +++ b/deployments/data101/config/common.yaml @@ -48,6 +48,21 @@ jupyterhub: # # this role will be assigned to... # groups: # - course::N::group::Admins + + # Data 101, Fall 2024, #https://jira-secure.berkeley.edu/browse/DH-364 + course-staff-1536858: + # description: Enable course staff to view and access servers. + # this role provides permissions to... + scopes: + - admin-ui + - list:users!group=course::1536858 + - admin:servers!group=course::1536858 + - access:servers!group=course::1536858 + # this role will be assigned to... + groups: + - course::1536858::enrollment_type::teacher + - course::1536858::enrollment_type::ta + extraConfig: data101-new-db: | from jupyterhub.utils import exponential_backoff diff --git a/deployments/publichealth/config/common.yaml b/deployments/publichealth/config/common.yaml index 44f92504f..e55e9723f 100644 --- a/deployments/publichealth/config/common.yaml +++ b/deployments/publichealth/config/common.yaml @@ -38,19 +38,19 @@ jupyterhub: groups: - course::1524699::group::all-admins - # PHW 142, Fall 2024, #5831 - course-staff-1535789: + # PHW 142, Fall 2024, #https://github.com/berkeley-dsep-infra/datahub/issues/6026 + course-staff-1537782: # description: Enable course staff to view and access servers. # this role provides permissions to... scopes: - admin-ui - - list:users!group=course::1535789 - - admin:servers!group=course::1535789 - - access:servers!group=course::1535789 + - list:users!group=course::1537782 + - admin:servers!group=course::1537782 + - access:servers!group=course::1537782 # this role will be assigned to... groups: - - course::1535789::enrollment_type::teacher - - course::1535789::enrollment_type::ta + - course::1537782::enrollment_type::teacher + - course::1537782::enrollment_type::ta extraConfig: # Use 1x- in `common.yaml` extraConfig values. From 368af17dd96362a8380c08be4245acc1181d4fbd Mon Sep 17 00:00:00 2001 From: shane knapp <incomplete@gmail.com> Date: Tue, 27 Aug 2024 12:47:23 -0700 Subject: [PATCH 2/3] hopefully fixing bash arrays + parsing --- .github/workflows/deploy-hubs.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index a6fd9269e..3f7cc4510 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -37,8 +37,8 @@ jobs: # deploy any hubs that have been labeled for deployment for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do if [[ "$label" == hub-* ]]; then - label=$(echo $label | awk -F'-' '{print $2}') - HUBS+="$label" + hub_name=$(echo $label | awk -F'-' '{print $2}') + HUBS+="$hub_name " echo "DEPLOY=1" >> $GITHUB_ENV fi done @@ -119,11 +119,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Check out the image repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - - name: Pull out any hubs that need deploying from the labels on the merge commit to prod run: | echo "PR labels: ${{ steps.pr-labels.outputs.labels }}" @@ -137,14 +132,20 @@ jobs: # deploy any hubs that have been labeled for deployment for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do if [[ "$label" == hub-* ]]; then - label=$(echo $label | awk -F'-' '{print $2}') - HUBS+="$label" + hub_name=$(echo $label | awk -F'-' '{print $2}') + HUBS+="$hub_name " echo "DEPLOY=1" >> $GITHUB_ENV fi done echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV fi + - name: Check out the image repo + if: ${{ env.DEPLOY }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - name: Setup python if: ${{ env.DEPLOY }} uses: actions/setup-python@v5 From 594dfe5ed6d3cb0f39860e2e2606961cad68bfc1 Mon Sep 17 00:00:00 2001 From: shane knapp <incomplete@gmail.com> Date: Tue, 27 Aug 2024 14:42:06 -0700 Subject: [PATCH 3/3] changing debug output to verbose --- .github/workflows/deploy-all-hubs.yaml | 4 ++-- .github/workflows/deploy-hubs.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-all-hubs.yaml b/.github/workflows/deploy-all-hubs.yaml index 2018b1301..cd032018c 100644 --- a/.github/workflows/deploy-all-hubs.yaml +++ b/.github/workflows/deploy-all-hubs.yaml @@ -97,7 +97,7 @@ jobs: fi done echo "Pretending to deploy base hub image to ${deployment} :P" - echo "hubploy deploy --debug ${deployment} hub staging" + echo "hubploy deploy --verbose ${deployment} hub staging" done < <(ls deployments/ | sed -e 's,/,,g') deploy-hub-images-prod: @@ -185,5 +185,5 @@ jobs: fi done echo "Pretending to deploy base hub image to ${deployment} :P" - echo "hubploy deploy --debug ${deployment} hub prod" + echo "hubploy deploy --verbose ${deployment} hub prod" done < <(ls deployments/ | sed -e 's,/,,g') diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index 3f7cc4510..807240013 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -106,7 +106,7 @@ jobs: run: | for hub in $(echo -e "${{ env.DEPLOY_HUBS }}"); do echo "Deploying $hub to staging" - echo "hubploy --debug deploy $hub hub staging" + echo "hubploy --verbose deploy $hub hub staging" done deploy-hubs-to-prod: @@ -201,5 +201,5 @@ jobs: run: | for hub in $(echo -e "${{ env.DEPLOY_HUBS }}"); do echo "Deploying $hub to prod" - echo "hubploy --debug deploy $hub hub prod" + echo "hubploy --verbose deploy $hub hub prod" done