update the test_gitea
All checks were successful
Test Gitea Secrets / print-secret (push) Successful in 50s
All checks were successful
Test Gitea Secrets / print-secret (push) Successful in 50s
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import modal
|
||||
import subprocess
|
||||
|
||||
# 1. Define the App
|
||||
app = modal.App("hello-world-build-worker")
|
||||
|
||||
# 2. Define a clean container image representing your worker environment
|
||||
image = modal.Image.debian_slim().pip_install("requests")
|
||||
|
||||
# 3. Define the worker function
|
||||
@app.function(
|
||||
image=image,
|
||||
# This keeps the worker container alive for 5 minutes after finishing,
|
||||
# so subsequent runs start instantly (avoiding cold starts).
|
||||
scaledown_window=300
|
||||
)
|
||||
def run_worker_job():
|
||||
print("--- WORKER CONTAINER STARTED ---")
|
||||
|
||||
# Mimic fetching project files or setting up environment variables
|
||||
test_env_var = "Lumina-Build-Sandbox"
|
||||
print(f"Environment initialized. Target deployment: {test_env_var}")
|
||||
|
||||
# Run a simple shell command inside the container to mimic building/testing
|
||||
print("Running build script simulation...")
|
||||
result = subprocess.run(
|
||||
["echo", "Hello World! Your Modal container is successfully building your Python app."],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
|
||||
print(f"Build output: {result.stdout.strip()}")
|
||||
print("--- WORKER JOB COMPLETED SUCCESSFULLY ---")
|
||||
Reference in New Issue
Block a user