<commit_before>machine:
  environment:
    OSF_PROJECT: "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage"
    DS005_URL: "${OSF_PROJECT}/57f32a429ad5a101f977eb75"
    DS054_URL: "${OSF_PROJECT}/57f32c22594d9001ef91bf9e"
  services:
    - docker

dependencies:
  cache_directories:
    - "~/data"
    - "~/docker"
    - "~/.cache/stanford-crn"

  pre:
    - mkdir -p $HOME/data
    - mkdir -p $HOME/docker
    - mkdir -p $HOME/ds005/out $HOME/ds054/out
    # Download test data
    - if [[ ! -d $HOME/data/ds005 ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ds005_downsampled.tar.gz "${DS005_URL}" && tar xzf ds005_downsampled.tar.gz -C $HOME/data/; fi
    - if [[ ! -d $HOME/data/ds054 ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ds054_downsampled.tar.gz "${DS054_URL}" && tar xzf ds054_downsampled.tar.gz -C $HOME/data/; fi

  override:
    - if [[ -e $HOME/docker/image.tar ]]; then docker load -i $HOME/docker/image.tar; fi
    - docker build -t poldracklab/fmriprep:latest .
    - mkdir -p $HOME/docker; docker save poldracklab/fmriprep:latest > $HOME/docker/image.tar
test:
  override:
    - docker run -ti --rm --entrypoint="/usr/bin/run_unittests" poldracklab/fmriprep:latest
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v $HOME/data:/data:ro -v ~/.cache/stanford-crn:/root/.cache/stanford-crn -v $HOME/ds054/out:/out -w /scratch poldracklab/fmriprep:latest /data/ds054 /out/ participant -w work/ -t ds054 --debug :
        timeout: 4800
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v $HOME/data:/data:ro -v ~/.cache/stanford-crn:/root/.cache/stanford-crn -v $HOME/ds005/out:/out -w /scratch poldracklab/fmriprep:latest /data/ds005 /out/ participant -w work/ -t ds005 --debug :
        timeout: 4800

general:
  artifacts:
    - "~/ds054/out"
    - "~/ds005/out"

deployment:
  hub:
    branch: master
    commands:
      - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker push poldracklab/fmriprep:latest; fi :
          timeout: 21600
      - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker tag poldracklab/fmriprep poldracklab/fmriprep:V$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} && docker push poldracklab/fmriprep:V$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6}; fi :
          timeout: 21600<commit_msg>cache scratch directories<commit_after>machine:
  environment:
    OSF_PROJECT: "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage"
    DS005_URL: "${OSF_PROJECT}/57f32a429ad5a101f977eb75"
    DS054_URL: "${OSF_PROJECT}/57f32c22594d9001ef91bf9e"
  services:
    - docker

dependencies:
  cache_directories:
    - "~/data"
    - "~/docker"

  pre:
    - mkdir -p $HOME/data
    - mkdir -p $HOME/docker
    - mkdir -p $HOME/ds005/out $HOME/ds054/out $HOME/ds005/scratch $HOME/ds054/scratch
    # Download test data
    - if [[ ! -d $HOME/data/ds005 ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ds005_downsampled.tar.gz "${DS005_URL}" && tar xzf ds005_downsampled.tar.gz -C $HOME/data/; fi
    - if [[ ! -d $HOME/data/ds054 ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ds054_downsampled.tar.gz "${DS054_URL}" && tar xzf ds054_downsampled.tar.gz -C $HOME/data/; fi

  override:
    - if [[ -e $HOME/docker/image.tar ]]; then docker load -i $HOME/docker/image.tar; fi
    - docker build -t poldracklab/fmriprep:latest .
    - mkdir -p $HOME/docker; docker save poldracklab/fmriprep:latest > $HOME/docker/image.tar
test:
  override:
    - docker run -ti --rm --entrypoint="/usr/bin/run_unittests" poldracklab/fmriprep:latest
    - docker run -ti --rm -v /etc/localtime:/etc/localtime:ro -v $HOME/data:/data:ro -v $HOME/ds054/scratch:/scratch -v $HOME/ds054/out:/out -w /scratch poldracklab/fmriprep:latest /data/ds054 /out/ participant -w work/ -t ds054 --debug :
        timeout: 4800
    - docker run -ti --rm -v /etc/localtime:/etc/localtime:ro -v $HOME/data:/data:ro -v $HOME/ds005/scratch:/scratch -v $HOME/ds005/out:/out -w /scratch poldracklab/fmriprep:latest /data/ds005 /out/ participant -w work/ -t ds005 --debug :
        timeout: 4800

general:
  artifacts:
    - "~/ds054/out"
    - "~/ds054/scratch"
    - "~/ds005/out"
    - "~/ds005/scratch"

deployment:
  hub:
    branch: master
    commands:
      - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker push poldracklab/fmriprep:latest; fi :
          timeout: 21600
      - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker tag poldracklab/fmriprep poldracklab/fmriprep:V$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} && docker push poldracklab/fmriprep:V$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6}; fi :
          timeout: 21600
{'fraction_non_alphanumeric': 0.15800162469536963, 'fraction_numerical': 0.05645816409423233, 'mean_word_length': 3.0368852459016393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5055935', 'n_tokens_mistral': 2202, 'n_tokens_neox': 1937, 'n_words': 400}