Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
matrix:
version:
- '1.11'
- '1.12'
os:
- ubuntu-latest
arch:
Expand All @@ -35,14 +36,15 @@ jobs:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
include-all-prereleases: true
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Run tests
env:
RXINFER_SERVER_ENABLE_DEBUG_LOGGING: ${{ github.event_name == 'workflow_dispatch' }}
TRACE_COMPILE_PATH: ${{ github.workspace }}/server-compilation-trace.jl
TRACE_COMPILE_PATH: ${{ github.workspace }}/julia-${{ matrix.version }}-compilation-trace.jl
run: |
# Start the docker compose environment
make docker-start
Expand All @@ -64,11 +66,20 @@ jobs:
# Exit with the test exit code
exit $TEST_EXIT_CODE

- name: Upload trace compilation artifact
- name: Upload Julia-specific trace compilation artifact
uses: actions/upload-artifact@v4
with:
name: julia-${{ matrix.version }}-compilation-trace
path: julia-${{ matrix.version }}-compilation-trace.jl
retention-days: 30
if-no-files-found: warn

- name: Upload backward-compatible trace compilation artifact
if: matrix.version == '1.11'
uses: actions/upload-artifact@v5
with:
name: server-compilation-trace
path: server-compilation-trace.jl
path: julia-1.11-compilation-trace.jl
retention-days: 30
if-no-files-found: warn

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ LinearAlgebra = "1.11.0"
Logging = "1.11.0"
LoggingExtras = "1.1.0"
MiniLoggers = "0.5.3"
Mongoc = "0.9.2"
Mongoc = "0.9.2, 0.10"
Pkg = "1.11.0"
Random = "1.11.0"
Revise = "3.7.2"
Expand Down
19 changes: 15 additions & 4 deletions src/hotreload.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,21 @@ function hot_reload_task_models(server::ServerState)
locations = vcat(locations, [Models.RXINFER_SERVER_TEST_MODELS_LOCATION()])
end

hot_reload_models_locations = [
joinpath(root, file) for location in locations for (root, _, files) in walkdir(location) if isdir(location) for
file in files
]
# Double check that the specified locations are valid
hot_reload_models_locations = []
for location in filter(isdir, locations)
for (root, _, files) in walkdir(location)
for file in files
model_location = joinpath(root, file)
push!(hot_reload_models_locations, model_location)
@warn "[HOT-RELOAD] Adding model location `$(model_location)` to the hot reload task" _id = :hot_reload
end
end
end

@warn "[HOT-RELOAD] Model locations have been loaded, any new models will NOT be tracked, restart the server to track new models" _id =
:hot_reload

return hot_reload_task(:models, server, hot_reload_models_locations, []; all = false) do
Models.reload!(Models.get_models_dispatcher())
@warn "[HOT-RELOAD] Models have been reloaded" _id = :hot_reload
Expand Down
2 changes: 1 addition & 1 deletion src/tags/Models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ function __database_op_get_model_instance(; token, instance_id)
end

if !isnothing(result)
result = Dict(result)
result = Mongoc.as_dict(result)
# Deserialize the state if it exists and in binary format
if haskey(result, "state") && isa(result["state"], Vector{UInt8})
result["state"] = Models.deserialize_state(result["state"])
Expand Down
Loading