From a788817a8c6ea6bee90387b05b6313c3858cf481 Mon Sep 17 00:00:00 2001 From: iishiishii Date: Fri, 21 Feb 2025 11:18:55 +1000 Subject: [PATCH 1/2] Remove Zenodo doi creation from update neurocontainer action --- .github/workflows/update-neurocontainers.yml | 2 +- .github/workflows/upload_containers_simg.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/update-neurocontainers.yml b/.github/workflows/update-neurocontainers.yml index e334b46f..104ca11d 100644 --- a/.github/workflows/update-neurocontainers.yml +++ b/.github/workflows/update-neurocontainers.yml @@ -22,7 +22,7 @@ jobs: python-version: 3.8 - name : Check if singularity container files exist in nectar cloud and build & upload if not there run: | - /bin/bash .github/workflows/upload_containers_simg.sh ${{ secrets.ZENODO_TOKEN }} + /bin/bash .github/workflows/upload_containers_simg.sh - name: Auto commit changes to applist.json uses: stefanzweifel/git-auto-commit-action@v4 id: auto-commit-action diff --git a/.github/workflows/upload_containers_simg.sh b/.github/workflows/upload_containers_simg.sh index bd33ed5a..cb333a93 100644 --- a/.github/workflows/upload_containers_simg.sh +++ b/.github/workflows/upload_containers_simg.sh @@ -44,8 +44,6 @@ do # download simg file from cache: echo "[DEBUG] ${IMAGENAME_BUILDDATE}.simg exists in temporary cache on nectar cloud" curl --output "$IMAGE_HOME/${IMAGENAME_BUILDDATE}.simg" "https://object-store.rc.nectar.org.au/v1/AUTH_dead991e1fa847e3afcca2d3a7041f5d/neurodesk/temporary-builds-new/${IMAGENAME_BUILDDATE}.simg" - echo "Upload container $IMAGE_HOME/${IMAGENAME_BUILDDATE}.simg to Zenodo" - export DOI_URL=$(python3 .github/workflows/publish-doi.py --container_filepath="$IMAGE_HOME/${IMAGENAME_BUILDDATE}.simg" --container_name=${IMAGENAME_BUILDDATE} --token=$1) echo "[DEBUG] Deleting file after download or when older than 30days from cache ..." rclone delete nectar:/neurodesk/temporary-builds-new/${IMAGENAME_BUILDDATE}.simg rclone delete --min-age 30d nectar:/neurodesk/temporary-builds-new From f41bbac45501b99e9efee8aaee1d9e97368618b3 Mon Sep 17 00:00:00 2001 From: iishiishii Date: Fri, 21 Feb 2025 11:25:42 +1000 Subject: [PATCH 2/2] Refactor json_gen.py to remove DOI handling --- .github/workflows/upload_containers_simg.sh | 2 +- cvmfs/json_gen.py | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/upload_containers_simg.sh b/.github/workflows/upload_containers_simg.sh index cb333a93..c06325df 100644 --- a/.github/workflows/upload_containers_simg.sh +++ b/.github/workflows/upload_containers_simg.sh @@ -104,7 +104,7 @@ mv log.txt cvmfs cd cvmfs echo "[Debug] generate applist.json file for website" -python json_gen.py --application=$IMAGENAME_BUILDDATE --doi_url=$DOI_URL #this generates the applist.json for the website +python json_gen.py #this generates the applist.json for the website # these files will be committed via uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/cvmfs/json_gen.py b/cvmfs/json_gen.py index b1c3712a..ca42b6ba 100644 --- a/cvmfs/json_gen.py +++ b/cvmfs/json_gen.py @@ -1,31 +1,17 @@ import json -import argparse -def process_text_to_json(application, doi_url): +def process_text_to_json(): my_dict = {} val = [] with open("log.txt") as f: for line in f: line = line.split() - - # Find the matching application and update its DOI - if application in line[0]: - val.append({"application": line[0], "categories": ' '.join(line[1:]).replace("categories:","").rstrip(',').split(","), "doi": doi_url}) - else: - val.append({"application": line[0], "categories": ' '.join(line[1:]).replace("categories:","").rstrip(',').split(",")}) + val.append({"application": line[0], "categories": ' '.join(line[1:]).replace("categories:","").rstrip(',').split(",")}) my_dict['list'] = val with open('applist.json', 'w') as fp: json.dump(my_dict, fp, sort_keys=True, indent=4) if __name__ == '__main__': - parser = argparse.ArgumentParser( - prog="Update DOI for app list", - ) - parser.add_argument("--application", type=str, required=True, help="Application name and version") - parser.add_argument("--doi_url", type=str, required=True, help="DOI URL") - - args = parser.parse_args() - - process_text_to_json(args.application, args.doi_url) + process_text_to_json() \ No newline at end of file