-
Notifications
You must be signed in to change notification settings - Fork 1
fix: restore PostGIS via boost-serialization from EPEL 10 #247
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
Changes from all commits
dcd488e
4cd6cf3
103d775
ecaa50f
852ed78
3fd2456
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Build and Push Base Image | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| paths: | ||
| - Containerfile.base | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| REGISTRY: quay.io | ||
| IMAGE_NAME: crunchtools/rotv-base | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Quay.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ secrets.QUAY_USERNAME }} | ||
| password: ${{ secrets.QUAY_PASSWORD }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| file: Containerfile.base | ||
| push: true | ||
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
| secrets: | | ||
| activation_key=${{ secrets.RHSM_ACTIVATION_KEY }} | ||
| org_id=${{ secrets.RHSM_ORG_ID }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Trigger rotv rebuild | ||
| env: | ||
| GH_TOKEN: ${{ secrets.CRUNCHTOOLS_DISPATCH_TOKEN }} | ||
| run: | | ||
| gh api repos/crunchtools/rotv/dispatches \ | ||
| -f event_type=parent-image-updated |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -153,6 +153,78 @@ describe('Database Schema Tests', () => { | |||||||||||||||||||||
| }); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| describe('PostGIS / Geographic Grounding Tests', () => { | ||||||||||||||||||||||
| it('PostGIS extension is installed', async () => { | ||||||||||||||||||||||
| const result = await pool.query( | ||||||||||||||||||||||
| "SELECT extname, extversion FROM pg_extension WHERE extname = 'postgis'" | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| expect(result.rows.length).toBe(1); | ||||||||||||||||||||||
| expect(result.rows[0].extname).toBe('postgis'); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| it('pois table has boundary_geom column', async () => { | ||||||||||||||||||||||
| const result = await pool.query(` | ||||||||||||||||||||||
| SELECT column_name | ||||||||||||||||||||||
| FROM information_schema.columns | ||||||||||||||||||||||
| WHERE table_name = 'pois' AND column_name = 'boundary_geom' | ||||||||||||||||||||||
| `); | ||||||||||||||||||||||
| expect(result.rows.length).toBe(1); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| it('Serper grounding query executes without error', async () => { | ||||||||||||||||||||||
| // Insert a test boundary POI and a point POI inside it, then verify | ||||||||||||||||||||||
| // the grounding SQL (copied verbatim from serperService.js) returns the | ||||||||||||||||||||||
| // boundary name. This test catches PostGIS being absent or the geometry | ||||||||||||||||||||||
| // columns being missing — both of which silently degrade to ungrounded | ||||||||||||||||||||||
| // searches at runtime. | ||||||||||||||||||||||
| await pool.query(` | ||||||||||||||||||||||
| INSERT INTO pois (name, poi_type, latitude, longitude, boundary_geom) | ||||||||||||||||||||||
| VALUES ( | ||||||||||||||||||||||
| '_test_boundary', 'boundary', 41.3, -81.6, | ||||||||||||||||||||||
| ST_MakeEnvelope(-82.0, 41.0, -81.0, 41.6, 4326) | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+181
to
+185
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||||||||||
| `); | ||||||||||||||||||||||
| const testPoi = await pool.query(` | ||||||||||||||||||||||
| INSERT INTO pois (name, poi_type, latitude, longitude) | ||||||||||||||||||||||
| VALUES ('_test_point', 'point', 41.2, -81.5) | ||||||||||||||||||||||
| RETURNING id | ||||||||||||||||||||||
| `); | ||||||||||||||||||||||
|
Comment on lines
+187
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The grounding query being tested (lines 196-217) retrieves the location for
Suggested change
|
||||||||||||||||||||||
| const poiId = testPoi.rows[0].id; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| try { | ||||||||||||||||||||||
| const result = await pool.query(` | ||||||||||||||||||||||
| WITH poi_point AS ( | ||||||||||||||||||||||
| SELECT | ||||||||||||||||||||||
| id, | ||||||||||||||||||||||
| CASE | ||||||||||||||||||||||
| WHEN poi_type = 'point' AND geom IS NOT NULL THEN geom | ||||||||||||||||||||||
| WHEN poi_type IN ('trail', 'boundary', 'river') AND geometry IS NOT NULL THEN | ||||||||||||||||||||||
| ST_StartPoint(ST_GeometryN(ST_GeomFromGeoJSON(geometry::text), 1)) | ||||||||||||||||||||||
| ELSE NULL | ||||||||||||||||||||||
| END as point_geom | ||||||||||||||||||||||
| FROM pois | ||||||||||||||||||||||
| WHERE id = $1 | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| SELECT boundary.name | ||||||||||||||||||||||
| FROM poi_point | ||||||||||||||||||||||
| LEFT JOIN pois AS boundary | ||||||||||||||||||||||
| ON boundary.poi_type = 'boundary' | ||||||||||||||||||||||
| AND boundary.boundary_geom IS NOT NULL | ||||||||||||||||||||||
| AND ST_Contains(boundary.boundary_geom, poi_point.point_geom) | ||||||||||||||||||||||
| WHERE poi_point.point_geom IS NOT NULL | ||||||||||||||||||||||
| ORDER BY ST_Area(boundary.boundary_geom) ASC | ||||||||||||||||||||||
| LIMIT 1 | ||||||||||||||||||||||
| `, [poiId]); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // A point POI uses lat/lon, not geom, so grounding via geom column won't | ||||||||||||||||||||||
| // match — but the query must execute without throwing. | ||||||||||||||||||||||
| expect(Array.isArray(result.rows)).toBe(true); | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The assertion expect(result.rows.length).toBe(1);
expect(result.rows[0].name).toBe('_test_boundary'); |
||||||||||||||||||||||
| } finally { | ||||||||||||||||||||||
| await pool.query("DELETE FROM pois WHERE name IN ('_test_boundary', '_test_point')"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| describe('Database Query Tests', () => { | ||||||||||||||||||||||
| it('should query POIs successfully', async () => { | ||||||||||||||||||||||
| const result = await pool.query(` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine these
dnf installcommands into a single execution. This reduces the number of image layers and minimizes metadata overhead, leading to a more efficient build process.