mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-07-25 11:10:49 +02:00
update for historical run
This commit is contained in:
@@ -71,6 +71,7 @@ jobs:
|
|||||||
df -h
|
df -h
|
||||||
|
|
||||||
- name: Download and extract ADS-B data
|
- name: Download and extract ADS-B data
|
||||||
|
id: download
|
||||||
env:
|
env:
|
||||||
START_DATE: ${{ matrix.chunk.start_date }}
|
START_DATE: ${{ matrix.chunk.start_date }}
|
||||||
END_DATE: ${{ matrix.chunk.end_date }}
|
END_DATE: ${{ matrix.chunk.end_date }}
|
||||||
@@ -78,8 +79,20 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m src.adsb.download_and_list_icaos --start-date "$START_DATE" --end-date "$END_DATE"
|
python -m src.adsb.download_and_list_icaos --start-date "$START_DATE" --end-date "$END_DATE"
|
||||||
ls -lah data/output/
|
ls -lah data/output/
|
||||||
|
|
||||||
|
# Check if manifest has any ICAOs
|
||||||
|
MANIFEST=$(ls data/output/icao_manifest_*.txt 2>/dev/null | head -1)
|
||||||
|
if [ -z "$MANIFEST" ] || [ ! -s "$MANIFEST" ]; then
|
||||||
|
echo "No data available for this date range"
|
||||||
|
echo "has_data=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
ICAO_COUNT=$(wc -l < "$MANIFEST")
|
||||||
|
echo "Manifest has $ICAO_COUNT ICAOs"
|
||||||
|
echo "has_data=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create tar of extracted data and split into chunks
|
- name: Create tar of extracted data and split into chunks
|
||||||
|
if: steps.download.outputs.has_data == 'true'
|
||||||
run: |
|
run: |
|
||||||
cd data/output
|
cd data/output
|
||||||
echo "=== Disk space before tar ==="
|
echo "=== Disk space before tar ==="
|
||||||
@@ -115,6 +128,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload extracted data chunks
|
- name: Upload extracted data chunks
|
||||||
|
if: steps.download.outputs.has_data == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: adsb-extracted-${{ matrix.chunk.start_date }}-${{ matrix.chunk.end_date }}
|
name: adsb-extracted-${{ matrix.chunk.start_date }}-${{ matrix.chunk.end_date }}
|
||||||
@@ -127,7 +141,7 @@ jobs:
|
|||||||
needs: [generate-matrix, adsb-extract]
|
needs: [generate-matrix, adsb-extract]
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
chunk: ${{ fromJson(needs.generate-matrix.outputs.chunks) }}
|
chunk: ${{ fromJson(needs.generate-matrix.outputs.chunks) }}
|
||||||
icao_chunk: [0, 1, 2, 3]
|
icao_chunk: [0, 1, 2, 3]
|
||||||
@@ -154,6 +168,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download extracted data
|
- name: Download extracted data
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: adsb-extracted-${{ matrix.chunk.start_date }}-${{ matrix.chunk.end_date }}
|
name: adsb-extracted-${{ matrix.chunk.start_date }}-${{ matrix.chunk.end_date }}
|
||||||
path: data/output/tar_chunks/
|
path: data/output/tar_chunks/
|
||||||
@@ -221,6 +236,7 @@ jobs:
|
|||||||
|
|
||||||
adsb-reduce:
|
adsb-reduce:
|
||||||
needs: [generate-matrix, adsb-map]
|
needs: [generate-matrix, adsb-map]
|
||||||
|
if: always() && needs.generate-matrix.result == 'success'
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -238,12 +254,26 @@ jobs:
|
|||||||
|
|
||||||
- name: Download all chunk artifacts
|
- name: Download all chunk artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
pattern: adsb-map-*
|
pattern: adsb-map-*
|
||||||
path: data/output/adsb_chunks/
|
path: data/output/adsb_chunks/
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Check for data
|
||||||
|
id: check_data
|
||||||
|
run: |
|
||||||
|
PARQUET_COUNT=$(find data/output/adsb_chunks/ -name '*.parquet' -type f 2>/dev/null | wc -l)
|
||||||
|
echo "Found $PARQUET_COUNT parquet files"
|
||||||
|
if [ "$PARQUET_COUNT" -eq 0 ]; then
|
||||||
|
echo "WARNING: No parquet chunks found - all date ranges may have had no releases"
|
||||||
|
echo "has_data=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "has_data=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Debug downloaded files
|
- name: Debug downloaded files
|
||||||
|
if: steps.check_data.outputs.has_data == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "=== Disk space before processing ==="
|
echo "=== Disk space before processing ==="
|
||||||
df -h
|
df -h
|
||||||
@@ -253,6 +283,7 @@ jobs:
|
|||||||
du -sh data/output/adsb_chunks/ || echo "No chunks dir"
|
du -sh data/output/adsb_chunks/ || echo "No chunks dir"
|
||||||
|
|
||||||
- name: Combine chunks to CSV
|
- name: Combine chunks to CSV
|
||||||
|
if: steps.check_data.outputs.has_data == 'true'
|
||||||
env:
|
env:
|
||||||
START_DATE: ${{ needs.generate-matrix.outputs.global_start }}
|
START_DATE: ${{ needs.generate-matrix.outputs.global_start }}
|
||||||
END_DATE: ${{ needs.generate-matrix.outputs.global_end }}
|
END_DATE: ${{ needs.generate-matrix.outputs.global_end }}
|
||||||
@@ -261,6 +292,7 @@ jobs:
|
|||||||
ls -lah data/openairframes/
|
ls -lah data/openairframes/
|
||||||
|
|
||||||
- name: Upload final artifact
|
- name: Upload final artifact
|
||||||
|
if: steps.check_data.outputs.has_data == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: openairframes_adsb-${{ needs.generate-matrix.outputs.global_start }}-${{ needs.generate-matrix.outputs.global_end }}
|
name: openairframes_adsb-${{ needs.generate-matrix.outputs.global_start }}-${{ needs.generate-matrix.outputs.global_end }}
|
||||||
|
|||||||
@@ -176,13 +176,15 @@ def main():
|
|||||||
|
|
||||||
all_icaos = process_date_range(start_date, end_date)
|
all_icaos = process_date_range(start_date, end_date)
|
||||||
|
|
||||||
if not all_icaos:
|
|
||||||
print("No ICAOs found in date range")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Write combined manifest with range identifier
|
# Write combined manifest with range identifier
|
||||||
manifest_id = f"{args.start_date}_{args.end_date}"
|
manifest_id = f"{args.start_date}_{args.end_date}"
|
||||||
write_manifest(list(all_icaos), manifest_id)
|
|
||||||
|
if not all_icaos:
|
||||||
|
print("WARNING: No ICAOs found in date range (no releases available)")
|
||||||
|
# Write empty manifest so downstream steps can detect and skip
|
||||||
|
write_manifest([], manifest_id)
|
||||||
|
else:
|
||||||
|
write_manifest(list(all_icaos), manifest_id)
|
||||||
|
|
||||||
print(f"\nDone! Total ICAOs: {len(all_icaos)}")
|
print(f"\nDone! Total ICAOs: {len(all_icaos)}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user