Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
dc88cc39
"sgl-kernel/python/vscode:/vscode.git/clone" did not exist on "f642524fd992ea5116c68830fef2b9afb2981b31"
Unverified
Commit
dc88cc39
authored
Jan 19, 2024
by
Jeffrey Morgan
Committed by
GitHub
Jan 19, 2024
Browse files
use `gzip` for runner embedding (#2067)
parent
62976087
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
13 deletions
+18
-13
llm/generate/gen_common.sh
llm/generate/gen_common.sh
+1
-1
llm/generate/gen_windows.ps1
llm/generate/gen_windows.ps1
+4
-4
llm/payload_common.go
llm/payload_common.go
+13
-7
scripts/rh_linux_deps.sh
scripts/rh_linux_deps.sh
+0
-1
No files found.
llm/generate/gen_common.sh
View file @
dc88cc39
...
...
@@ -84,7 +84,7 @@ compress_libs() {
echo
"Compressing payloads to reduce overall binary size..."
pids
=
""
for
lib
in
${
BUILD_DIR
}
/lib/
*
.
${
LIB_EXT
}*
;
do
b
zip
2
-
v9
${
lib
}
&
g
zip
-
-best
${
lib
}
&
pids+
=
"
$!
"
done
echo
...
...
llm/generate/gen_windows.ps1
View file @
dc88cc39
...
...
@@ -23,7 +23,7 @@ function init_vars {
}
else
{
$
script
:
CUDA_LIB_DIR
=
$
env
:
CUDA_LIB_DIR
}
$
script
:
B
ZIP
2
=
(
get-command
-ea
'silentlycontinue'
b
zip
2
)
.
path
$
script
:
G
ZIP
=
(
get-command
-ea
'silentlycontinue'
g
zip
)
.
path
$
script
:
DUMPBIN
=
(
get-command
-ea
'silentlycontinue'
dumpbin
)
.
path
}
...
...
@@ -69,14 +69,14 @@ function install {
}
function
compress_libs
{
if
(
$
script
:
B
ZIP
2
-eq
$null
)
{
write-host
"
b
zip
2
not installed, not compressing files"
if
(
$
script
:
G
ZIP
-eq
$null
)
{
write-host
"
g
zip not installed, not compressing files"
return
}
write-host
"Compressing dlls..."
$libs
=
dir
"
${script:buildDir}
/lib/*.dll"
foreach
(
$file
in
$libs
)
{
&
"
$
script
:
B
ZIP
2
"
-
v9
$file
&
"
$
script
:
G
ZIP
"
-
-best
$file
}
}
...
...
llm/payload_common.go
View file @
dc88cc39
package
llm
import
(
"compress/
b
zip
2
"
"compress/
g
zip"
"errors"
"fmt"
"io"
...
...
@@ -182,9 +182,12 @@ func extractDynamicLibs(workDir, glob string) ([]string, error) {
}
src
:=
io
.
Reader
(
srcFile
)
filename
:=
file
if
strings
.
HasSuffix
(
file
,
".bz2"
)
{
src
=
bzip2
.
NewReader
(
src
)
filename
=
strings
.
TrimSuffix
(
filename
,
".bz2"
)
if
strings
.
HasSuffix
(
file
,
".gz"
)
{
src
,
err
=
gzip
.
NewReader
(
src
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"decompress payload %s: %v"
,
file
,
err
)
}
filename
=
strings
.
TrimSuffix
(
filename
,
".gz"
)
}
destFile
:=
filepath
.
Join
(
targetDir
,
filepath
.
Base
(
filename
))
...
...
@@ -229,9 +232,12 @@ func extractPayloadFiles(workDir, glob string) error {
}
src
:=
io
.
Reader
(
srcFile
)
filename
:=
file
if
strings
.
HasSuffix
(
file
,
".bz2"
)
{
src
=
bzip2
.
NewReader
(
src
)
filename
=
strings
.
TrimSuffix
(
filename
,
".bz2"
)
if
strings
.
HasSuffix
(
file
,
".gz"
)
{
src
,
err
=
gzip
.
NewReader
(
src
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"decompress payload %s: %v"
,
file
,
err
)
}
filename
=
strings
.
TrimSuffix
(
filename
,
".gz"
)
}
destFile
:=
filepath
.
Join
(
workDir
,
filepath
.
Base
(
filename
))
...
...
scripts/rh_linux_deps.sh
View file @
dc88cc39
...
...
@@ -28,7 +28,6 @@ fi
if
[
-n
"
${
CMAKE_VERSION
}
"
]
;
then
curl
-s
-L
https://github.com/Kitware/CMake/releases/download/v
${
CMAKE_VERSION
}
/cmake-
${
CMAKE_VERSION
}
-linux-
$(
uname
-m
)
.tar.gz |
tar
-zx
-C
/usr
--strip-components
1
dnf
install
-y
bzip2
fi
if
[
-n
"
${
GOLANG_VERSION
}
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment