Skip to content

Commit b5be3ce

Browse files
authored
Release v4.4.2 into Main
2 parents b33b473 + c82654d commit b5be3ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1899
-972
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@
2727
"ppa": true,
2828
"version": "os-provided"
2929
},
30-
"ghcr.io/devcontainers-contrib/features/actions-runner:1": {
30+
"ghcr.io/devcontainers-extra/features/actions-runner:1": {
3131
"version": "latest",
3232
"dotnetVersion": "latest"
3333
},
34-
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
34+
"ghcr.io/devcontainers-extra/features/aws-cdk:2": {
3535
"version": "latest"
3636
},
37-
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
37+
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
3838
"version": "latest"
3939
},
40-
"ghcr.io/devcontainers-contrib/features/black:2": {
40+
"ghcr.io/devcontainers-extra/features/black:2": {
4141
"version": "latest"
4242
},
43-
"ghcr.io/devcontainers-contrib/features/flake8:2": {
43+
"ghcr.io/devcontainers-extra/features/flake8:2": {
4444
"version": "latest"
4545
},
46-
"ghcr.io/devcontainers-contrib/features/isort:2": {
46+
"ghcr.io/devcontainers-extra/features/isort:2": {
4747
"version": "latest"
4848
}
4949
},

.devcontainer/post_create_command.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ make createPythonEnvironment
1010
echo "source .venv/bin/activate" >> ~/.bashrc
1111
echo "source .venv/bin/activate" >> ~/.zshrc
1212

13+
echo "alias deploylisa='make clean && npm ci && make deploy HEADLESS=true'" >> ~/.bashrc
14+
echo "alias deploylisa='make clean && npm ci && make deploy HEADLESS=true'" >> ~/.zshrc
15+
1316
pip install --upgrade pip
1417
pip3 install yq huggingface_hub s5cmd
1518
make installPythonRequirements

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ __pycache__/
1414
.pytest_cache/
1515
*.key
1616
*.pem
17+
TIKTOKEN_CACHE
1718

1819
# CDK asset staging directory
1920
.cdk.staging

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ repos:
4545
hooks:
4646
- id: codespell
4747
entry: codespell
48-
args: ['--skip=*.git*,*cdk.out*,*venv*,*mypy_cache*,*package-lock*,*node_modules*,*dist/*,*poetry.lock*,*coverage*,*models/*,*htmlcov*', "-L=xdescribe"]
48+
args: ['--skip=*.git*,*cdk.out*,*venv*,*mypy_cache*,*package-lock*,*node_modules*,*dist/*,*poetry.lock*,*coverage*,*models/*,*htmlcov*,*TIKTOKEN_CACHE/*', "-L=xdescribe"]
4949
pass_filenames: false
5050

5151
- repo: https://github.com/pycqa/isort

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# v4.4.2
2+
## System Improvements
3+
- Updated configuration items to make ADC region deployments easier
4+
- Updated markdown rendering to properly display code blocks and unordered lists
5+
6+
## Security Enhancements
7+
- Enforce SSL access to EC2 docker bucket
8+
- Enable Access Logging with New Log Destination Bucket
9+
- Updated 3rd party dependencies
10+
11+
## Acknowledgements
12+
* @bedanley
13+
* @jmharold
14+
* @estohlmann
15+
* @dustins
16+
17+
**Full Changelog**: https://github.com/awslabs/LISA/compare/v4.4.1...v4.4.2
18+
119
# v4.4.1
220
## Bug Fixes
321
- Updated OpenSearch vector store creation to support private VPCs

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ define print_config
282282
endef
283283

284284
## Deploy all infrastructure
285-
deploy: dockerCheck dockerLogin cleanMisc modelCheck buildNpmModules
285+
deploy: installPythonRequirements dockerCheck dockerLogin cleanMisc modelCheck buildNpmModules
286286
$(call print_config)
287287
ifneq (,$(findstring true, $(HEADLESS)))
288288
npx cdk deploy ${STACK} $(if $(PROFILE),--profile ${PROFILE}) --require-approval never -c ${ENV}='$(shell echo '${${ENV}}')';
@@ -378,4 +378,4 @@ test-coverage:
378378
--cov-report term-missing \
379379
--cov-report html:build/coverage \
380380
--cov-report xml:build/coverage/coverage.xml \
381-
--cov-fail-under 33
381+
--cov-fail-under 42

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.4.1
1+
4.4.2

bin/copy-deps.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
function install_python_deps() {
4+
local input_path=$1
5+
local output_path=$2
6+
local package=$3
7+
8+
echo "Installing Python dependencies for $package"
9+
mkdir -p "${output_path}"
10+
if ! pip install -r ${input_path}/requirements.txt --target $output_path --platform manylinux2014_x86_64 --only-binary=:all: --no-deps --no-cache-dir; then
11+
echo "Failed to install Python dependencies for ${package}"
12+
exit 1
13+
fi
14+
15+
echo "${package} dependencies installed successfully"
16+
rsync -a "${input_path}/" "${output_path}"
17+
18+
echo "Optimizing ${package}"
19+
find $output_path -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
20+
find $output_path -type d -name "*.dist-info" -exec rm -rf {} + 2>/dev/null
21+
find $output_path -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null
22+
find $output_path -type f -name "*.pyc" -delete
23+
find $output_path -type f -name "*.pyo" -delete
24+
find $output_path -type f -name "*.so" -exec strip {} + 2>/dev/null
25+
}
26+
27+
function setup_python_dist(){
28+
cd dist
29+
30+
# Define the layers
31+
PYTHON_VERSION="3.11"
32+
DIST="."
33+
OUTPUT_DIR="python/lib/${PYTHON_VERSION}/site-packages"
34+
35+
# Create a virtual environment for isolation
36+
python -m venv .venv
37+
source .venv/bin/activate
38+
39+
# # Install dependencies for each lambda layer
40+
layers=("authorizer" "common" "fastapi")
41+
layers_path="../lib/core/layers"
42+
layers_output="${DIST}/lambdaLayer"
43+
for layer in "${layers[@]}"; do
44+
# ./package-lambda-layer --src="${layers_path}/${layer}" --build="./dist/$layer" --output="${layers_output}/${layer}"
45+
layer_path="${layers_path}/${layer}"
46+
layer_output="${layers_output}/${layer}/${OUTPUT_DIR}"
47+
install_python_deps $layer_path $layer_output $layer
48+
done
49+
50+
# Install rag layer
51+
rag_path="../lib/rag/layer"
52+
rag_output="${DIST}/rag/${OUTPUT_DIR}"
53+
rag_package="rag"
54+
install_python_deps $rag_path $rag_output $rag_package
55+
56+
# Install lisa-sdk dependencies
57+
sdk_path="../lisa-sdk"
58+
sdk_output="${DIST}/lisa-sdk/${OUTPUT_DIR}"
59+
sdk_package="lisa-sdk"
60+
install_python_deps $sdk_path $sdk_output $sdk_package
61+
62+
# Deactivate virtual environment
63+
deactivate
64+
rm -rf .venv
65+
echo "All Python dependencies installed successfully"
66+
cd -
67+
}
68+
69+
function copy_dist() {
70+
mkdir -p dist/ecs_model_deployer && rsync -av ecs_model_deployer/dist/ dist/ecs_model_deployer/ && cp ecs_model_deployer/Dockerfile dist/ecs_model_deployer/
71+
mkdir -p dist/vector_store_deployer && rsync -av vector_store_deployer/dist/ dist/vector_store_deployer/ && cp vector_store_deployer/Dockerfile dist/vector_store_deployer/
72+
mkdir -p dist/lisa-web && rsync -av lib/user-interface/react/dist/ dist/lisa-web
73+
mkdir -p dist/docs && rsync -av lib/docs/dist/ dist/docs
74+
cp VERSION dist/
75+
}
76+
77+
mkdir -p dist
78+
# setup_python_dist
79+
copy_dist

bin/package-lambda-layer

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SRC=src
5+
OUTPUT=Lambda.zip
6+
EXCLUDE_PACKAGES=""
7+
SRC_ROOT=$PWD
8+
BUILD_DIR=$SRC_ROOT/build
9+
10+
# Parse named parameters
11+
while [ $# -gt 0 ]; do
12+
case "$1" in
13+
--src=*)
14+
SRC="${1#*=}"
15+
;;
16+
--output=*)
17+
OUTPUT="${1#*=}"
18+
;;
19+
--build=*)
20+
BUILD_DIR="${1#*=}"
21+
;;
22+
--exclude=*)
23+
EXCLUDE_PACKAGES="${1#*=}"
24+
;;
25+
*)
26+
echo "Unknown parameter: $1"
27+
echo "Usage: $0 --src=<source_dir> --output=<output_file> --exclude=<packages>"
28+
exit 1
29+
;;
30+
esac
31+
shift
32+
done
33+
34+
install_requirements() {
35+
echo "installing requirements"
36+
rm -rf "$BUILD_DIR"
37+
mkdir -p "$BUILD_DIR/python"
38+
python3 -m pip install "$SRC_ROOT" --target "${BUILD_DIR}/python"
39+
}
40+
41+
42+
build_package() {
43+
echo "building package"
44+
if [ -d "$SRC" ]; then
45+
cp -r "$SRC"/* "${BUILD_DIR}/python/"
46+
fi
47+
}
48+
49+
copy_configuration() {
50+
echo "copying configuration"
51+
if [ -d "configuration/Packaging" ]; then
52+
cp -a configuration/Packaging "$BUILD_DIR"
53+
fi
54+
}
55+
56+
package_artifacts() {
57+
echo "packaging"
58+
if [ -n "$EXCLUDE_PACKAGES" ]; then
59+
echo "Removing excluded packages: $EXCLUDE_PACKAGES"
60+
for pkg in ${EXCLUDE_PACKAGES//,/ }; do
61+
echo "Removing $pkg"
62+
rm -rf ${BUILD_DIR}/python/${pkg}
63+
rm -rf ${BUILD_DIR}/python/${pkg}-*
64+
# Also remove egg-info directories
65+
find "${BUILD_DIR}/python" -type d -name "${pkg}*egg-info" -exec rm -rf {} +
66+
done
67+
fi
68+
69+
# AWS Lambda recommends to exclude __pycache__: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-pycache
70+
find "${BUILD_DIR}/python" -depth -name __pycache__ -exec rm -rf {} \;
71+
cd "${BUILD_DIR}"
72+
zip "${BUILD_DIR}/${OUTPUT}" ./python -r
73+
rm -rf "${BUILD_DIR}/python"
74+
}
75+
76+
install_requirements
77+
build_package
78+
copy_configuration
79+
package_artifacts

ecs_model_deployer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "node esbuild.js && npm run copy-assets && npm run pack:prod",
7+
"build": "node esbuild.js && npm run copy-assets && npm run pack:prod && npm run copy-dist",
88
"copy-assets": "cp package.json ./src/cdk*json ../VERSION ./dist",
99
"pack:prod": "cd ./dist && npm i --omit dev",
1010
"copy-dist": "mkdir -p ../dist/ecs_model_deployer && cp -r ./dist/* ../dist/ecs_model_deployer/",

0 commit comments

Comments
 (0)