-
Notifications
You must be signed in to change notification settings - Fork 0
Add Team Alerts module #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d92093a
add alerts module, import module and update vars wip
mwirikia c310d0b
update ci yml and dockerfile dependencies wip
mwirikia 9dc5052
add module tag and multistage Dockerfile build wip
mwirikia f263e28
add GH token to build wip
mwirikia a91b2aa
no poetry needed wip
mwirikia ccb464f
add GH to ci.yml wip
mwirikia 2d85abf
update build image sh to use GH token wip
mwirikia 48d8e5c
update Dockerfile wip
mwirikia 73790c3
update module name wip
mwirikia 1bc2afe
test alert on user login works wip
mwirikia 1f691a7
test alert wip
mwirikia 0fc80be
update var wip
mwirikia 44e6deb
update syspath for python builder
mwirikia 51f126f
update req wip
mwirikia 4ff7011
missing keyword wip
mwirikia 4acf36a
update iam role wip
mwirikia 7baa1cb
test alert from TATAPI wip
mwirikia 0569f66
test alert wip
mwirikia d247fef
get env in app wip
mwirikia 81b51f5
add aws acc name var
mwirikia 077b2d3
Refactor Dockerfile and enhance error handling in resources and utils…
mwirikia e232193
Refactor API response serialization and enhance testing setup; add Te…
mwirikia d579b1a
Update documentation and improve API responses; enhance testing setup…
mwirikia 486fb20
Merge branch 'main' into keh-1823_add_teams_alert
mwirikia a665e4e
Enhance Teams alert integration and error handling; update documentat…
mwirikia 6edf943
Add GitHub authentication configuration for git dependencies in CI wo…
mwirikia ef92a22
Update CI workflow to install Poetry 2.3.2 and configure system git c…
mwirikia 7377e90
Update content hash in poetry.lock for dependency resolution
mwirikia 4b0518c
Refactor CI workflow to remove private alert dependency and streamlin…
mwirikia eff6440
Potential fix for pull request finding
mwirikia f159340
Refactor CI workflow to remove private alert dependency and update de…
mwirikia 3569c8c
Add aws_account_name variable for Lambda runtime and update documenta…
mwirikia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,23 +1,40 @@ | ||
| # Use an official Python runtime as a parent image | ||
| FROM python:3.12-slim AS builder | ||
| WORKDIR /build | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends git \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN python -m venv /opt/venv | ||
| ENV PATH="/opt/venv/bin:$PATH" | ||
|
|
||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel | ||
| # Github token needed to install Github private dependencies, then token deleted. | ||
| RUN --mount=type=secret,id=github_token \ | ||
| set -e; \ | ||
| if [ -f /run/secrets/github_token ]; then \ | ||
| GITHUB_TOKEN="$(cat /run/secrets/github_token)"; \ | ||
| git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"; \ | ||
| fi; \ | ||
| pip install --no-cache-dir -r requirements.txt; \ | ||
| rm -f /root/.gitconfig 2>/dev/null || true | ||
|
|
||
| # Stage 2: runtime (Lambda base) | ||
| FROM public.ecr.aws/lambda/python:3.12 | ||
| # Set the working directory in the container | ||
| WORKDIR /var/task | ||
| # Upgrade tooling and awslambdaric | ||
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ | ||
| pip install --no-cache-dir --upgrade awslambdaric | ||
| # Create a non-root user and group manually | ||
| RUN mkdir -p /home/appuser && \ | ||
| chown -R 1000:1000 /home/appuser | ||
| # Copy the requirements.txt first to leverage Docker's cache for dependencies | ||
| COPY requirements.txt . | ||
| # Install the dependencies | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
| # Copy the app folder (with your Flask app) and the lambda_handler.py | ||
|
|
||
| # Copy dependencies into /var/task so Lambda always imports them | ||
| COPY --from=builder /opt/venv/lib/python3.12/site-packages/ /var/task/ | ||
|
|
||
| # Ensure /var/task is on sys.path | ||
| ENV PYTHONPATH="/var/task:${PYTHONPATH}" | ||
|
|
||
| COPY app/ /var/task/app/ | ||
| COPY main.py /var/task/ | ||
|
|
||
| # Change ownership of the application files to the non-root user | ||
| RUN chown -R 1000:1000 /var/task | ||
| # Switch to non-root user | ||
| USER 1000 | ||
| # The CMD specifies the handler to use in AWS Lambda | ||
|
|
||
| CMD ["main.lambda_handler"] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.