Skip to content

Commit 63119d5

Browse files
committed
Use runner image from env
1 parent 47aeb23 commit 63119d5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/runner-docker-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- "v*"
79

810
env:
911
REGISTRY: ghcr.io

llmstack/cli.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,20 @@ def start_runner(environment):
9999
print('Starting LLMStack Runner')
100100
client = docker.from_env()
101101
runner_container = None
102+
image_name = environment.get(
103+
'RUNNER_IMAGE_NAME', 'ghcr.io/trypromptly/llmstack-runner')
104+
image_tag = environment.get('RUNNER_IMAGE_TAG', 'main')
105+
106+
# Pull image if not already pulled
107+
for line in client.api.pull(image_name, tag=image_tag, stream=True, decode=True):
108+
if 'progress' in line and 'id' in line:
109+
print(
110+
f'[llmstack-runner] Pulling {line["id"][:12]} {line["progress"]}', end='\r')
111+
102112
try:
103113
runner_container = client.containers.get('llmstack-runner')
104114
except docker.errors.NotFound:
105-
runner_container = client.containers.run('llmstack-runner', name='llmstack-runner',
115+
runner_container = client.containers.run(f'{image_name}:{image_tag}', name='llmstack-runner',
106116
ports={
107117
'50051/tcp': os.environ['RUNNER_PORT'], '50052/tcp': os.environ['RUNNER_WSS_PORT']},
108118
detach=True, remove=True, environment=environment,)

0 commit comments

Comments
 (0)