Git Product home page Git Product logo

google-cloud-functions-system-packages's Introduction

Examples of using system and custom programs in Google Cloud Functions

List of cloud functions to demonstrate possibilities to use Unix and compiled programs in Cloud Functions:

  1. cf_ascii - using figlet http://www.figlet.org/ compiled C program which converts text to ASCII text. Input request with parameter contains text which should be converted to ASCII
  2. cf_pdf2png - using provided ghostscript program to convert PDF file to PNG images (1 page -> 1 image)
  3. cf_system - executing various system commands to explore system within Cloud Functions, like displaying all binaries, executing commands.

More information can be found in this article Using system packages and custom binaries in Google Cloud Functions.

google-cloud-functions-system-packages's People

Contributors

zdenulo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

google-cloud-functions-system-packages's Issues

Permission denied in subprocess

Thanks for a great article and examples!

I have cloned the repo and deployed cf_ascii to GCF, but I get an error when calling the function:

Traceback (most recent call last):
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 346, in run_http_function
result = _function_handler.invoke_user_function(flask.request)
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 217, in invoke_user_function
return call_user_function(request_or_event)
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 210, in call_user_function
return self._user_function(request_or_event)
File "/user_code/main.py", line 15, in main
p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
File "/opt/python3.7/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/opt/python3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: './figlet'

Seems like subprocess cannot access figlet. Am I missing something?

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.