Git Product home page Git Product logo

Comments (3)

alexellis avatar alexellis commented on May 24, 2024

Hi @prateeumich of course, you can do whatever you want in a Dockerfile.

Can you share what do you have so far?

What programming language are you trying to use? Python?

from faas.

prateeumich avatar prateeumich commented on May 24, 2024

this is my dockerfile

**FROM ghcr.io/openfaas/classic-watchdog:0.2.3 as watchdog

FROM tensorflow/tensorflow:latest-gpu

RUN mkdir -p /home/app

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

Add non root user

#RUN addgroup -S app && adduser app -S -G app

Add non root user

RUN groupadd -r app && useradd -r -g app app

RUN chown app /home/app
COPY program.py .

WORKDIR /home/app

USER app

Populate example here - i.e. "cat", "sha512sum" or "node index.js"

ENV fprocess="cat"

Set to true to see request in function logs

ENV write_debug="false"

EXPOSE 8080

HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1

CMD ["fwatchdog"]**

I have written a matmul program using tensorflow and python

import tensorflow as tf

# Check if GPU is available
if tf.test.is_gpu_available():
    print("GPU is available")
else:
    print("GPU is NOT available")

# Define a simple TensorFlow computation graph
a = tf.constant(3.0)
b = tf.constant(4.0)
c = tf.add(a, b)

# Create a TensorFlow session
with tf.Session() as sess:
    # Execute the computation graph
    result = sess.run(c)
    print("Result:", result)

I was able to up the function but when I was invoking the function there was no output in the command line

Faas

from faas.

prateeumich avatar prateeumich commented on May 24, 2024

Also, when is the copy step correct or is it why it isn't running the program?

from faas.

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.