This repository was archived by the owner on Jul 21, 2025. It is now read-only.
  
  
  - 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
fix: install DuckDB dependencies at build time (via Docker 🤔) #60
          
     Closed
      
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -18,4 +18,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ | |
| FROM python:3.12-slim | ||
| COPY --from=builder --chown=app:app /app/.venv /app/.venv | ||
| 
     | 
||
| # install DuckDB extensions needed by DuckDB client at build time | ||
| RUN python -c "import stacrs; stacrs.DuckdbClient()" | ||
| 
         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. Since this is duplicated in the deploy dockerfile, can we refactor to something shared so we don't repeat ourselves? Not sure if that makes sense with how dockerfiles work, but just asking.  | 
||
| 
     | 
||
| CMD [ "/app/.venv/bin/uvicorn", "stac_fastapi.geoparquet.main:app" ] | ||
              Empty file.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -10,13 +10,15 @@ RUN dnf install -y findutils binutils && \ | |
| 
     | 
||
| WORKDIR /tmp | ||
| COPY pyproject.toml pyproject.toml | ||
| COPY uv.lock uv.lock | ||
| COPY README.md README.md | ||
| COPY src/stac_fastapi/ src/stac_fastapi/ | ||
| 
     | 
||
| RUN uv pip install --compile-bytecode .[lambda] --target /asset | ||
| RUN uv export --frozen --extra lambda > requirements.txt && \ | ||
| uv pip install install --compile-bytecode --target ${LAMBDA_TASK_ROOT} -r requirements.txt | ||
                
      
                  gadomski marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| # Reduce package size and remove useless files | ||
| WORKDIR /asset | ||
| WORKDIR ${LAMBDA_TASK_ROOT} | ||
| RUN find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done; | ||
| RUN find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf | ||
| RUN find . -type f -a -name '*.py' -print0 | xargs -0 rm -f | ||
| 
        
          
        
         | 
    @@ -25,4 +27,9 @@ RUN find . -type d -a -name 'tests' -print0 | xargs -0 rm -rf | |
| # Strip debug symbols from compiled C/C++ code | ||
| RUN find . -type f -name '*.so*' -exec strip --strip-unneeded {} \; | ||
| 
     | 
||
| COPY infrastructure/aws/lambda/handler.py /asset/handler.py | ||
| COPY infrastructure/aws/lambda/handler.py ${LAMBDA_TASK_ROOT}/handler.py | ||
| 
     | 
||
| # install DuckDB extensions needed by DuckDB client at build time | ||
| RUN python -c "import stacrs; stacrs.DuckdbClient()" | ||
| 
         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. @ceholden I'm going to take over stac-utils/rustac#655 and implement that this morning.  | 
||
| 
     | 
||
| CMD [ "handler.handler" ] | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.