Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 231e62291c | |||
| 57ac666598 | |||
| 69728301f5 | |||
| c176fa70f1 |
@@ -36,6 +36,11 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
|
push_to_ghcr:
|
||||||
|
description: "Push images to ghcr.io"
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -116,7 +121,7 @@ jobs:
|
|||||||
docker/unified/build-image.sh --${{ matrix.backend }}
|
docker/unified/build-image.sh --${{ matrix.backend }}
|
||||||
|
|
||||||
- name: Push to GitHub Container Registry
|
- name: Push to GitHub Container Registry
|
||||||
if: ${{ !env.ACT }}
|
if: ${{ !env.ACT && inputs.push_to_ghcr == true }}
|
||||||
run: |
|
run: |
|
||||||
BASE_TAG="ghcr.io/mostlygeek/llama-swap:unified-${{ matrix.backend }}"
|
BASE_TAG="ghcr.io/mostlygeek/llama-swap:unified-${{ matrix.backend }}"
|
||||||
DATE_TAG=$(date -u +%Y-%m-%d)
|
DATE_TAG=$(date -u +%Y-%m-%d)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
build-essential cmake git python3 python3-pip libssl-dev \
|
build-essential cmake git python3 python3-pip libssl-dev \
|
||||||
curl ca-certificates ccache make wget software-properties-common \
|
curl ca-certificates ccache make wget software-properties-common \
|
||||||
libvulkan-dev glslang-tools spirv-tools vulkan-validationlayers glslc \
|
libvulkan-dev glslang-tools spirv-tools vulkan-validationlayers glslc \
|
||||||
|
spirv-headers \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|||||||
+2
-2
@@ -297,7 +297,7 @@ func (m *Matrix) Shutdown() {
|
|||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunningModels returns model names currently in StateReady.
|
// RunningModels returns model names currently in an active (non-stopped) state.
|
||||||
func (m *Matrix) RunningModels() []string {
|
func (m *Matrix) RunningModels() []string {
|
||||||
m.Lock()
|
m.Lock()
|
||||||
defer m.Unlock()
|
defer m.Unlock()
|
||||||
@@ -308,7 +308,7 @@ func (m *Matrix) RunningModels() []string {
|
|||||||
func (m *Matrix) runningModels() []string {
|
func (m *Matrix) runningModels() []string {
|
||||||
var running []string
|
var running []string
|
||||||
for id, process := range m.processes {
|
for id, process := range m.processes {
|
||||||
if process.CurrentState() == StateReady {
|
if process.CurrentState() != StateStopped && process.CurrentState() != StateShutdown {
|
||||||
running = append(running, id)
|
running = append(running, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-4
@@ -432,7 +432,10 @@ func (p *Process) start() error {
|
|||||||
|
|
||||||
// Stop will wait for inflight requests to complete before stopping the process.
|
// Stop will wait for inflight requests to complete before stopping the process.
|
||||||
func (p *Process) Stop() {
|
func (p *Process) Stop() {
|
||||||
|
|
||||||
|
// guard to prevent multiple goroutines from stopping
|
||||||
if !isValidTransition(p.CurrentState(), StateStopping) {
|
if !isValidTransition(p.CurrentState(), StateStopping) {
|
||||||
|
p.proxyLogger.Debugf("<%s> Stop() suppressing invalid transition from %s to StateStopping", p.ID, p.CurrentState())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,13 +448,17 @@ func (p *Process) Stop() {
|
|||||||
// StopImmediately will transition the process to the stopping state and stop the process with a SIGTERM.
|
// StopImmediately will transition the process to the stopping state and stop the process with a SIGTERM.
|
||||||
// If the process does not stop within the specified timeout, it will be forcefully stopped with a SIGKILL.
|
// If the process does not stop within the specified timeout, it will be forcefully stopped with a SIGKILL.
|
||||||
func (p *Process) StopImmediately() {
|
func (p *Process) StopImmediately() {
|
||||||
if !isValidTransition(p.CurrentState(), StateStopping) {
|
|
||||||
|
// guard to prevent multiple goroutines from stopping the process
|
||||||
|
enterState := p.CurrentState()
|
||||||
|
if !isValidTransition(enterState, StateStopping) {
|
||||||
|
p.proxyLogger.Debugf("<%s> StopImmediate() suppressing invalid transition from %s to StateStopping", p.ID, p.CurrentState())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.proxyLogger.Debugf("<%s> Stopping process, current state: %s", p.ID, p.CurrentState())
|
p.proxyLogger.Debugf("<%s> Stopping process, enter state: %s", p.ID, enterState)
|
||||||
if curState, err := p.swapState(StateReady, StateStopping); err != nil {
|
if curState, err := p.swapState(enterState, StateStopping); err != nil {
|
||||||
p.proxyLogger.Infof("<%s> Stop() Ready -> StateStopping err: %v, current state: %v", p.ID, err, curState)
|
p.proxyLogger.Infof("<%s> Stop() %s -> StateStopping err: %v, current state: %v", p.ID, enterState, err, curState)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user