-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* revert tig.py * restore pytest * update changelog
- Loading branch information
Showing
11 changed files
with
129 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ARG FUNCTION_DIR="/function" | ||
|
||
FROM public.ecr.aws/lambda/python:3.10-arm64 | ||
|
||
# Include global arg in this stage of the build | ||
ARG SOURCE | ||
|
||
RUN yum -q -y install gcc | ||
|
||
# Create function directory | ||
# RUN mkdir -p ${FUNCTION_DIR} | ||
# WORKDIR ${FUNCTION_DIR} | ||
|
||
# Install tig from artifactory | ||
COPY $DIST_PATH $DIST_PATH | ||
|
||
# install tig into working directory so we can call lambda | ||
RUN pip3 install awslambdaric --target $LAMBDA_TASK_ROOT | ||
|
||
RUN pip3 install --no-cache-dir --force --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ --target "${LAMBDA_TASK_ROOT}" $SOURCE | ||
|
||
RUN rm -rf $DIST_PATH | ||
|
||
ENTRYPOINT [] | ||
CMD ["podaac.lambda_handler.lambda_handler.handler"] |
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,44 @@ | ||
data "aws_ecr_authorization_token" "token" {} | ||
|
||
locals { | ||
lambda_container_image_uri_split = split("/", var.lambda_container_image_uri) | ||
ecr_image_name_and_tag = split(":", element(local.lambda_container_image_uri_split, length(local.lambda_container_image_uri_split) - 1)) | ||
ecr_image_name = "${local.environment}-${element(local.ecr_image_name_and_tag, 0)}" | ||
ecr_image_tag = element(local.ecr_image_name_and_tag, 1) | ||
} | ||
|
||
resource aws_ecr_repository "lambda-image-repo" { | ||
name = local.ecr_image_name | ||
tags = var.tags | ||
} | ||
|
||
|
||
resource null_resource ecr_login { | ||
triggers = { | ||
image_uri = var.lambda_container_image_uri | ||
} | ||
|
||
provisioner "local-exec" { | ||
interpreter = ["/bin/bash", "-e", "-c"] | ||
command = <<EOF | ||
docker login ${data.aws_ecr_authorization_token.token.proxy_endpoint} -u AWS -p ${data.aws_ecr_authorization_token.token.password} | ||
EOF | ||
} | ||
} | ||
|
||
|
||
resource null_resource upload_ecr_image { | ||
depends_on = [null_resource.ecr_login] | ||
triggers = { | ||
image_uri = var.lambda_container_image_uri | ||
} | ||
|
||
provisioner "local-exec" { | ||
interpreter = ["/bin/bash", "-e", "-c"] | ||
command = <<EOF | ||
docker pull ${var.lambda_container_image_uri} | ||
docker tag ${var.lambda_container_image_uri} ${aws_ecr_repository.lambda-image-repo.repository_url}:${local.ecr_image_tag} | ||
docker push ${aws_ecr_repository.lambda-image-repo.repository_url}:${local.ecr_image_tag} | ||
EOF | ||
} | ||
} |
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
Oops, something went wrong.