I am running a Flask app that needs to load a ~15 mb dataset to do geocoding. This has worked well for ages – specifying in config.yml to run a shell script that downloads it to a vendor
directory, and then caches it with save_cache
. As of yesterday, this stopped working, throwing the error:
IOError: [Errno 2] No such file or directory: 'vendor/GeoLiteCity.dat'
Exited with code 1
This was working fine a month ago, then stopped working yesterday, with no substantive changes to the code, and no changes to config.yml. The URL for curl works fine (at least when I test on my dev machine), and the tests all still work when I run them locally, so something is going wrong with the download, caching, or the coordination of paths. Did anything change in the way that config.yml / paths get interpreted? Or is it possible that this is a downstream error generated by another issue?
Here’s my config.yml. Test.py loads the Flask app and then hits all of the endpoints with requests:
version: 2
jobs:
build:
docker:
- image: circleci/python:2.7-jessie-browsers
steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
- restore_cache:
keys:
- vendor
- run:
name: Install Python deps in a venv
command: |
python -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- run:
name: Get the PEM
command: echo -e $APNS_PEM_CONTENTS > pushcert.pem
- run:
name: Get the Firebase Token
command: echo $FIREBASE_JSON > $FIREBASE_AUTH_TOKEN_PATH
- run:
name: change permissions on geoLite download script
command: chmod +x getGeoLite.sh
- run:
name: download GeoLite geocoding database
command: ./getGeoLite.sh
- save_cache:
key: vendor
paths:
- vendor
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "venv"
- run:
command: |
source venv/bin/activate
python test.py