-
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.
Merge pull request #27 from guardrails-ai/lambda-to-fargate
Guardrails As A Service Latest State
- Loading branch information
Showing
64 changed files
with
1,864 additions
and
1,377 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
omit = | ||
# omit any struct classes bc they will go away soon | ||
src/classes/*_struct.py |
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 |
---|---|---|
|
@@ -6,4 +6,5 @@ tests | |
docker* | ||
Docker* | ||
*.sh | ||
!buildspecs/hub-install.sh | ||
ingestion-service-spec.yml |
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 @@ | ||
no_metrics=true |
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,48 @@ | ||
FROM public.ecr.aws/docker/library/python:3.11.6-slim | ||
|
||
ARG GITHUB_TOKEN | ||
ARG HF_TOKEN | ||
|
||
# COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.7.1 /lambda-adapter /opt/extensions/lambda-adapter | ||
# COPY ./opentelemetry-lambda-layer /opt | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# check the version | ||
RUN python3 --version | ||
# start the virtual environment | ||
RUN python3 -m venv /opt/venv | ||
|
||
# Enable venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# Install git and curl | ||
RUN apt-get update | ||
RUN apt-get install -y git curl gcc jq | ||
|
||
# Copy the requirements file | ||
COPY requirements*.txt . | ||
|
||
RUN curl https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem -o ./global-bundle.pem | ||
|
||
# Install app dependencies | ||
RUN pip install -r requirements-lock.txt | ||
|
||
# Download punkt data | ||
RUN python -m nltk.downloader -d /opt/nltk_data punkt | ||
|
||
COPY buildspecs/hub-install.sh ./buildspecs/hub-install.sh | ||
RUN chmod +x ./buildspecs/hub-install.sh | ||
RUN ./buildspecs/hub-install.sh | ||
|
||
# Freeze dependencies | ||
RUN pip freeze > requirements-lock.txt | ||
|
||
# Copy the whole folder inside the Image filesystem | ||
COPY . . | ||
|
||
EXPOSE 8000 | ||
|
||
CMD opentelemetry-instrument gunicorn --bind 0.0.0.0:8000 --timeout=90 --threads=10 "app:create_app()" | ||
# CMD gunicorn --forwarded-allow-ips="*" --bind 0.0.0.0:8000 --timeout=60 --threads=10 "app:create_app()" |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export IMAGE_NAME="graas-heavy" | ||
export ECR_REPO_NAME="guardrails-as-a-service-heavy-test" | ||
export DOCKERFILE="Dockerfile.heavy" | ||
|
||
bash buildspecs/build.sh |
Oops, something went wrong.