Skip to content

Commit

Permalink
Upgrade annoy, force a CPU architecture to avoid unavailable extensions
Browse files Browse the repository at this point in the history
On github actions, sometimes we compile on a machine that has avx512
available, but this isn't available on our prod machines. Force
something lower.
  • Loading branch information
alastair committed Jul 26, 2021
1 parent 6d80291 commit 995766a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ RUN chown acousticbrainz:acousticbrainz /code
# Last version of pip that supports python2
RUN pip install pip==20.3.4

# By default annoy compiles its C++ code using gcc's -march=native flag. This means that if it compiles
# on a recent Intel machine (e.g. in github actions) it might use extensions that aren't available
# on our production machines (AVX512). Force it to a lower arch that is compatible over all of our
# productions servers (skylake, zen1, zen2)
ENV ANNOY_COMPILER_ARGS=-D_CRT_SECURE_NO_WARNINGS,-DANNOYLIB_MULTITHREADED_BUILD,-march=haswell,-mno-rdrnd,-O3,-ffast-math,-fno-associative-math,-std=c++14

# Python dependencies
RUN mkdir /code/docs/ && chown acousticbrainz:acousticbrainz /code/docs/
COPY --chown=acousticbrainz:acousticbrainz docs/requirements.txt /code/docs/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
git+https://github.com/metabrainz/[email protected]
annoy==1.16.0
annoy==1.17.0
Flask-Admin==1.5.6
Flask-Login==0.5.0
Flask-SQLAlchemy==2.4.1
Expand Down

0 comments on commit 995766a

Please sign in to comment.