Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a3a2205
feat: created transfer branch for cloud build
jirhiker Sep 3, 2025
1e4665b
Formatting changes
jirhiker Sep 3, 2025
d9b0488
feat: update asset transfer logic to handle filenames correctly
jirhiker Sep 3, 2025
0689d77
Formatting changes
jirhiker Sep 3, 2025
37d691b
Merge branch 'pre-production' into transfer
jirhiker Sep 3, 2025
0b6e98c
feat: update contact transfer logic to extract roles from OwnerCommen…
jirhiker Sep 3, 2025
3cdd19b
Formatting changes
jirhiker Sep 3, 2025
197c061
feat: update contact and group transfer logic to use new CSV filename…
jirhiker Sep 4, 2025
3907d7a
Formatting changes
jirhiker Sep 4, 2025
ff6c51b
feat: add health check endpoint and middleware for improved service m…
jirhiker Sep 4, 2025
bdad4d9
Formatting changes
jirhiker Sep 4, 2025
6398a02
feat: add FastAPI entrypoint with trigger endpoint for transfer service
jirhiker Sep 4, 2025
5cc8fae
Formatting changes
jirhiker Sep 4, 2025
fda9d27
feat: add main entry point for FastAPI application with configurable …
jirhiker Sep 4, 2025
9ca5c14
Formatting changes
jirhiker Sep 4, 2025
a4dce0c
feat: remove uvicorn entrypoint and add Procfile for Gunicorn deployment
jirhiker Sep 4, 2025
0fdb227
Formatting changes
jirhiker Sep 4, 2025
9f515b5
feat: update Procfile to use UvicornWorker for Gunicorn deployment
jirhiker Sep 4, 2025
007bdc7
feat: add requirements_transfer.txt for transfer service dependencies
jirhiker Sep 4, 2025
53e8f6d
feat: add requirements.txt for transfer service dependencies
jirhiker Sep 4, 2025
d316cd7
feat: add psycopg-binary dependency to pyproject.toml and update lock…
jirhiker Sep 4, 2025
e182688
feat: simplify requirements.txt by removing direct file references
jirhiker Sep 4, 2025
3c1b91a
feat: use uv requirements
jirhiker Sep 4, 2025
b19e53f
feat: update psycopg dependencies to use psycopg2-binary and remove p…
jirhiker Sep 4, 2025
64e36c0
Merge branch 'pre-production' into transfer
jirhiker Sep 4, 2025
986e6b2
Formatting changes
jirhiker Sep 5, 2025
7f06627
feat: update Procfile to use transfers.entrypoint for web server
jirhiker Sep 5, 2025
db8967d
Merge branch 'pre-production' into transfer
jirhiker Sep 5, 2025
14a9961
feat: enhance contact transfer logic and reduce batch limit
jirhiker Sep 5, 2025
a182088
Formatting changes
jirhiker Sep 5, 2025
bd9bc86
feat: add wells endpoint and health check to transfer service
jirhiker Sep 5, 2025
936814e
Formatting changes
jirhiker Sep 5, 2025
0b09d6b
feat: add wells endpoint and health check to transfer service
jirhiker Sep 5, 2025
ee11ade
feat: update wells endpoint to support pagination with start index an…
jirhiker Sep 5, 2025
6bc8f69
Formatting changes
jirhiker Sep 5, 2025
764e39f
feat: update health check endpoint to use POST method with JSON payload
jirhiker Sep 5, 2025
37543c4
feat: add multiple transfer endpoints for assets, contacts, groups, a…
jirhiker Sep 9, 2025
c6d8836
Formatting changes
jirhiker Sep 9, 2025
909ee35
Merge branch 'transfer' into jab-transfer-logging
jacob-a-brown Sep 11, 2025
49225bf
fix: set dtype for OSEWelltagID
jacob-a-brown Sep 11, 2025
b0d1338
feat: redirect errors to log
jacob-a-brown Sep 11, 2025
8087192
fix: set limit correctly for well transfer
jacob-a-brown Sep 11, 2025
076c024
fix: remove print debugging statement
jacob-a-brown Sep 11, 2025
3a8c042
Merge branch 'transfer' into jab-transfer-logging
jacob-a-brown Sep 11, 2025
5e7a2c2
feat: validate addresses with pydantic
jacob-a-brown Sep 11, 2025
1565bef
Merge branch 'pre-production' into jab-transfer-logging
jacob-a-brown Sep 11, 2025
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/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Tests

on:
pull_request:
branches: [ "main",'pre-production']
branches: [ "main",'pre-production', 'transfer']

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn -b :8080 transfers.entrypoint:app -k uvicorn.workers.UvicornWorker
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import sentry_sdk
from dotenv import load_dotenv
from starlette.middleware.base import BaseHTTPMiddleware
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware

load_dotenv()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies = [
"propcache==0.3.2",
"proto-plus==1.26.1",
"protobuf==6.32.0",
"psycopg2==2.9.10",
"psycopg2-binary>=2.9.10",
"pyasn1==0.6.1",
"pyasn1-modules==0.4.2",
"pycparser==2.22",
Expand Down
1,132 changes: 1,132 additions & 0 deletions requirements.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions services/gcs_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def get_storage_client() -> storage.Client:

# Create storage client
client = storage.Client(credentials=creds)
elif settings.mode == "transfer":
client = storage.Client()
else:
client = storage.Client.from_service_account_json(
os.environ.get("GOOGLE_APPLICATION_CREDENTIALS")
Expand Down
4 changes: 4 additions & 0 deletions transfer_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl -X POST "https://nma-ocotillo-transfer-95715287188.us-central1.run.app/health" \
-H "Authorization: bearer $(gcloud auth print-identity-token)" \
-H "Content-Type: application/json" \
-d '{"limit": "10"}'
9 changes: 7 additions & 2 deletions transfers/asset_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@ def transfer_assets(session: Session) -> None:
bucket = get_storage_bucket(client)
logger.info(f"Using bucket {bucket.name}")

# for name in ['AR0001']: # for testing
for thing in get_valid_things(session):
name = thing.name
# find images in temp bucket
logger.info(f"Processing PointID: {thing.name}")
blobs = bucket.list_blobs(prefix=f"nma-photos/{thing.name}")
# move blobs from temp to assets bucket
for srcblob in blobs:
f = srcblob.download_as_bytes()
ff = UploadFile(file=io.BytesIO(f), filename=srcblob.name, size=len(f))
head, filename = srcblob.name.split("/")

ff = UploadFile(file=io.BytesIO(f), filename=filename, size=len(f))

uri, blob_name = gcs_upload(ff, bucket)
add_asset(session, ff, srcblob.name, thing.id, uri, blob_name)
add_asset(session, ff, filename, thing.id, uri, blob_name)


def transfer_assets_testing(session: Session) -> None:
Expand Down
Loading
Loading