Coder Social home page Coder Social logo

geo-layer's People

Contributors

vincentsarago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kylebarron

geo-layer's Issues

add a note about jinja2

Jinja2 is present in lambci image but not on AWS Lambda

quick fix:

pip install jinja2 --user --ignore-installed

Update!

I've just pushed a lot of fix in docker-lambda so we need to publish new layer here too!

rename "geo" to "geolayer"

ref #5
Because I originally had -geo layer in my aws account, the version count was different throught the region and layers.

To keep everything uniq, I'm going to release the layers and docker images with a new geolayer suffix

The new ARN will be
arn:aws:lambda:{REGION}:524387336408:layer:gdal{GDAL_VERSION_NODOT}-py{PYTHON_VERSION_NODOT}-geolayer:{LAYER_VERSION}

and the docker name
lambgeo/lambda:gdal{GDAL_VERSION_SHORT}-py{PYTHON_VERSION_SHORT}-geolayer

Using binaries cannot find libexpat.so.1

Hi

I am trying to use the geo-layer with a NodeJS 10.x AWS Lambda function and calling ogr2ogr using child_process.exec however I get the following error

ogr2ogr: error while loading shared libraries: libexpat.so.1: cannot open shared object file: No such file or directory

Looking at the docker image it does seem to be built with expat so maybe I am not correctly setting the environment variables or maybe I need to set the LD_LIBRARY_PATH?

I have used the same method from a Python 3.7 AWS Lambda function using subprocess and it worked fine.

Any ideas?

Many thanks

Version are not 1

๐Ÿคฆ I though I cleanup all old -geo layer in my account but it might not be true

    {
        "region": "us-east-1",
        "layers": [
            {
                "name": "gdal24-py37-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal24-py37-geo:9",
                "version": 9
            },
            {
                "name": "gdal30-py37-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal30-py37-geo:8",
                "version": 8
            },
            {
                "name": "gdal31-py37-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal31-py37-geo:1",
                "version": 1
            },
            {
                "name": "gdal24-py38-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal24-py38-geo:1",
                "version": 1
            },
            {
                "name": "gdal30-py38-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal30-py38-geo:1",
                "version": 1
            },
            {
                "name": "gdal31-py38-geo",
                "arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal31-py38-geo:1",
                "version": 1
            }
        ]
    },

cc @kylebarron

libexpat.so.1: cannot open shared object file: No such file or director

Hi.
This error has appearead again in this new layer. And I can reproduce it, finally.

I've cloned this repo and created a makefile with the commands described in the README. However, when trying to run a simple python function, it gives the error from the title.

Makefile:

.PHONY: layer test

layer:
	docker build --tag package:latest . --build-arg GDAL_VERSION=3.0 --build-arg PYTHON_VERSION=3.8
	docker run --name lambda -w /var/task -itd package:latest bash
	docker cp scripts/create-lambda-layer.sh lambda:/create-lambda-layer.sh
	docker exec -it lambda bash /create-lambda-layer.sh
	docker cp lambda:/tmp/package.zip package.zip
	docker stop lambda
	docker rm lambda

test:
	unzip package.zip -d layer
	docker run \
		--rm \
		-v $(shell pwd):/var/task:ro,delegated \
		-v $(shell pwd)/layer:/opt:ro,delegated \
    	-e GDAL_DATA="/opt/share/gdal" \
    	-e PROJ_LIB="/opt/share/proj" \
		lambci/lambda:python3.8 handler.handler '{"some": "data"}'

Python function:

import numpy
import rasterio

def handler(event, context):
    print(numpy.__version__)
    print(rasterio.__version__)

I've already checked the linking using ldd and it seems to be linked correctly. But when executing the function, it does not work.

$ docker run --rm -it lambgeo/lambda:gdal3.0-py3.8 bash -c "ldd /opt/lib/libgdal.so | grep expat"
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fb514a28000)

Am I missing something?

Again, thanks for your work with these layers. They help A LOT. And sorry for pestering you with my issues ๐Ÿ˜

Make layers public

I do not know if it is your plan to make these layers publicly available. I hope it is. They are very good! But, I was trying to use the new ones today and I am getting access denied (see below).

$ aws lambda get-layer-version-by-arn --arn "arn:aws:lambda:eu-central-1:524387336408:layer:gdal31-py38-geolayer:1" --region "eu-central-1"

An error occurred (AccessDeniedException) when calling the GetLayerVersionByArn operation: User: arn:aws:iam::1234567890:user/user is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:eu-central-1:524387336408:layer:gdal31-py38-geolayer:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.