-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into remove_py37
- Loading branch information
Showing
21 changed files
with
412 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
ARG IMAGE_ARCH | ||
FROM public.ecr.aws/lambda/dotnet:8-$IMAGE_ARCH | ||
|
||
RUN dnf remove -y microdnf-dnf && \ | ||
microdnf install -y dnf | ||
|
||
RUN dnf groupinstall -y development && \ | ||
dnf install -y --allowerasing \ | ||
tar \ | ||
gzip \ | ||
unzip \ | ||
python3 \ | ||
jq \ | ||
grep \ | ||
curl \ | ||
make \ | ||
rsync \ | ||
binutils \ | ||
gcc-c++ \ | ||
procps \ | ||
libmpc-devel \ | ||
gmp-devel \ | ||
zlib-devel \ | ||
python3-devel \ | ||
clang krb5-devel \ | ||
openssl-devel \ | ||
llvm \ | ||
libicu \ | ||
tzdata \ | ||
&& dnf clean all | ||
|
||
# Install AWS CLI | ||
ARG AWS_CLI_ARCH | ||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$AWS_CLI_ARCH.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws | ||
|
||
# Install SAM CLI from native installer | ||
ARG SAM_CLI_VERSION | ||
# need to redefine since ARG is not available after FROM tag: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact | ||
ARG IMAGE_ARCH | ||
RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v$SAM_CLI_VERSION/aws-sam-cli-linux-$IMAGE_ARCH.zip" -o "samcli.zip" && \ | ||
unzip samcli.zip -d sam-installation && ./sam-installation/install && \ | ||
rm samcli.zip && rm -rf sam-installation && sam --version | ||
|
||
# Prepare virtualenv for lambda builders | ||
RUN python3 -m venv --without-pip /usr/local/opt/lambda-builders | ||
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
RUN /usr/local/opt/lambda-builders/bin/python3 get-pip.py | ||
# Install lambda builders in a dedicated Python virtualenv | ||
RUN AWS_LB_VERSION=$(curl -sSL https://raw.githubusercontent.com/aws/aws-sam-cli/v$SAM_CLI_VERSION/requirements/base.txt | grep aws_lambda_builders | cut -d= -f3) && \ | ||
/usr/local/opt/lambda-builders/bin/pip3 --no-cache-dir install "aws-lambda-builders==$AWS_LB_VERSION" | ||
|
||
ENV PATH=$PATH:/usr/local/opt/lambda-builders/bin | ||
|
||
ENV LANG=en_US.UTF-8 | ||
|
||
# Wheel is required by SAM CLI to build libraries like cryptography. It needs to be installed in the system | ||
# Python for it to be picked up during `sam build` | ||
RUN pip3 install wheel | ||
|
||
# Set up .NET root | ||
|
||
ENV DOTNET_ROOT=/var/lang/bin | ||
|
||
# Install .NET build tools | ||
|
||
ENV AWS_EXECUTION_ENV=AWS_Lambda_dotnet8 \ | ||
DOTNET_CLI_TELEMETRY_OPTOUT=1 \ | ||
DOTNET_NOLOGO=1 \ | ||
NUGET_XMLDOC_MODE=skip | ||
|
||
# Warm up the nuget cache once now for faster startup on each use. | ||
RUN curl -L https://dot.net/v1/dotnet-install.sh | bash -s -- -c 8.0 -i "${DOTNET_ROOT}" && \ | ||
mkdir /tmp/warmup && \ | ||
cd /tmp/warmup && \ | ||
dotnet new > /dev/null && \ | ||
cd / && \ | ||
rm -rf /tmp/warmup /tmp/NuGetScratch /tmp/.dotnet | ||
|
||
# Now we do something tricky. Installing Amazon.Lambda.Tools here as a --global tool will | ||
# make it impossible to upgrade – either directly or by running `sam build`. Not so great. | ||
# But .NET tools *can* obey the path. By installing the Lambda tools to the .NET root and | ||
# putting the Global Tools install directory ahead of it in the path, we enable this: | ||
# | ||
# - `dotnet lambda` works out of the box because it's found on the path at the .NET root. | ||
# - Installing or upgrading Amazon.Lambda.Tools as a global tool succeeds because it will | ||
# write to the same layer. No cross-mount writes. | ||
# - Running `dotnet lambda` after installing or upgrading (either directly or via running | ||
# `sam build`) will pick up the newly installed, globally installed version of the tool. | ||
ENV PATH=~/.dotnet/tools:$PATH | ||
|
||
# We're using the -v diag argument to output extra logs because in the past we've seen intermittent failures | ||
# and want to be able to better understand them if they happen again | ||
RUN dotnet tool install --tool-path "${DOTNET_ROOT}" Amazon.Lambda.Tools -v diag | ||
|
||
COPY ATTRIBUTION.txt / | ||
|
||
# Runtime environment variables need to be defined after installation of all dotnet tools. | ||
# These variables define the tmp home directory for .NET CLI and the migration directory for NuGet in container. | ||
# .NET `sam build` requires tmp diretories being set for current user because it runs docker | ||
# as current/non-root user (unless current user is root) on posix systems. | ||
# That user will make/own these directory in container during the runtime. | ||
# They work the same as using docker arguments `-e DOTNET_CLI_HOME=/tmp/dotnet XDG_DATA_HOME=/tmp/xdg` | ||
ENV DOTNET_CLI_HOME=/tmp/dotnet | ||
ENV XDG_DATA_HOME=/tmp/xdg | ||
|
||
# Compatible with initial base image | ||
ENTRYPOINT [] | ||
CMD ["/bin/bash"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ pylint~=2.6.0 | |
urllib3<2 | ||
|
||
# Test requirements | ||
pytest==6.1.1 | ||
pytest==7.3.1 | ||
|
||
# formatter | ||
black==20.8b1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
# Created by https://www.toptal.com/developers/gitignore/api/osx,linux,windows,dotnetcore | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=osx,linux,windows,dotnetcore | ||
|
||
### DotnetCore ### | ||
# .NET Core build folders | ||
bin/ | ||
obj/ | ||
|
||
# Common node modules locations | ||
/node_modules | ||
/wwwroot/node_modules | ||
|
||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### OSX ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/osx,linux,windows,dotnetcore |
Oops, something went wrong.