-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: upload model on podman machine on WSL to speed loading (#204)
* fix: upload model on podman machine on WSL to speed loading Signed-off-by: lstocchi <[email protected]> * fix: add tests Signed-off-by: lstocchi <[email protected]> * fix: get running machine name and use it on podman cp/stat Signed-off-by: lstocchi <[email protected]> * fix: fix lint, format and add tests Signed-off-by: lstocchi <[email protected]> * fix: use machine name to execute podman cli Signed-off-by: lstocchi <[email protected]> * fix: fix tests and reorganize based on review Signed-off-by: lstocchi <[email protected]> * fix: rename progressiveEvent Signed-off-by: lstocchi <[email protected]> * fix: show error if failing Signed-off-by: lstocchi <[email protected]> * fix: calculate machine name from running connection Signed-off-by: lstocchi <[email protected]> * fix: update remote path where to store uploaded model Signed-off-by: lstocchi <[email protected]> --------- Signed-off-by: lstocchi <[email protected]>
- Loading branch information
Showing
16 changed files
with
765 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
export interface BaseEvent { | ||
id: string; | ||
status: 'error' | 'completed' | 'progress' | 'canceled'; | ||
message?: string; | ||
} | ||
|
||
export interface CompletionEvent extends BaseEvent { | ||
status: 'completed' | 'error' | 'canceled'; | ||
duration: number; | ||
} | ||
|
||
export interface ProgressEvent extends BaseEvent { | ||
status: 'progress'; | ||
value: number; | ||
} | ||
|
||
export const isCompletionEvent = (value: unknown): value is CompletionEvent => { | ||
return ( | ||
!!value && | ||
typeof value === 'object' && | ||
'status' in value && | ||
typeof value['status'] === 'string' && | ||
['canceled', 'completed', 'error'].includes(value['status']) | ||
); | ||
}; | ||
|
||
export const isProgressEvent = (value: unknown): value is ProgressEvent => { | ||
return ( | ||
!!value && typeof value === 'object' && 'status' in value && value['status'] === 'progress' && 'value' in value | ||
); | ||
}; |
Oops, something went wrong.