Skip to content
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

Python runtime and package updates #167

Closed
wants to merge 2 commits into from
Closed
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
30 changes: 21 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,45 @@ env:

jobs:
unit-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
python-version: ['3.10']

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

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8.16
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: './requirements/dev.txt'

- name: Install libraries
run: pip install -r requirements/dev.txt

- name: Run tests
run: tox
run: tox -e py

lint-check:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
python-version: ['3.10']

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

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8.16
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: './requirements/dev.txt'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ outfile.txt
.cdk.staging
cdk.out
cdk.context.json
node_modules
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

### Changed

- bumped python runtime from 3.8 to 3.10
- updated package versions for requests, urllib3, certifi and idna

## [4.2.4 - 2024-08-02]

### Changed
Expand Down
6 changes: 3 additions & 3 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: 0.2
phases:
install:
runtime-versions:
python: 3.8
python: 3.10
pre_build:
commands:
- python -m virtualenv venv
- source venv/bin/activate
- python -m venv venv
- . venv/bin/activate
- pip install -U pip pip-tools
- pip-sync requirements/dev.txt
- invoke test
Expand Down
2 changes: 1 addition & 1 deletion cdk/codebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
clone_depth=1,
),
environment=codebuild.BuildEnvironment(
build_image=codebuild.LinuxBuildImage.AMAZON_LINUX_2_2,
build_image=codebuild.LinuxBuildImage.STANDARD_5_0,
compute_type=codebuild.ComputeType.LARGE,
),
artifacts=codebuild.Artifacts.s3(
Expand Down
2 changes: 1 addition & 1 deletion cdk/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(

function_props = {
"function_name": f"{self.stack_name}-{name}",
"runtime": aws_lambda.Runtime.PYTHON_3_8,
"runtime": aws_lambda.Runtime.PYTHON_3_10,
"code": aws_lambda.Code.from_bucket(
bucket=lambda_code_bucket, key=f"{self.stack_name}/{name}.zip"
),
Expand Down
1 change: 1 addition & 0 deletions function_requirements/common-requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
boto3
aws-lambda-logging
requests
urllib3>2
tenacity
PyJWT
pytz
Expand Down
62 changes: 31 additions & 31 deletions function_requirements/common-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,91 +6,91 @@
#
aws-lambda-logging==0.1.1
# via -r function_requirements/common-requirements.in
boto3==1.26.142
boto3==1.35.76
# via -r function_requirements/common-requirements.in
botocore==1.29.142
botocore==1.35.76
# via
# boto3
# s3transfer
cachetools==5.3.0
cachetools==5.5.0
# via google-auth
certifi==2023.5.7
certifi==2024.8.30
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.4.0
# via requests
google-api-core==2.11.0
google-api-core==2.23.0
# via google-api-python-client
google-api-python-client==2.87.0
google-api-python-client==2.154.0
# via -r function_requirements/common-requirements.in
google-auth==2.19.0
google-auth==2.36.0
# via
# -r function_requirements/common-requirements.in
# google-api-core
# google-api-python-client
# google-auth-httplib2
# google-auth-oauthlib
google-auth-httplib2==0.1.0
google-auth-httplib2==0.2.0
# via google-api-python-client
google-auth-oauthlib==1.0.0
google-auth-oauthlib==1.2.1
# via -r function_requirements/common-requirements.in
googleapis-common-protos==1.59.0
googleapis-common-protos==1.66.0
# via google-api-core
httplib2==0.22.0
# via
# google-api-python-client
# google-auth-httplib2
idna==3.4
idna==3.10
# via requests
jmespath==1.0.1
# via
# boto3
# botocore
oauthlib==3.2.2
# via requests-oauthlib
protobuf==4.23.2
proto-plus==1.25.0
# via google-api-core
protobuf==5.29.1
# via
# google-api-core
# googleapis-common-protos
pyasn1==0.5.0
# proto-plus
pyasn1==0.6.1
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.3.0
pyasn1-modules==0.4.1
# via google-auth
pyjwt==2.7.0
pyjwt==2.10.1
# via -r function_requirements/common-requirements.in
pyparsing==3.0.9
pyparsing==3.2.0
# via httplib2
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via botocore
python-dotenv==1.0.0
python-dotenv==1.0.1
# via -r function_requirements/common-requirements.in
pytz==2023.3
pytz==2024.2
# via -r function_requirements/common-requirements.in
requests==2.31.0
requests==2.32.3
# via
# -r function_requirements/common-requirements.in
# google-api-core
# requests-oauthlib
requests-oauthlib==1.3.1
requests-oauthlib==2.0.0
# via google-auth-oauthlib
rsa==4.7.2
# via
# -r function_requirements/common-requirements.in
# google-auth
s3transfer==0.6.1
s3transfer==0.10.4
# via boto3
six==1.16.0
# via
# google-auth
# google-auth-httplib2
# python-dateutil
tenacity==8.5.0
six==1.17.0
# via python-dateutil
tenacity==9.0.0
# via -r function_requirements/common-requirements.in
uritemplate==4.1.1
# via google-api-python-client
urllib3==1.26.16
urllib3==2.2.3
# via
# -r function_requirements/common-requirements.in
# botocore
# google-auth
# requests
4 changes: 3 additions & 1 deletion functions/utils/recording_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,6 @@ def from_utc_to_timestamp(date_str):


def from_timestamp_to_utc(ts):
return datetime.strftime(datetime.utcfromtimestamp(ts), TIMESTAMP_FORMAT)
return datetime.strftime(
datetime.utcfromtimestamp(int(ts)), TIMESTAMP_FORMAT
)
6 changes: 3 additions & 3 deletions functions/utils/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def set_pipeline_status(
"OR pipeline_state = :recording_stopped "
)
elif state in ZoomStatus:
expression_attribute_values[
":recording_processing"
] = ZoomStatus.RECORDING_PROCESSING.name
expression_attribute_values[":recording_processing"] = (
ZoomStatus.RECORDING_PROCESSING.name
)

# Enforce cannot transition back to a recording in progress state
# from recording processing
Expand Down
3 changes: 2 additions & 1 deletion functions/zoom-uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def oc_api_request(method, endpoint, **kwargs):
logger.info({"url": url, "kwargs": kwargs})
try:
resp = session.request(method, url, **kwargs)
except requests.RequestException:
except requests.RequestException as e:
logger.exception(f"requests raised an exception: {e}")
raise OpencastConnectionError
resp.raise_for_status()
return resp
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ boto3
botocore
requests
tabulate
aws-cdk-lib
aws-cdk-lib==2.81.0
constructs
tenacity
pyyaml!=6.0.0,!=5.4.0,!=5.4.1, # pyyaml later versions are broken with cython 3
Expand Down
Loading
Loading