GithubHelp home page GithubHelp logo

Question - v4.1 about serverless-iiif HOT 10 CLOSED

samvera avatar samvera commented on August 26, 2024
Question - v4.1

from serverless-iiif.

Comments (10)

mbklein avatar mbklein commented on August 26, 2024 1

Do you have a preference as to where to retrieve the HTTP Source Host string from...? (e.g. - SAM template or Environment)

If the HTTP source is a deploy-time configuration option, it should go in the SAM template. Then SAM can write it to the IIIF function's environment when it's deployed.

I have been evaluating https://github.com/hMatoba/piexifjs... but was wondering if there was a preference?

We have struggled with various tools for reading EXIF data from images in lambdas. The best we've found so far is pretty cumbersome – a full installation of exiftool in a lambda layer which we call out to from nodejs in a subprocess.

That said, if it's just dimension info you're looking for, the existing probe-image-size package does exactly that, over HTTP. In fact, the default implementation uses a signed URL to allow it to access S3 objects over HTTPS.

from serverless-iiif.

mbklein avatar mbklein commented on August 26, 2024

What process are you using to spin it up? It looks like you might have a node_modules directory under build that is built for the wrong architecture, so npm thinks sharp is already installed when it actually needs to be rebuilt for linux x64. But without seeing the steps involved, I can't be sure.

from serverless-iiif.

codeclout avatar codeclout commented on August 26, 2024

@mbklein - thank you!

I made the following edits as a first run of http source support from a forked version of this repo:

Also pointed the src and dependency directories to zip files that were uploaded to S3.... due to errors being generated from the relative path

Lastly, used the standalone template, edited in the first commit in CloudFormation with all of the necessary params.

Thanks in Advance,
Brian

from serverless-iiif.

mbklein avatar mbklein commented on August 26, 2024

Are you trying to publish this to SAR and deploy from there? Or deploying using the command line instructions?

To be honest, I'm not completely familiar with how the command line deploy script works since @orangewolf's edits. I'd recommend reverting codeclout@fd9e580, then running the following from the sam/standalone directory:

$ rm -rf .aws-sam # to remove any existing build artifacts
$ sam build --use-container
$ sam validate
$ sam deploy --guided

When it prompts you for the SharpLayer variable, leave it blank (default) so it'll use the JP2-compatible layer. What region are you deploying in? I'll make sure there's a JP2 layer for that region. (There should be – I think I deployed it to all the North American regions.)

from serverless-iiif.

codeclout avatar codeclout commented on August 26, 2024

@mbklein - Thanks again!

I was trying to deploy from S3... ultimately, if this POC is approved to move out of the sandbox we will need to automate the deployment... although I haven't given a ton of thought to that just yet. Publishing to SAR sounds like a good option. I have an ec2 with permissions to talk to all the things so I'll give the command line build with your recommendations a go.

We are in us-east-1 (GovCloud).

Thanks again for all of your help... highly appreciated!

from serverless-iiif.

mbklein avatar mbklein commented on August 26, 2024

I would recommend against publishing to SAR – it sounds like an extra step that won't be necessary for your use case. Depending on what you use for CI, automated deployments via the sam CLI can be pretty straightforward.

I don't think I have the jp2 sharp layer deployed to any of the govcloud regions but I can look into it. There's a good chance I don't have access to them, though.

from serverless-iiif.

codeclout avatar codeclout commented on August 26, 2024

@mbklein

Would a pull request allowing for the override of the code source via the SAM template be considered? It is a change our broader team needs, but would like to keep the ability to upgrade from SAR.

from serverless-iiif.

mbklein avatar mbklein commented on August 26, 2024

I'd take a look at a PR for overriding the code source as long as the default behavior didn't change, and if it had some good documentation to go with it.

from serverless-iiif.

codeclout avatar codeclout commented on August 26, 2024

@mbklein - I have been periodically working on a pull request that will address not only the code source location of the SAM template, but also HTTP as an alternative data source. I wanted to bring back a couple of decisions for which you may have a preference.

  • Do you have a preference as to where to retrieve the HTTP Source Host string from...? (e.g. - SAM template or Environment)

I was also evaluating EXIF processor modules from NPM that would allow for retrieving dimension metadata from the data returned from the HTTP Source.

Thanks in Advance,
Brian

from serverless-iiif.

codeclout avatar codeclout commented on August 26, 2024

@mbklein - thank you

We moved the HTTP source implementation to Lambda@Edge and for the interest of time, being that the source does not return the image dimensions, have opted to accept the logged warning for image dimensions.

from serverless-iiif.

Related Issues (20)

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.