-
Notifications
You must be signed in to change notification settings - Fork 0
CI/33 Add dashboard skeleton and integration test #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b4eedf7
Add rendered dashboard skeleton
AlexAxthelm 97f6373
Add Dashboard skeleton and function to copy to output dir
AlexAxthelm 4810078
Increment version number to 0.0.0.9003
AlexAxthelm 5f3abf7
Remove Dashboard skeleton from package
AlexAxthelm d8b5fa7
Add dashboard files to docker image
AlexAxthelm bc31c19
Add fucntion to copy dashboard files to output dir
AlexAxthelm 1d23ff6
Add docker build and gh-pages workflows
AlexAxthelm e5a1220
Merge branch 'main' into feat/33-integrate-dashboard
AlexAxthelm 069492b
Use hotifx branch of build action
AlexAxthelm ea9b622
Trigger CI
AlexAxthelm a0b41c2
Trigger CI
AlexAxthelm 8f1b3f1
Use main branch of actions - after patch
AlexAxthelm 5956743
Hadolint
AlexAxthelm da4445f
Grant write permissions to `id-token` (Azure Login)
AlexAxthelm 1e6252f
fix: Pass absolute path to docker volume bind
AlexAxthelm 5d8d5ed
add step to move files to expected directory
AlexAxthelm 8712573
disable zip output
AlexAxthelm f2c94ab
fix: deploy correct output directoryu
AlexAxthelm 6ee5b51
Checkout repor for GH pages deploy
AlexAxthelm 9068b76
Move checkout step to beginning
AlexAxthelm 2b43c5a
Chmod output dir
AlexAxthelm dd7ceaa
Change owner of output dir as well
AlexAxthelm d20ce43
Chmod as part of docker step, not after
AlexAxthelm 2ae1274
Actually run docker image as GH user
AlexAxthelm 7215492
Give action permissions to write to repo
AlexAxthelm 458a445
Grant write permissions for PR (comment)
AlexAxthelm 12df8a4
Trigger CI
AlexAxthelm cdb8034
remove chmod 777 command
AlexAxthelm b7fcf84
Use main branch of Dashboard source
AlexAxthelm de6babd
Remove commented code
AlexAxthelm 485f8f8
Rename envvar
AlexAxthelm cee26cc
remove commented code
AlexAxthelm c5da0ac
Trigger CI
AlexAxthelm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ | |
| ^LICENSE\.md$ | ||
| ^\.Rproj\.user$ | ||
| ^docker-compose.yml$ | ||
| ^dashboard_output_dir | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - closed | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '0 0 * * 1,2,3,4,5' | ||
| workflow_dispatch: | ||
|
|
||
| name: docker | ||
|
|
||
| jobs: | ||
| docker: | ||
| name: Docker actions | ||
| uses: RMI-PACTA/actions/.github/workflows/docker.yml@main | ||
| with: | ||
| do-check-r-sysdeps: false | ||
|
|
||
| gh-pages: | ||
| name: gh-pages | ||
| uses: ./.github/workflows/gh-pages.yml | ||
| needs: [docker] | ||
| secrets: inherit | ||
| with: | ||
| full-image-name: ${{ needs.docker.outputs.full-image-name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| full-image-name: | ||
| required: true | ||
| type: string | ||
|
|
||
| concurrency: preview-${{ github.ref }} | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
| steps: | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| # https://github.com/Azure/login?tab=readme-ov-file#login-with-openid-connect-oidc-recommended | ||
| - name: Azure Login | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Download Analysis Outputs | ||
| id: download-analysis-outputs | ||
| uses: RMI-PACTA/actions/actions/azure/blob-copy@main | ||
| with: | ||
| source: https://pactadatadev.blob.core.windows.net/ghactions-workflow-pacta-results/main/latest/full_params_2023Q4/analysis_output_dir | ||
| destination: tmp_analysis_output_dir | ||
|
|
||
| - name: Download Benchmarks | ||
| id: download-benchmarks | ||
| uses: RMI-PACTA/actions/actions/azure/blob-copy@main | ||
| with: | ||
| source: https://pactadatadev.blob.core.windows.net/benchmarks-webapp/2023Q4/2023Q4_20240529T002355Z | ||
| destination: tmp_benchmarks_dir | ||
|
|
||
| - name: move output and analysis files to correct directory | ||
| run: | | ||
| mv tmp_analysis_output_dir/main/latest/full_params_2023Q4/analysis_output_dir analysis_output_dir | ||
| ls analysis_output_dir | ||
| mv tmp_benchmarks_dir/2023Q4/2023Q4_20240529T002355Z benchmarks_dir | ||
| ls benchmarks_dir | ||
|
|
||
| - name: Create Output Directories | ||
| run: | | ||
| mkdir -p dashboard_output_dir/data | ||
|
|
||
| - name: Run Docker Image | ||
| env: | ||
| FULL_IMAGE_NAME: ${{ inputs.full-image-name }} | ||
| WORKSPACE: ${{ github.workspace }} | ||
| PARAMETERS: "" | ||
| ANALYSIS_OUTPUT_DIR: "analysis_output_dir" | ||
| BENCHMARKS_DIR: "benchmarks_dir" | ||
| DASHBOARD_DATA_DIR: "dashboard_output_dir/data" | ||
| DASHBOARD_OUTPUT_DIR: "dashboard_output_dir" | ||
| run: | | ||
|
|
||
| docker run \ | ||
| --network none \ | ||
| --user $(id -u):$(id -g) \ | ||
| --env LOG_LEVEL=TRACE \ | ||
| --env ANALYSIS_OUTPUT_DIR="/mnt/analysis_output_dir" \ | ||
| --env BENCHMARKS_DIR="/mnt/benchmarks_dir" \ | ||
| --env DASHBOARD_DATA_DIR="/mnt/dashboard_output_dir/data" \ | ||
| --env DASHBOARD_OUTPUT_DIR="/mnt/dashboard_output_dir" \ | ||
| --mount type=bind,readonly,source=${WORKSPACE}/${BENCHMARKS_DIR},target=/mnt/benchmarks_dir \ | ||
| --mount type=bind,source=${WORKSPACE}/${ANALYSIS_OUTPUT_DIR},target=/mnt/analysis_output_dir \ | ||
| --mount type=bind,source=${WORKSPACE}/${DASHBOARD_OUTPUT_DIR},target=/mnt/dashboard_output_dir \ | ||
| --mount type=bind,source=${WORKSPACE}/${DASHBOARD_DATA_DIR},target=/mnt/dashboard_output_dir/data \ | ||
| $FULL_IMAGE_NAME \ | ||
| "$PARAMETERS" | ||
|
|
||
| - name: chmod & List outputs | ||
| run: | | ||
| ls -lR dashboard_output_dir | ||
|
|
||
| - name: Add nojekyll file | ||
| if: github.event.action != 'closed' | ||
| run: touch dashboard_output_dir/.nojekyll | ||
|
|
||
| - name: 🚀 Deploy main page | ||
| if: ${{ github.event_name == 'push' }} | ||
| uses: JamesIves/github-pages-deploy-action@v4 | ||
| with: | ||
| folder: dashboard_output_dir # The folder the action should deploy. | ||
| clean: true | ||
| force: false | ||
| clean-exclude: | | ||
| .nojekyll | ||
| pr-preview/ | ||
|
|
||
| - name: 🛸 Deploy PR preview | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| uses: rossjrw/pr-preview-action@v1 | ||
| with: | ||
| source-dir: dashboard_output_dir | ||
| preview-branch: gh-pages | ||
| umbrella-dir: pr-preview | ||
| action: auto | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| build_dashboard <- function( | ||
| params, | ||
| analysis_output_dir = Sys.getenv("ANALYSIS_OUTPUT_DIR"), | ||
| benchmarks_dir = Sys.getenv("BENCHMARKS_DIR"), | ||
| dashboard_data_dir = Sys.getenv("DASHBOARD_DATA_DIR"), | ||
| dashboard_skeleton_files_dir = Sys.getenv("DASHBOARD_SKELETON_FILES_DIR"), | ||
| dashboard_output_dir = Sys.getenv("DASHBOARD_OUTPUT_DIR") | ||
| ) { | ||
|
|
||
| prepare_pacta_dashboard_data( | ||
| analysis_output_dir = analysis_output_dir, | ||
| dashboard_data_dir = dashboard_data_dir, | ||
| benchmarks_dir = benchmarks_dir | ||
| ) | ||
|
|
||
| dashboard_copy_success <- copy_dashboard_files( | ||
| dashboard_skeleton_files_dir = dashboard_skeleton_files_dir, | ||
| dashboard_output_dir = dashboard_output_dir | ||
| ) | ||
|
|
||
| dashboard_output_data_dir <- file.path(dashboard_output_dir, "data") | ||
| if (dashboard_data_dir != dashboard_output_data_dir) { | ||
| if (!dir.exists(dashboard_output_data_dir)) { | ||
| dir.create(dashboard_output_data_dir, recursive = TRUE) | ||
| } | ||
| data_copy_success <- file.copy( | ||
| from = dashboard_data_dir, | ||
| to = dashboard_output_data_dir, | ||
| recursive = TRUE | ||
| ) | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| copy_dashboard_files <- function( | ||
| dashboard_skeleton_files_dir = Sys.getenv("DASHBOARD_SKELETON_FILES_DIR"), | ||
| dashboard_output_dir = Sys.getenv("DASHBOARD_OUTPUT_DIR") | ||
| ) { | ||
|
|
||
| dashboard_files <- list.files( | ||
| dashboard_skeleton_files_dir, | ||
| full.names = TRUE, | ||
| recursive = FALSE | ||
| ) | ||
|
|
||
| dashboard_copy_success <- file.copy( | ||
| from = dashboard_files, | ||
| to = file.path(dashboard_output_dir), | ||
| recursive = TRUE | ||
| ) | ||
|
|
||
| return(all(dashboard_copy_success)) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.