-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently deploying this app from MacOS doen't work, because we get this when deployed:
"/var/task/node_modules/leveldown/build/Release/leveldown.node: invalid ELF header",
This is because leveldown is build on Mac but deployed on Linux.
Adding this to serverless.xml should work but has stopped for some reason:
webpack:
includeModules: true
packagerOptions:
scripts:
- npm_config_platform=linux npm_config_arch=x64 yarn add leveldown
Currently I'm deploy via a docker build. This was non-trivial, but a few notes:
On the Mac, rm -rf node_modules to make sure we get rid of Mac versions
# run docker mapping the path things are checkout out at to a `/working` directory inside docker
docker run -v ~/dev/verida/network-data-api:/working -it --rm ubuntu
# Now we are in docker (Ubuntu)
apt update
apt install unzip nodejs npm curl
cd /root
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" # NOTE the ARM version is needed!
unzip awscliv2.zip
./aws/install
cd /working
nvm install # install and use the correct node version
nvm use
# add the AWS deployment keys
# most script now specify which profile to use
/usr/local/bin/aws configure --profile verida-original
/usr/local/bin/aws configure --profile verida-testnet
/usr/local/bin/aws configure --profile verida-mainnet
npm install --global yarn
yarn # do the build
yarn deploy-prod # deploy!
Metadata
Metadata
Assignees
Labels
No labels