Skip to content

Commit

Permalink
fix preload
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Jul 20, 2023
1 parent baf1325 commit b81a1d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ancestry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ on:
env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/singularity
SINGULARITY_VERSION: 3.8.3
ANCESTRY_REF_DIR: ${{ env.runner_temp }}
ANCESTRY_TARGET_DIR: ${{ env.runner_temp }}

jobs:
docker:
if: ${{ inputs.docker }}
runs-on: ubuntu-latest

steps:
steps:
- name: Set environment variables
run: |
echo "ANCESTRY_REF_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
echo "ANCESTRY_TARGET_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
- name: Check out pipeline code
uses: actions/checkout@v3

Expand All @@ -37,7 +40,7 @@ jobs:
uses: actions/cache/restore@v3
with:
path: ${{ runner.temp }}/docker
key: ${{ inputs.cache-key }}
key: ${{ inputs.container-cache-key }}
fail-on-cache-miss: true

- name: Load docker images from cache
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/preload-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@ on:
outputs:
cache-key:
value: ancestry

env:
ANCESTRY_REF_DIR: ${{ env.RUNNER_TEMP }}
ANCESTRY_TARGET_DIR: ${{ env.RUNNER_TEMP }}

jobs:
preload_reference:
runs-on: ubuntu-latest
steps:
- name: Download reference data
- name: Set environment variables
run: |
wget -qnc -P $ANCESTRY_REF_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_reference.tar.zst
wget -qnc -P $ANCESTRY_TARGET_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_target.tar.zst
tar -xf $ANCESTRY_TARGET_DIR/GRCh38_HAPNEST_target.tar.zst -C $ANCESTRY_TARGET_DIR
echo "ANCESTRY_REF_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
echo "ANCESTRY_TARGET_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
- name: Cache reference data
id: cache-ref
uses: actions/cache/save@v3
uses: actions/cache@v3
with:
path: |
${{ env.ANCESTRY_TARGET_DIR }}/GRCh38_HAPNEST_TARGET_ALL.pgen
${{ env.ANCESTRY_TARGET_DIR }}/GRCh38_HAPNEST_TARGET_ALL.psam
${{ env.ANCESTRY_TARGET_DIR }}/GRCh38_HAPNEST_TARGET_ALL.pvar.zst
${{ env.ANCESTRY_REF_DIR }}/GRCh38_HAPNEST_reference.tar.zst
key: ancestry

- name: Download reference data
if: steps.cache-ref.outputs.cache-hit != 'true'
run: |
wget -qnc -P $ANCESTRY_REF_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_reference.tar.zst
wget -qnc -P $ANCESTRY_TARGET_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_target.tar.zst
tar -xf $ANCESTRY_TARGET_DIR/GRCh38_HAPNEST_target.tar.zst -C $ANCESTRY_TARGET_DIR

0 comments on commit b81a1d5

Please sign in to comment.