mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-06 02:32:40 +00:00
test
This commit is contained in:
parent
d97bcaf625
commit
6cac92cfa3
2 changed files with 16 additions and 6 deletions
1
.github/workflows/publish-to-docker.yml
vendored
1
.github/workflows/publish-to-docker.yml
vendored
|
@ -26,5 +26,6 @@ jobs:
|
||||||
- name: Custom build docker image
|
- name: Custom build docker image
|
||||||
run: |
|
run: |
|
||||||
pip install --no-cache --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ llama-stack==0.0.63.dev20250114
|
pip install --no-cache --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ llama-stack==0.0.63.dev20250114
|
||||||
|
pip install -e .
|
||||||
TESTPYPI_VERSION=0.0.63.dev20250114 llama stack build --template ollama --image-type docker
|
TESTPYPI_VERSION=0.0.63.dev20250114 llama stack build --template ollama --image-type docker
|
||||||
docker images
|
docker images
|
||||||
|
|
|
@ -22,7 +22,11 @@ log = logging.getLogger(__name__)
|
||||||
def run_with_pty(command):
|
def run_with_pty(command):
|
||||||
master, slave = pty.openpty()
|
master, slave = pty.openpty()
|
||||||
|
|
||||||
old_settings = termios.tcgetattr(sys.stdin)
|
# Check if stdin is actually a terminal
|
||||||
|
is_terminal = sys.stdin.isatty()
|
||||||
|
if is_terminal:
|
||||||
|
old_settings = termios.tcgetattr(sys.stdin)
|
||||||
|
|
||||||
original_sigint = signal.getsignal(signal.SIGINT)
|
original_sigint = signal.getsignal(signal.SIGINT)
|
||||||
|
|
||||||
ctrl_c_pressed = False
|
ctrl_c_pressed = False
|
||||||
|
@ -36,10 +40,14 @@ def run_with_pty(command):
|
||||||
# Set up the signal handler
|
# Set up the signal handler
|
||||||
signal.signal(signal.SIGINT, sigint_handler)
|
signal.signal(signal.SIGINT, sigint_handler)
|
||||||
|
|
||||||
new_settings = termios.tcgetattr(sys.stdin)
|
# Only modify terminal settings if we're actually in a terminal
|
||||||
new_settings[3] = new_settings[3] & ~termios.ECHO # Disable echo
|
if is_terminal:
|
||||||
new_settings[3] = new_settings[3] & ~termios.ICANON # Disable canonical mode
|
new_settings = termios.tcgetattr(sys.stdin)
|
||||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, new_settings)
|
new_settings[3] = new_settings[3] & ~termios.ECHO # Disable echo
|
||||||
|
new_settings[3] = (
|
||||||
|
new_settings[3] & ~termios.ICANON
|
||||||
|
) # Disable canonical mode
|
||||||
|
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, new_settings)
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
|
@ -86,7 +94,8 @@ def run_with_pty(command):
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
# Clean up
|
# Clean up
|
||||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_settings)
|
if is_terminal:
|
||||||
|
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_settings)
|
||||||
signal.signal(signal.SIGINT, original_sigint)
|
signal.signal(signal.SIGINT, original_sigint)
|
||||||
|
|
||||||
os.close(master)
|
os.close(master)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue