Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/deploy-worker-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ env:
ECR_REPOSITORY: r-notebook-worker

concurrency:
group: deploy-worker-ecr-main
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref_name }}
cancel-in-progress: true

jobs:
deploy-worker:
name: Build and Push Worker Image
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/e2e-notebook-deploy-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ env:
TERRAFORM_ENV_DIR: ${{ secrets.TERRAFORM_ENV_DIR }}

concurrency:
group: terraform-batch-dev-state
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref_name }}
cancel-in-progress: false

jobs:
deploy-and-run-e2e:
name: Terraform Deploy + Notebook E2E
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest

Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/lambda-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lambda Unit Tests
# Runs Python unit tests for backend lambdas.

on:
push:
branches:
- main
paths:
- "lifewatch_batch_platform/terraform/backend_lambdas/**"
- ".github/workflows/lambda-unit-tests.yml"
pull_request:
paths:
- "lifewatch_batch_platform/terraform/backend_lambdas/**"
- ".github/workflows/lambda-unit-tests.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-lambda-handlers:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Run Lambda Unit Tests
run: |
python -m unittest discover \
-s lifewatch_batch_platform/terraform/backend_lambdas/tests \
-p "test_*.py" \
-v
7 changes: 7 additions & 0 deletions .github/workflows/smoke-test-worker-containerization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Smoke Test Worker Containerization
# This workflow builds the worker and runs a smoke test to verify that the containerization is working correctly.

on:
push:
branches:
- main
pull_request:
paths:
- "worker/**"
Expand All @@ -11,6 +14,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify-worker-pod:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Terraform CI"

on:
push:
branches:
- main
paths:
- 'lifewatch_batch_platform/terraform/**'
- '.github/workflows/test-terraform-plan.yml'
Expand All @@ -10,8 +12,8 @@ on:
- 'lifewatch_batch_platform/terraform/**'
- '.github/workflows/test-terraform-plan.yml'
concurrency:
group: terraform-batch-dev-state
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ terraform.rc
/server/staticfiles
/server/jobs/tests/__pycache__
*.pyc
server/zappa_settings.json
server/zappa_settings.json
/.env
2 changes: 1 addition & 1 deletion compress_lambdas.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$SourceDir = ".\lifewatch_batch_platform\terraform\backend_lamdas"
$SourceDir = ".\lifewatch_batch_platform\terraform\backend_lambdas"
$TargetDir = ".\lifewatch_batch_platform\terraform\backend_lambda_artifacts"

New-Item -ItemType Directory -Force -Path $TargetDir | Out-Null
Expand Down
2 changes: 1 addition & 1 deletion compress_lambdas.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SOURCE_DIR="./lifewatch_batch_platform/terraform/backend_lamdas"
SOURCE_DIR="./lifewatch_batch_platform/terraform/backend_lambdas"
TARGET_DIR="./lifewatch_batch_platform/terraform/backend_lambda_artifacts"

mkdir -p "$TARGET_DIR"
Expand Down
Loading
Loading