Skip to content

Commit

Permalink
disable report
Browse files Browse the repository at this point in the history
see PR for comment
  • Loading branch information
asmacdo committed Nov 11, 2024
1 parent 965a81e commit 7366d2d
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .github/manifests/disk-usage-report-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
spec:
containers:
- name: disk-usage-report
image: IMAGE_PLACEHOLDER
image: dandiarchive/dandihub-report-generator:latest
args:
- "/home/"
volumeMounts:
Expand Down
208 changes: 104 additions & 104 deletions .github/workflows/report.yaml
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
name: Generate Data Usage Report

on:
pull_request:
branches:
- main

jobs:
generate_data_usage_report:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: images/Dockerfile.dandihub_report_generator
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/dandihub-report-generator:latest

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Assume ProvisioningRole
run: |
CREDS=$(aws sts assume-role --role-arn ${{ secrets.AWS_PROVISIONING_ROLE_ARN }} --role-session-name "GitHubActionsSession")
export AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r '.Credentials.AccessKeyId')
export AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r '.Credentials.SecretAccessKey')
export AWS_SESSION_TOKEN=$(echo $CREDS | jq -r '.Credentials.SessionToken')
- name: Configure kubectl with AWS EKS
run: |
aws eks update-kubeconfig --name eks-dandihub --region us-east-2 --role-arn ${{ secrets.AWS_PROVISIONING_ROLE_ARN }}
# TODO remove
- name: Sanity check
run: |
kubectl get pods -n jupyterhub
# - name: Deploy Hello World Pod
# run: |
# kubectl apply -f .github/manifests/hello-world-pod.yaml
#
# - name: Wait for Hello World Pod to complete
# run: |
# kubectl wait --for=condition=Ready pod/hello-world-pod --timeout=300s # 5 minutes
# continue-on-error: true # Allow the workflow to continue even if this step fails
#
# - name: Get Hello World Pod logs
# run: |
# kubectl logs hello-world-pod
# if: ${{ success() }} # Only run this step if the previous step was successful
#
# - name: Delete Hello World Pod
# run: |
# kubectl delete pod hello-world-pod
# if: ${{ always() }} # Always run this step, even if other steps fail
#
- name: Replace image placeholder in manifest
run: |
sed -i 's|IMAGE_PLACEHOLDER|'"${{ secrets.DOCKERHUB_USERNAME }}/dandihub-report-generator:latest"'|' .github/manifests/disk-usage-report-job.yaml
- name: Deploy Disk Usage Report Job
run: |
kubectl apply -f .github/manifests/disk-usage-report-job.yaml
# TODO should timeout be longer?
- name: Wait for Disk Usage Report Job to complete
run: |
kubectl wait --for=condition=complete job/disk-usage-report-job --timeout=360s -n jupyterhub
continue-on-error: true

# continue-on-error for previous steps so we delete the job
- name: Delete Disk Usage Report Job
run: |
kubectl delete job disk-usage-report-job -n jupyterhub
# - name: Clone dandi-hub-usage-reports repository
# run: |
# git clone https://github.com/dandi/dandi-hub-usage-reports.git
#
# - name: Copy report file to repository, commit and push report
# run: |
# cd dandi-hub-usage-reports
# DATE=$(date +'%Y-%m-%d')
# mv ../du_report.json $DATE_du_report.json
# git config --global user.name "GitHub Actions"
# git config --global user.email "actions@github.com"
# git add $DATE_du_report.json
# git commit -m "Add disk usage report for $DATE"
# git push https://${{ secrets.GITHUB_TOKEN }}@github.com/dandi/dandi-hub-usage-reports.git
# name: Generate Data Usage Report
#
# on:
# pull_request:
# branches:
# - main
#
# jobs:
# generate_data_usage_report:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Log in to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@v3
# with:
# context: .
# file: images/Dockerfile.dandihub_report_generator
# push: true
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/dandihub-report-generator:latest
#
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v3
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-east-2
#
# - name: Assume ProvisioningRole
# run: |
# CREDS=$(aws sts assume-role --role-arn ${{ secrets.AWS_PROVISIONING_ROLE_ARN }} --role-session-name "GitHubActionsSession")
# export AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r '.Credentials.AccessKeyId')
# export AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r '.Credentials.SecretAccessKey')
# export AWS_SESSION_TOKEN=$(echo $CREDS | jq -r '.Credentials.SessionToken')
#
# - name: Configure kubectl with AWS EKS
# run: |
# aws eks update-kubeconfig --name eks-dandihub --region us-east-2 --role-arn ${{ secrets.AWS_PROVISIONING_ROLE_ARN }}
#
# # TODO remove
# - name: Sanity check
# run: |
# kubectl get pods -n jupyterhub
#
# # - name: Deploy Hello World Pod
# # run: |
# # kubectl apply -f .github/manifests/hello-world-pod.yaml
# #
# # - name: Wait for Hello World Pod to complete
# # run: |
# # kubectl wait --for=condition=Ready pod/hello-world-pod --timeout=300s # 5 minutes
# # continue-on-error: true # Allow the workflow to continue even if this step fails
# #
# # - name: Get Hello World Pod logs
# # run: |
# # kubectl logs hello-world-pod
# # if: ${{ success() }} # Only run this step if the previous step was successful
# #
# # - name: Delete Hello World Pod
# # run: |
# # kubectl delete pod hello-world-pod
# # if: ${{ always() }} # Always run this step, even if other steps fail
# #
# - name: Replace image placeholder in manifest
# run: |
# sed -i 's|IMAGE_PLACEHOLDER|'"${{ secrets.DOCKERHUB_USERNAME }}/dandihub-report-generator:latest"'|' .github/manifests/disk-usage-report-job.yaml
#
# - name: Deploy Disk Usage Report Job
# run: |
# kubectl apply -f .github/manifests/disk-usage-report-job.yaml
#
# # TODO should timeout be longer?
# - name: Wait for Disk Usage Report Job to complete
# run: |
# kubectl wait --for=condition=complete job/disk-usage-report-job --timeout=360s -n jupyterhub
# continue-on-error: true
#
# # continue-on-error for previous steps so we delete the job
# - name: Delete Disk Usage Report Job
# run: |
# kubectl delete job disk-usage-report-job -n jupyterhub
#
# # - name: Clone dandi-hub-usage-reports repository
# # run: |
# # git clone https://github.com/dandi/dandi-hub-usage-reports.git
# #
# # - name: Copy report file to repository, commit and push report
# # run: |
# # cd dandi-hub-usage-reports
# # DATE=$(date +'%Y-%m-%d')
# # mv ../du_report.json $DATE_du_report.json
# # git config --global user.name "GitHub Actions"
# # git config --global user.email "actions@github.com"
# # git add $DATE_du_report.json
# # git commit -m "Add disk usage report for $DATE"
# # git push https://${{ secrets.GITHUB_TOKEN }}@github.com/dandi/dandi-hub-usage-reports.git

0 comments on commit 7366d2d

Please sign in to comment.