SDKキットで提供していたツール郡の一部がお客さま環境で動作しないとのご指摘がありました。
Staticコンパイルしていたつもりがそうなっていなくて一部共用ファイルを呼び出していたのが原因のようでした。私の環境は、Ubuntu20.04、お客さま環境は、Amazon Linux2です。
Staticコンパイルをトライしたのですが、上手く行かなかったので仕方なく、お客さま開発環境であるAmazon Linux2 環境下でコンパイルすることにしたバイナリを提供することにしました。以下、DockerによるAmazon Linux2環境構築、コンパイルのログです。
sudo service docker start
docker run -it amazonlinux:latest /bin/bash
cd home
mkdir sugatak
yum -y install make
yum -y install git
yum -y install gcc-c++
yum -y install nano
yum -y install zip
yum -y install clang
yum -y install libcurl-devel
yum -y install cmake3
cd sugatak
git clone https://github.com/awslabs/aws-lambda-cpp.git
cd aws-lambda-cpp
mkdir build
cd build
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
make install
yum -y install wget
yum -y install tar
Download Zlib by using the following command :
wget http://www.zlib.net/zlib-1.2.11.tar.gz
Extract the file from the downloaded package:
tar -xvzf zlib-1.2.11.tar.gz
Enter the directory where the package is extracted:
cd zlib-1.2.11
Now configure Zlib directory:
./configure
sudo make install
yum -y install openssl
cd ..
aws-sdk-cpp:
git clone https://github.com/aws/aws-sdk-cpp.git
cd aws-sdk-cpp
mkdir build
cd build
yum -y install openssl-devel
cmake3 .. -DBUILD_ONLY=dynamodb -DBUILD_SHARED_LIBS=OFF -DENABLE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=Release
make install
cmake3 .. -DBUILD_ONLY=lambda -DBUILD_SHARED_LIBS=OFF -DENABLE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=Release
make install
cd ..
cd ..
yum -y install unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
bash-4.2# aws configure
AWS Access Key ID [****************xxx]: xxx
AWS Secret Access Key [****************xxx]: xxx
Default region name [xxx]: xxx
Default output format [None]:
another terminal:
docker ps
docker export 569> amazon.tar
sugatak上で
curl "https://nurse-scheduling-software.com/sc3_engine/dec172020/linux/Projects.zip" -o "Projects.zip"
unzip Projects.zip
docker export 569> amazon2.tar
send_to_api_server/build/
cmake3 ..
make
./send_to_api_server us-east-1 SC_NURSE_TABLE nobody problem.json
ldd send_to_api_server
docker export 569> amazon3.tar
docker cp 09a735dae425:/tmp/greeting.txt .
curl "https://nurse-scheduling-software.com/sc3_engine/dec172020/linux/Projects/schedule_nurse_ver3/send_to_API_server/send_to_api_server" -o "send_to_api_server"