Skip to content

Commit

Permalink
Merge pull request #447 from LACMTA:2023-api-optimization
Browse files Browse the repository at this point in the history
Refactor data-loading-service change detection and update models for route_stops_grouped
  • Loading branch information
albertkun authored Jan 25, 2024
2 parents 899f128 + 671890a commit ddf3ae2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/dev-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
uses: tj-actions/changed-files@v35
with:
files_ignore: documentation
- name: 🔎 Check if files in data-loading-service have changed
id: data-loading-service-changed
uses: tj-actions/changed-files@v35
with:
files: data-loading-service
- name: Upgrade AWS CLI version and setup lightsailctl
if: steps.changed-files.outputs.any_changed == 'true'
run: |
Expand Down Expand Up @@ -54,7 +59,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push 1-data-loading-service
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.data-loading-service-changed.outputs.any_changed == 'true'
id: docker_build_data_loading_service
uses: docker/build-push-action@v2
with:
Expand All @@ -74,7 +79,7 @@ jobs:
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
- name: Push Updated data loading service Docker Image on Lightsail Dev
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.data-loading-service-changed.outputs.any_changed == 'true'
run: |
MAX_RETRIES=5
RETRY_DELAY=5
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/prod-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
uses: tj-actions/changed-files@v35
with:
files_ignore: documentation
- name: 🔎 Check if files in data-loading-service have changed
id: data-loading-service-changed
uses: tj-actions/changed-files@v35
with:
files: data-loading-service
- name: Upgrade AWS CLI version and setup lightsailctl
if: steps.changed-files.outputs.any_changed == 'true'
run: |
Expand Down Expand Up @@ -57,7 +62,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push 1-data-loading-service
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.data-loading-service-changed.outputs.any_changed == 'true'
id: docker_build_data_loading_service
uses: docker/build-push-action@v2
with:
Expand All @@ -77,7 +82,7 @@ jobs:
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
- name: Push Updated data loading service Docker Image on Lightsail Prod
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.data-loading-service-changed.outputs.any_changed == 'true'
run: |
MAX_RETRIES=5
RETRY_DELAY=5
Expand Down
6 changes: 4 additions & 2 deletions fastapi/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ class RouteOverview(Base):
pdf_file_url = Column(String)
pdf_file_link = Column(String)
iconography_url = Column(String)
shape_direction_0 = Column(Geometry('LINESTRING', srid=4326))
shape_direction_1 = Column(Geometry('LINESTRING', srid=4326))

terminal_1 = Column(String)
terminal_2 = Column(String)
arterials = Column(String)
Expand Down Expand Up @@ -160,6 +159,9 @@ class RouteStopsGrouped(Base):
route_code = Column(String,primary_key=True, index=True)
payload = Column(JSON)
agency_id = Column(String)
shape_direction_0 = Column(Geometry('LINESTRING', srid=4326))
shape_direction_1 = Column(Geometry('LINESTRING', srid=4326))
geometry = Column(Geometry('POINT', srid=4326))

class TripShapes(Base):
__tablename__ = "trip_shapes"
Expand Down

0 comments on commit ddf3ae2

Please sign in to comment.