revert back to x86

This commit is contained in:
Khalim Conn-Kowlessar 2023-08-24 20:12:37 +01:00
parent 0883dd6c37
commit 33a6587e70
2 changed files with 4 additions and 16 deletions

View file

@ -3,7 +3,7 @@
# https://python-mip.readthedocs.io/en/latest/install.html
# Pull base image
FROM arm64v8/python:3.10.12-slim-bullseye as build-image
FROM arm64v8/python:3.10.12-slim-buster as build-image
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
@ -13,14 +13,7 @@ ENV PYTHONUNBUFFERED 1
WORKDIR /var/task/Model
# Install system dependencies
RUN apt-get update && apt-get install -y make gcc g++ gfortran libgfortran-9-dev liblapack-dev libamd2 libcholmod3 \
libmetis-dev libsuitesparse-dev libnauty2-dev git wget pkgconf
# Compile CBC for arm64
RUN mkdir -p ~/build && cd ~/build \
&& wget -nH https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew \
&& bash coinbrew fetch Cbc@master --no-prompt \
&& bash coinbrew build Cbc@master --no-prompt --prefix=/home/root/prog/ --tests=none --enable-cbc-parallel --enable-relocatable
# RUN apt-get update && apt-get install -y netcat-openbsd
# Install python dependencies
COPY ./backend/requirements/base.txt ./backend/requirements/base.txt
@ -31,18 +24,13 @@ RUN pip install --upgrade pip \
RUN pip install awslambdaric
# Second stage: "runtime-image"
FROM arm64v8/python:3.10.12-slim-bullseye
FROM arm64v8/python:3.10.12-slim-buster
# Set work directory to the root of your project
WORKDIR /var/task/Model
# Copy the python dependencies from the build-image
COPY --from=build-image /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
COPY --from=build-image /home/root/prog/lib/ /usr/local/lib/
# Set environment variable for mip to use custom CBC binaries
ENV PMIP_CBC_LIBRARY="/usr/local/lib/libCbcSolver.so"
ENV LD_LIBRARY_PATH="/usr/local/lib/":$LD_LIBRARY_PATH
# Copy project files
COPY ./backend/ ./backend

View file

@ -3,7 +3,7 @@ service: fastapi-lambda
provider:
name: aws
region: eu-west-2
architecture: arm64
architecture: x86_64
environment:
API_KEY: ${env:API_KEY}
ENVIRONMENT: ${env:ENVIRONMENT}