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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prod-staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: SearchAPI Integration Deployment and Testing Suite
name: SearchAPI Prod-Staging Integration Deployment and Testing Suite
permissions:
contents: read
on:
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/deploy-test-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: SearchAPI Test-Staging Integration Deployment and Testing Suite
permissions:
contents: read
on:
push:
branches:
- dev

jobs:
# Deploy Staging
deploy-edc-test-staging:
runs-on: ubuntu-latest
environment: edc-test
permissions:
id-token: write
contents: read

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

- name: build
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
vpc-id: ${{ secrets.VPC_ID }}
subnet-ids: ${{ secrets.SUBNET_IDS }}
security-group: ${{ secrets.SECURITY_GROUP }}
staging: true

run-edc-test-staging-integration-tests:
needs: [deploy-edc-test-staging]
runs-on: ubuntu-latest
environment: edc-test
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS OIDC credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SearchAPIActionsOIDCRole
aws-region: us-west-2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
python -m pip install .

- name: run tests
shell: bash
run: |
pytest tests/integration/test_stack.py \
--reruns 3 --reruns-delay 10

deploy-test-staging:
runs-on: ubuntu-latest
environment: test
permissions:
id-token: write
contents: read

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

- name: build
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
staging: true

run-test-staging-integration-tests:
needs: [deploy-test-staging]
runs-on: ubuntu-latest
environment: test
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS OIDC credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SearchAPIActionsOIDCRole
aws-region: us-west-2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
python -m pip install .

- name: run tests
shell: bash
run: |
pytest tests/integration/test_stack.py \
--reruns 3 --reruns-delay 10
109 changes: 0 additions & 109 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,112 +51,3 @@ jobs:
flags: unittests
name: asf_admin searchAPI-v3 pytest
verbose: true

# Deploy Staging
deploy-edc-test-staging:
needs: [run-tests]
runs-on: ubuntu-latest
environment: edc-test
permissions:
id-token: write
contents: read

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

- name: build
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
vpc-id: ${{ secrets.VPC_ID }}
subnet-ids: ${{ secrets.SUBNET_IDS }}
security-group: ${{ secrets.SECURITY_GROUP }}
staging: true

run-tests-edc-staging:
needs: [deploy-edc-test-staging]
runs-on: ubuntu-latest
environment: edc-test
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS OIDC credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SearchAPIActionsOIDCRole
aws-region: us-west-2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
python -m pip install .

- name: run tests
shell: bash
run: |
pytest tests/integration/test_stack.py \
--reruns 3 --reruns-delay 10

deploy-test-staging:
needs: [run-tests]
runs-on: ubuntu-latest
environment: test
permissions:
id-token: write
contents: read

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

- name: build
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
staging: true

run-tests-staging:
needs: [deploy-test-staging]
runs-on: ubuntu-latest
environment: test
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS OIDC credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SearchAPIActionsOIDCRole
aws-region: us-west-2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
python -m pip install .

- name: run tests
shell: bash
run: |
pytest tests/integration/test_stack.py \
--reruns 3 --reruns-delay 10
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

-->
------
## [1.0.1](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.0...v1.0.1)

### Added
- Add dedicated dev branch for test-staging deployment
- Intended Dev->Release workflow
- dev -> test -> prod-staging -> prod

### Changed
- pin `asf-search` to v8.2.3, All basic Vertex dataset searches working

## [1.0.0](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v0.1.0...v1.0.0)

### Added
Expand Down
26 changes: 25 additions & 1 deletion cdk/cdk/cdk_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def __init__(self, scope: Construct, construct_id: str, staging: bool = False, *
**lambda_vpc_kwargs,
)

staging
api_id = f'SearchAPI-V3{"-Staging" if staging else ""}-RestAPI'
api = apigateway.LambdaRestApi(
self,
Expand All @@ -74,6 +73,31 @@ def __init__(self, scope: Construct, construct_id: str, staging: bool = False, *
default_cors_preflight_options=apigateway.CorsOptions(
allow_origins=apigateway.Cors.ALL_ORIGINS, allow_methods=apigateway.Cors.ALL_METHODS
),
# deploy_options=apigateway.StageOptions(
# access_log_destination=apigateway.LogGroupLogDestination(
# logs.LogGroup(
# self,
# f'{api_id}-LogGroup',
# retention=logs.RetentionDays.THREE_MONTHS,
# )
# ), # type: ignore
# access_log_format=apigateway.AccessLogFormat.custom(
# json.dumps(
# {
# 'sourceIp': '$context.identity.sourceIp',
# 'httpMethod': '$context.httpMethod',
# 'path': '$context.path',
# 'status': '$context.status',
# 'responseLength': '$context.responseLength',
# 'responseLatency': '$context.responseLatency',
# 'requestTime': '$context.requestTime',
# 'protocol': '$context.protocol',
# 'userAgent': '$context.identity.userAgent',
# 'requestId': '$context.requestId',
# }
# )
# ),
# ),
**apigateway_kwargs,
# endpoint_configuration=apigateway.EndpointConfiguration(
# # https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointConfiguration.html
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ujson==5.7.0
uvicorn==0.21.1
watchfiles==0.19.0

asf_search==8.1.4
asf_search==8.2.3
python-json-logger==2.0.7

pyshp
Expand Down
2 changes: 1 addition & 1 deletion src/SearchAPI/application/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ def get_logger(name: str, level: int=logging.DEBUG) -> logging.Logger:
return logger


api_logger = get_logger(__name__, logging.DEBUG)
api_logger = get_logger(__name__, logging.INFO)