Skip to content

Commit

Permalink
52 create separate tabs for reco and full outputs (#53)
Browse files Browse the repository at this point in the history
* Create separate directories for RECO and FULL in workflow

* Use an argument instead of explicitly calling RECO or FULL

* Delete file that will be unused going forward

* Update and rename campaigns.html to campaigns_reco.html

Create layout for reconstructed files

* Create layout for full simulation summary list

* Update and rename campaigns.md to campaigns_reco.md

* Create campaigns_full.md

* Add both reco and full to campaigns menu
  • Loading branch information
rahmans1 authored Oct 8, 2023
1 parent 45a783b commit 0ad6a3e
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 63 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/nightly-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,35 @@ jobs:
shell: bash
run: |
if [ -d ./docs/RECO ]; then rm -rf ./docs/RECO; fi
if [ -d ./docs/FULL ]; then rm -rf ./docs/FULL; fi
mc config host add S3 ${S3_HOST} ${S3_ACCESS_KEY} ${S3_SECRET_KEY}
chmod +x ./docs/_data/list_S3.sh
./docs/_data/list_S3.sh > ./docs/_data/s3_content.yml
./docs/_data/list_S3.sh RECO > ./docs/_data/reco_content.yml
./docs/_data/list_S3.sh FULL > ./docs/_data/full_content.yml
env:
S3_HOST: ${{secrets.S3_HOST}}
S3_ACCESS_KEY: ${{secrets.S3_ACCESS_KEY}}
S3_SECRET_KEY: ${{secrets.S3_SECRET_KEY}}
- name: Upload s3_content
- name: Upload reco_content
uses: actions/upload-artifact@v3
with:
name: s3_content
path: ./docs/_data/s3_content.yml
name: reco_content
path: ./docs/_data/reco_content.yml
- name: Upload full_content
uses: actions/upload-artifact@v3
with:
name: full_content
path: ./docs/_data/full_content.yml
- name: Upload RECO
uses: actions/upload-artifact@v3
with:
name: RECO
path: ./docs/RECO/
- name: Upload FULL
uses: actions/upload-artifact@v3
with:
name: FULL
path: ./docs/FULL/

commit_data:
needs: update_data
Expand All @@ -44,24 +56,37 @@ jobs:
- name: Remove old s3_content
shell: bash
run: |
rm ./docs/_data/s3_content.yml
if [ -f ./docs/_data/reco_content.yml ]; then rm -f ./docs/_data/reco_content.yml; fi
if [ -f ./docs/_data/full_content.yml ]; then rm -f ./docs/_data/full_content.yml; fi
if [ -d ./docs/RECO ]; then rm -rf ./docs/RECO; fi
if [ -d ./docs/FULL ]; then rm -rf ./docs/FULL; fi
mkdir ./docs/RECO/
- name: Download s3_content
mkdir ./docs/FULL/
- name: Download reco_content
uses: actions/download-artifact@v3
with:
name: s3_content
name: reco_content
path: ./docs/_data/
- name: Download full_content
uses: actions/download-artifact@v3
with:
name: full_content
path: ./docs/_data/
- name: Download RECO
uses: actions/download-artifact@v3
with:
name: RECO
path: ./docs/RECO/
- name: Download FULL
uses: actions/download-artifact@v3
with:
name: FULL
path: ./docs/FULL/
- name: Commit updates
shell: bash
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./docs/
git commit -m "Update list in s3_content.yml and RECO/ directory" || echo "No changes to commit"
git commit -m "Update summary lists in RECO and FULL directory" || echo "No changes to commit"
git push origin main
8 changes: 0 additions & 8 deletions docs/_campaigns/campaigns.md

This file was deleted.

8 changes: 8 additions & 0 deletions docs/_campaigns/campaigns_full.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: campaigns_full
description: campaigns_full
name: campaigns_full
layout: campaigns_full
---

{% include layouts/title.md %}
8 changes: 8 additions & 0 deletions docs/_campaigns/campaigns_reco.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: campaigns_reco
description: campaigns_reco
name: campaigns_reco
layout: campaigns_reco
---

{% include layouts/title.md %}
16 changes: 8 additions & 8 deletions docs/_data/list_S3.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

# List all objects in the S3 RECO directory
OBJECTS=$(mc ls S3/eictest/EPIC/RECO)
# List all objects in the RECO or FULL directory
OBJECTS=$(mc ls S3/eictest/EPIC/$1)

# Iterate over the objects: print their names and create folders in the repository containing index.md
while IFS= read -r object; do
name_only=$(echo "$object" | sed -n 's/^\[[^][]*][[:blank:]]*[^[:blank:]]*[[:blank:]]*\(.*\)$/\1/p') # extracts the folder name from mc ls
mkdir -p ./docs/RECO/"${name_only}"
touch ./docs/RECO/"${name_only}"index.md
echo '```' > ./docs/RECO/"${name_only}"index.md
mc tree --files S3/eictest/EPIC/RECO/"${name_only}" | sed 's/.*\.root$//g' | uniq -c | sed 's/.*1 //' >> ./docs/RECO/"${name_only}"index.md # contructs tree diagram with count of files in each directory
echo '```' >> ./docs/RECO/"${name_only}"index.md
echo -e "- text: "$name_only"\n url: "/epic-prod/RECO/$name_only""
mkdir -p ./docs/$1/"${name_only}"
touch ./docs/$1/"${name_only}"index.md
echo '```' > ./docs/$1/"${name_only}"index.md
mc tree --files S3/eictest/EPIC/$1/"${name_only}" | sed 's/.*\.root$//g' | uniq -c | sed 's/.*1 //' >> ./docs/$1/"${name_only}"index.md # contructs tree diagram with count of files in each directory
echo '```' >> ./docs/$1/"${name_only}"index.md
echo -e "- text: "$name_only"\n url: "/epic-prod/$1/$name_only""
done <<< "$OBJECTS"
8 changes: 6 additions & 2 deletions docs/_data/menus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
full: Campaign History
submenus:

- name: campaigns
full: Current
- name: campaigns_reco
full: Reconstructed Outputs

- name: campaigns_full
full: Geant4 Simulation Outputs


- name: about
full: About
Expand Down
36 changes: 0 additions & 36 deletions docs/_data/s3_content.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
---
<ul>
{% for line in site.data.s3_content %}
{% for line in site.data.full_content %}
<li><a href="{{ line.url }}">{{ line.text }}</a></li>
{% endfor %}
</ul>
8 changes: 8 additions & 0 deletions docs/_layouts/campaigns_reco.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
---
<ul>
{% for line in site.data.reco_content %}
<li><a href="{{ line.url }}">{{ line.text }}</a></li>
{% endfor %}
</ul>

0 comments on commit 0ad6a3e

Please sign in to comment.