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:
@@ -5,11 +5,9 @@ jobs:
|
|||||||
print-secret:
|
print-secret:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Print Secret
|
- name: test modal worker pipeline
|
||||||
env:
|
uses: actions/checkout@v4
|
||||||
# Map the Gitea secret to an environment variable
|
with:
|
||||||
MY_TEST_SECRET: ${{ secrets.MODAL_KEY }}
|
sparse-checkout: |
|
||||||
run: |
|
cd workspace/sprint_1_2/CODEBASE/deps/implementation
|
||||||
# Use 'echo' to print the variable
|
modal deploy test_worker.py
|
||||||
# Gitea will automatically mask the actual value if it matches a secret
|
|
||||||
echo "The secret value is: $MY_TEST_SECRET"
|
|
||||||
@@ -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