From 59a76e4ba6e113d0b3a35c13a375560584ca851a Mon Sep 17 00:00:00 2001 From: Atharva Arya <55894364+atharva-2001@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:14:59 +0530 Subject: [PATCH] Cache LFS Objects in the TARDIS-Carsus Compatibility Check Workflow (#327) * Initial commit change env file path change env file path change path again change path again skip first step path again Package path * Add step to download the CMFGEN database * Add URLs to the CMFGEN database Fix atom data path * Add tardis build job repo path test * Add strategy for TARDIS build job * Fix lock file path Fix package path * Add step to run notebook * Upload spectrum notebook Fix notebook path Fix notebook path Require carsus build to run again before running tardis build * Fix atom data path Fix output format of atom data notebook Fix atom data path again Print atom data path Fix atom data path * Change URL used to get the reference data file * Download the file from the workflow * Upload reference data as artifact * Try downloading all reference data * Clone my fork of tardis refdata * Use lfs when cloning * Separate commands * Add new env variables, generate reference data for comparision using the new atomic data file * Clone my fork with arraydiff unpinned Fix atomic data path * Fix notebook path when creating artifact * Fix paths in environment variables * Install bokeh * Fix paths after moving branch * Rename notebook * Remove variables related to matrix strategy * Remove step to download reference data * Create copy of the quickstart notebook * Delete markdown * Add refdata_gen notebook instead of quickstart * Change branch when cloning carsus in the workflow * Try removing chianti reader * Put back elements in the atomic data * Add chianti data back but without collisions * Change Chianti version * Continue workflow if step fails * Revert back Chianti version * Add step to fail job if spectra dont match * test * Exit if contents of tmp file are set to 0 * Exit code * revert comments * On workflow dispatch * Rename steps and use variables * Replace NBCONVERT_CMD variable with NBCONVERT_FLAGS * Comment out Carsus build job temporarily, download reference data from ci helpers * Disable workflow dispatch temporarily * Fix paths for refdata compare notebook * Carsus build is necessary for TARDIS build * Change file name in notebook * Delete lines commented out which are not necessary * Do not clone my fork of the carsus repository * Change title of the notebook and rename it * Change file and step names * No need for inputs * Check file contents according to changes in tardis-sn/tardis-refdata#58 * Change path of refdata_compare_result file * Change trigger back to workflow_dispatch * Update URL to use TARDIS fork * Do not pin bokeh * Add name to comparison notebook artifact * Cache LFS objects * Do git lfs checkout if the cache key is found * Use cache no instead of v1 hardcoding --- .github/workflows/bridge.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bridge.yml b/.github/workflows/bridge.yml index 83e0512dc..5445e25b4 100644 --- a/.github/workflows/bridge.yml +++ b/.github/workflows/bridge.yml @@ -91,8 +91,32 @@ jobs: - name: Download refdata_compare notebook run: wget https://raw.githubusercontent.com/tardis-sn/tardis-refdata/master/notebooks/ref_data_compare_from_paths.ipynb - - name: Download reference data - run: bash .ci-helpers/download_reference_data.sh + - name: Clone tardis-sn/tardis-refdata + uses: actions/checkout@v2 + with: + repository: tardis-sn/tardis-refdata + path: tardis-refdata + + - name: Create LFS file list + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + working-directory: tardis-refdata + + - name: Restore LFS cache + uses: actions/cache@v2 + id: lfs-cache + with: + path: tardis-refdata/.git/lfs + key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v${{ env.CACHE_NUMBER }} + + - name: Git LFS Pull + run: git lfs pull + working-directory: tardis-refdata + if: steps.lfs-cache.outputs.cache-hit != 'true' + + - name: Git LFS Checkout + run: git lfs checkout + working-directory: tardis-refdata + if: steps.lfs-cache.outputs.cache-hit == 'true' - name: Setup TARDIS environment uses: conda-incubator/setup-miniconda@v2