AC
AC
RRunPod
Created by AC on 10/1/2024 in #⚡|serverless
My serverless worker is stuck in initializing.
No description
3 replies
RRunPod
Created by AC on 6/8/2024 in #⚡|serverless
JS pupeteer issue
Hi, I have a pupeteer chromium task that i want to run on the runpod which is written in typescript. I did not see any JS handler. So, i am calling the JS entrypoint via python as below.
""" Example handler file. """

import runpod
from subprocess import call
import os

# If your handler runs inference on a model, load the model here.
# You will want models to be loaded into memory before starting serverless.


def handler(job):
""" Handler function that will be used to process jobs. """
job_input = job['input']

prompt_id = job_input.get('aiPromptId')
video_save_path = job_input.get('videoSavePath')

# Create a copy of the current environment variables
env = os.environ.copy()

# Add or update the required environment variables
env['AI_PROMPT_ID'] = prompt_id
env['VIDEO_SAVE_PATH'] = video_save_path
print("env", env)

print("Running the executeDockerCommand")
# env['NODE_ENV'] = 'development'

call(["yarn", "ts-node", "src/backend/executeDockerCommand.ts"], env=env)

print("Finish running the command")

return f"Hello, {prompt_id}!"


runpod.serverless.start({"handler": handler})
""" Example handler file. """

import runpod
from subprocess import call
import os

# If your handler runs inference on a model, load the model here.
# You will want models to be loaded into memory before starting serverless.


def handler(job):
""" Handler function that will be used to process jobs. """
job_input = job['input']

prompt_id = job_input.get('aiPromptId')
video_save_path = job_input.get('videoSavePath')

# Create a copy of the current environment variables
env = os.environ.copy()

# Add or update the required environment variables
env['AI_PROMPT_ID'] = prompt_id
env['VIDEO_SAVE_PATH'] = video_save_path
print("env", env)

print("Running the executeDockerCommand")
# env['NODE_ENV'] = 'development'

call(["yarn", "ts-node", "src/backend/executeDockerCommand.ts"], env=env)

print("Finish running the command")

return f"Hello, {prompt_id}!"


runpod.serverless.start({"handler": handler})
The above code works fine locally. But, when i deploy to serverless, it kicks off the yarn ts-node ... , but gets stuck and does not emit any logs and eventually times out. Any advice?
43 replies