GithubHelp home page GithubHelp logo

algorithmic-music-exploration / amen-server Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 33 KB

Server to run Amen analysis and return JSON results.

License: BSD 2-Clause "Simplified" License

Python 89.73% Shell 10.27%

amen-server's People

Contributors

tkell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amen-server's Issues

API

I think we need 2 endpoints:

  • POST /audio.
    This is where you upload a track. It returns a URL that you can poll to see if your analysis is done.

  • GET /analysis?id=<some-id>
    This is where you poll to see if your analysis is done. It returns some sort of 50% data if your analysis is still pending, and returns the actual analysis JSON once it is done. If we decide to host audio on S3, the S3 url is in the analysis JSON.

Tests for uploaders

... how do we want to do these? check the interface and the get_url method?

Docker-ness

I've got a version, at simple-tornado-server that has a Dockerfile that works locally. You can also run it locally by running a three-line bash script.

Along the lines of @alnesbit's comments on not wanting to lock ourselves in to AWS or GCP, it seems like maybe the thing to do is to create Readmes / Docker infrastructure to help people run everything from a DIY bash-script version to a massively scaled Docker swarm/stack/wombat/cluster/etc version.

I would like to summon @psobot for his feelings about this, and also for his feelings about running both the webserver and the queue process in the same Docker container vs. running two containers.

(Two containers feels more "correct" to me, but it is also much more work? )

Goals

Basically, we want to recreate something very much like The Echo Nest's track/upload endpoint. This means that:

  • The user should be able to POST audio to the server and get a JSON blob of analysis back.
  • The user may be able to access the audio on some sort of S3-like system so they can use it in JavaScript projects.
  • The analysis may or may not emulate Echo Nest JSON.

It would be super-ideal if things like The Infinite Jukebox could just use our endpoint. May not be possible tho.

Architecture

Less sure about this, but I think that the server takes the audio, puts it on a queue, and then the queue (or two queues?) handle analysis and uploading the audio to S3.

It may also be possible to use some S3 magic here, and post the audio directly to S3 - maybe even use their Lambda stuff?

Better secrets management

We should pass them into the Dockerfile, or in run.sh, rather than in the upload call? Or something like that.

Finish writing tests!

More tests! Don't forget that you may need to mock Amen itself, due to FFMPEG install issues.

Compression

As per @psobot, can we gzip or compress the analysis JSON? And how will this work with remix.js?

Tests + CI

wooo! Let's write some tests and set up Travis

Rate limiting

This is down the road a piece, but it seems like we should be able to say "the queue is full, please wait", when people try to upload a thing.

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.