Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5eee26
Refactor geocoding processing with unique name repair
beusj Nov 11, 2025
49a626b
Add row_index to geocoding results
beusj Nov 11, 2025
a35a8a9
Merge pull request #1 from beusj/beusj-patch-map
beusj Nov 11, 2025
629a565
update to R 4.4.3 and update packages; add logging to R function
beusj Nov 13, 2025
f46375a
update ruby to reflect deprecation of File.exists?
beusj Nov 13, 2025
6ee586e
fixed additional ruby compatibility issues
beusj Nov 13, 2025
c3c27cc
updates for caching
beusj Nov 13, 2025
ff2bc4e
update dockerfile
beusj Nov 13, 2025
469f48e
changes to github workflow
beusj Nov 13, 2025
03e0982
Initial plan
Copilot Nov 13, 2025
9731ab9
Configure build-deploy-release workflow to trigger on v3.5.0 tag
Copilot Nov 13, 2025
4fc2e84
Initial plan
Copilot Nov 13, 2025
de9bdd9
Update build-deploy-release.yaml to run on any push with a tag
Copilot Nov 13, 2025
fad035b
Merge pull request #2 from beusj/copilot/run-release-on-tag-v3-5-0
beusj Nov 13, 2025
efd6992
Merge branch 'master' into copilot/run-on-push-with-tag
beusj Nov 13, 2025
e2bdd5b
Merge pull request #3 from beusj/copilot/run-on-push-with-tag
beusj Nov 13, 2025
9b13b61
Initial plan
Copilot Nov 13, 2025
8971646
Update GitHub Actions to remove deprecated save-state command
Copilot Nov 13, 2025
7bc3bb5
Merge pull request #4 from beusj/copilot/remove-deprecated-save-state…
beusj Nov 13, 2025
d08609e
Modify deployment username in workflow
beusj Nov 13, 2025
a96290a
planned .github workflow changes
beusj Nov 18, 2025
e4c3724
revert staging of database changes
beusj Nov 18, 2025
e9de1fc
undo logging changes to entrypoint.R
beusj Nov 18, 2025
6d78d6d
add additional information about ruby geocoder
beusj Nov 18, 2025
5fb898d
Build in user repo
beusj Nov 18, 2025
6b21a0b
Add repository_dispatch event to workflow
beusj Nov 18, 2025
4fdc600
Update GitHub Actions workflow for dynamic username
beusj Nov 18, 2025
c5e75d9
Fix typo in event trigger for PR workflow
beusj Nov 18, 2025
1fb178b
Update manual build workflow for Docker images
beusj Nov 18, 2025
64a1b4a
Rename manual_build.yml to build-manual.yml
beusj Nov 19, 2025
984bf62
Refactor Dockerfile for optimized build and dependencies
reukiodo Dec 16, 2025
b22a2a6
Modify R package installation in Dockerfile
reukiodo Dec 16, 2025
2cf5a95
Revert "Modify R package installation in Dockerfile"
beusj Dec 24, 2025
4b007bb
Revert "Refactor Dockerfile for optimized build and dependencies"
beusj Dec 24, 2025
79ac306
use env variable for geocoder db location
beusj Dec 30, 2025
3828272
Revert "use env variable for geocoder db location"
beusj Dec 30, 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
8 changes: 5 additions & 3 deletions .github/workflows/build-deploy-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: build-deploy-pr
on:
pull_request:
repository_dispatch:
types: [release-build, force-rebuild]
jobs:
deploy-images:
runs-on: ubuntu-latest
env:
registry: ghcr.io
username: degauss-org
username: ${{ github.event.organization.login || github.repository_owner }}
repository: geocoder
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: create latest tag variable
run: |
container="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:latest"
Expand All @@ -31,7 +33,7 @@ jobs:
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file.csv 0.6
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file.csv all
- name: login to ghcr
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.registry }}
username: ${{ env.username }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/build-deploy-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ name: build-deploy-release
on:
release:
types: [published]
repository_dispatch:
types: [release-build, force-rebuild]
jobs:
deploy-images:
runs-on: ubuntu-latest
env:
registry: ghcr.io
username: degauss-org
username: ${{ github.event.organization.login || github.repository_owner }}
repository: geocoder
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: create latest tag variable
run: |
container="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:latest"
container="${{ env.registry }}/${{ env.username }}/${{ env.repository }}:latest"
echo "container=${container}" >> $GITHUB_ENV
- name: create release tag variable
if: github.event_name == 'release'
run: |
versioned="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${GITHUB_REF##*/}"
versioned="${{ env.registry }}/${{ env.username }}/${{ env.repository }}:${GITHUB_REF##*/}"
echo "versioned=${versioned}" >> $GITHUB_ENV
- name: build container
run: |
Expand All @@ -32,7 +34,7 @@ jobs:
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file.csv 0.6
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file.csv all
- name: login to ghcr
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.registry }}
username: ${{ env.username }}
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/build-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Manually Rebuild Docker

on:
workflow_dispatch:
inputs:
tag:
description: "Optional image tag to push (e.g., v1.2.3). If empty, use repo tag at HEAD or short SHA."
required: false
default: ""

jobs:
deploy-images:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.event.organization.login || github.repository_owner }}
REPOSITORY: geocoder
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to read tags

- name: Determine image tags
shell: bash
run: |
set -euo pipefail
IMAGE="${REGISTRY}/${USERNAME}/${REPOSITORY}"

INPUT_TAG="${{ github.event.inputs.tag }}"
if [ -n "$INPUT_TAG" ]; then
TAG="$INPUT_TAG"
else
# Use exact tag at HEAD if present; otherwise short SHA
TAG="$(git describe --tags --exact-match 2>/dev/null || true)"
if [ -z "$TAG" ]; then
TAG="$(git rev-parse --short HEAD)"
fi
fi

echo "image=${IMAGE}" >> "$GITHUB_ENV"
echo "tag=${TAG}" >> "$GITHUB_ENV"
echo "versioned=${IMAGE}:${TAG}" >> "$GITHUB_ENV"
echo "latest=${IMAGE}:latest" >> "$GITHUB_ENV"

echo "Will publish tags:"
echo " - ${IMAGE}:${TAG}"
echo " - ${IMAGE}:latest"

- name: Build image
run: |
docker build -t "${{ env.versioned }}" -t "${{ env.latest }}" .
Comment on lines +50 to +52
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual build workflow does not specify GEOCODER_S3_LOCATION when building the Docker image, but the Dockerfile now requires it via the ADD instruction. This will cause manual builds to fail. The build command needs to include the build argument with an appropriate value.

Copilot uses AI. Check for mistakes.

- name: Test image
run: |
docker run --rm -v "${PWD}/test":/tmp "${{ env.versioned }}" my_address_file.csv
docker run --rm -v "${PWD}/test":/tmp "${{ env.versioned }}" my_address_file.csv 0.6
docker run --rm -v "${PWD}/test":/tmp "${{ env.versioned }}" my_address_file.csv all

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push images
run: |
docker push "${{ env.versioned }}"
docker push "${{ env.latest }}"
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM rocker/r-ver:4.4.1
FROM ghcr.io/rocker-org/r-ver:4.4.3

# DeGAUSS container metadata
ENV degauss_name="geocoder"
ENV degauss_version="3.4.0"
ENV degauss_version="3.5.0"
ENV degauss_description="geocodes"
ENV degauss_argument="valid_geocode_score_threshold [default: 0.5]"

Expand Down Expand Up @@ -48,7 +48,8 @@ WORKDIR /app

# install required version of renv
RUN R --quiet -e "install.packages('remotes', repos = c(CRAN = 'https://packagemanager.posit.co/cran/latest'))"
RUN R --quiet -e "remotes::install_github('rstudio/renv@v1.0.7')"
RUN R --quiet -e "remotes::install_github('rstudio/renv@v1.1.5')"


COPY renv.lock .
RUN R --quiet -e "renv::restore(repos = c(CRAN = 'https://packagemanager.posit.co/cran/latest'))"
Expand Down
3 changes: 1 addition & 2 deletions entrypoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,4 @@ if (opt$score_threshold != "all") {
wrap = TRUE
)
knitr::kable(geocode_summary %>% dplyr::select(geocode_result, `n (%)`))
}

}
5 changes: 5 additions & 0 deletions lib/geocoder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ruby Geocoder

See this reposotiory for more information.

[https://github.com/geocommons/geocoder](https://github.com/geocommons/geocoder)
2 changes: 1 addition & 1 deletion lib/geocoder/us.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# General usage is as follows:
#
# >> require 'geocoder/us'
# >> db = Geocoder::US::Database.new("/opt/tiger/geocoder.db")
# >> db = Geocoder::US::Database.new("/opt/geocoder.db")
# >> p db.geocode("1600 Pennsylvania Av, Washington DC")
#
# [{:pretyp=>"", :street=>"Pennsylvania", :sufdir=>"NW", :zip=>"20502",
Expand Down
6 changes: 3 additions & 3 deletions lib/geocoder/us/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize (filename, options = {})
:create => false, :dbtype => 1}
options = defaults.merge options
raise ArgumentError, "can't find database #{filename}" \
unless options[:create] or File.exists? filename
unless options[:create] or File.exist? filename
@db = SQLite3::Database.new( filename )
@st = {}
@dbtype = options[:dbtype]
Expand Down Expand Up @@ -153,7 +153,7 @@ def execute_statement (st, *params)
result = st.execute(*params)
columns = result.columns.map {|c| c.to_sym}
result.each {|row|
rows << Hash[*(columns.zip(row).flatten)]}
rows << columns.zip(row).to_h}

end
if @debug
Expand Down Expand Up @@ -630,7 +630,7 @@ def clean_record! (record)
unless record[:score].nil?
record.keys.each {|k| record[k] = "" if record[k].nil? } # clean up nils
record.delete :components unless @debug
record.delete_if {|k,v| k.is_a? Fixnum or
record.delete_if {|k,v| k.is_a? Integer or
[:geometry, :side, :tlid, :fid, :fid1, :fid2, :street_phone,
:city_phone, :fromhn, :tohn, :paflag, :flipped, :street_score,
:city_score, :priority, :fips_class, :fips_place, :status].include? k}
Expand Down
Loading