Giter Site home page Giter Site logo

serverless-audio-processing's Introduction

Serverless audio transcription with Python on IBM Cloud

This repository contains everything needed to deploy a serverless Python function for processing and transcribing audio at IBM Cloud.

Requirements

Tools

IBM Cloud services used

[OPTIONAL] building a custom Docker image for your serverless function

IBM Cloud Functions accepts any kind of Docker image as custom runtime for your functions, albeit you can only use images from public registries, such as an image that is publicly available on Docker Hub. Private registries are not supported.

In this example we will be using a custom Dockerfile with some Python libraries installed. This Docker image is publicly hosted on vnderlev/custom-py-wsk:v5, so building it is not required.

Nevertheless, to build an image and deploy it on Docker Hub you need to run the following commands:

login into Docker Hub

docker login -u <dockerhub_username> -p <dockerhub_password>

building a Docker image from a Dockerfile

docker build <dockerfile_directory> -t <dockerhub_username>/<repository_name>:<tag_name>

pushing a Docker image to Docker Hub

docker push <dockerhub_username>/<repo_name>:<tag_name>

Managing Web actions with the IBM Cloud CLI

The IBM Cloud CLI plugin for working with OpenWhisk allow us to use "wsk" commands to create, deploy and debug any kind of serverless function into IBM Cloud. Below some useful commands are presented.

Deleting an existing Web action

ibmcloud wsk action delete <action_name>

Creating a raw Web action on IBM Cloud using a custom Dockerfile

ibmcloud wsk action create <action_name> --docker <dockerhub_username>/<image_name> <src_code_file> --web raw

Updating a raw Web action on IBM Cloud using a custom Dockerfile

ibmcloud wsk action update <action_name> --docker <dockerhub_username>/<image_name> <src_code_file> --web raw

Extracting the URL endpoint of the encapsulated serverless function

ibmcloud wsk action get <action_name> --url

Testing the deployed Web action with cURL

curl -F text=foo -F audio=@audio_sample.flac <action_url_endpoint>.json

Listing previous OpenWhisk activations

ibmcloud wsk activation list

You can get details about a specific activation record that resulted from an action invocation by running the following command. Replace <activation_id> with the id of the activation.

ibmcloud wsk activation get <activation_id>

Read more at: https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_web#actions_web_example

serverless-audio-processing's People

Contributors

vanderlei-filho avatar

Watchers

James Cloos avatar  avatar

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.