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
616c5eaf
Unverified
Commit
616c5eaf
authored
Sep 20, 2024
by
Daniel Hiltgen
Committed by
GitHub
Sep 20, 2024
Browse files
CI: win arm adjustments (#6898)
parent
f5ff917b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
.github/workflows/release.yaml
.github/workflows/release.yaml
+2
-0
scripts/build_windows.ps1
scripts/build_windows.ps1
+18
-7
No files found.
.github/workflows/release.yaml
View file @
616c5eaf
...
@@ -291,6 +291,7 @@ jobs:
...
@@ -291,6 +291,7 @@ jobs:
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install -y --no-progress git gzip
choco install -y --no-progress git gzip
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\ProgramData\chocolatey\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
-
name
:
Install Visual Studio
2022
-
name
:
Install Visual Studio
2022
run
:
|
run
:
|
$components = @(
$components = @(
...
@@ -389,6 +390,7 @@ jobs:
...
@@ -389,6 +390,7 @@ jobs:
$env:CMAKE_SYSTEM_VERSION="10.0.22621.0"
$env:CMAKE_SYSTEM_VERSION="10.0.22621.0"
$env:PATH="$gopath;$gccpath;$env:PATH;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
$env:PATH="$gopath;$gccpath;$env:PATH;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
echo $env:PATH
echo $env:PATH
$env:ARCH="arm64"
.\scripts\build_windows.ps1 buildOllama buildApp gatherDependencies distZip
.\scripts\build_windows.ps1 buildOllama buildApp gatherDependencies distZip
name
:
'
Windows
Build'
name
:
'
Windows
Build'
-
uses
:
actions/upload-artifact@v4
-
uses
:
actions/upload-artifact@v4
...
...
scripts/build_windows.ps1
View file @
616c5eaf
...
@@ -7,7 +7,17 @@
...
@@ -7,7 +7,17 @@
$Error
ActionPreference
=
"Stop"
$Error
ActionPreference
=
"Stop"
function
checkEnv
()
{
function
checkEnv
()
{
$
script
:
ARCH
=
(([
System.Runtime.InteropServices.RuntimeInformation
]::
OSArchitecture
)
.
ToString
()
.
ToLower
())
.
Replace
(
"x64"
,
"amd64"
)
if
(
$null
-ne
$
env
:
ARCH
)
{
$
script
:
ARCH
=
$
env
:
ARCH
}
else
{
$arch
=
([
System.Runtime.InteropServices.RuntimeInformation
]::
OSArchitecture
)
if
(
$null
-ne
$arch
)
{
$
script
:
ARCH
=
(
$arch
.
ToString
()
.
ToLower
())
.
Replace
(
"x64"
,
"amd64"
)
}
else
{
write-host
"WARNING: old powershell detected, assuming amd64 architecture - set
`$
env:ARCH to override"
$
script
:
ARCH
=
"amd64"
}
}
$
script
:
TARGET_ARCH
=
$
script
:
ARCH
$
script
:
TARGET_ARCH
=
$
script
:
ARCH
Write-host
"Building for
${script:TARGET_ARCH}
"
Write-host
"Building for
${script:TARGET_ARCH}
"
write-host
"Locating required tools and paths"
write-host
"Locating required tools and paths"
...
@@ -70,7 +80,6 @@ function checkEnv() {
...
@@ -70,7 +80,6 @@ function checkEnv() {
function
buildOllama
()
{
function
buildOllama
()
{
write-host
"Building ollama CLI"
if
(
$null
-eq
${env:OLLAMA_SKIP_GENERATE}
)
{
if
(
$null
-eq
${env:OLLAMA_SKIP_GENERATE}
)
{
Remove-Item
-ea
0
-recurse
-force
-path
"
${script:SRC_DIR}
\dist\windows-
${script:ARCH}
"
Remove-Item
-ea
0
-recurse
-force
-path
"
${script:SRC_DIR}
\dist\windows-
${script:ARCH}
"
...
@@ -78,15 +87,16 @@ function buildOllama() {
...
@@ -78,15 +87,16 @@ function buildOllama() {
# which targets to build
# which targets to build
# Start by skipping CUDA to build everything else
# Start by skipping CUDA to build everything else
pwsh
-Command
{
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
"1"
;
&
go
generate
.
/...
}
write-host
"Building ollama runners"
powershell
-Command
{
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
"1"
;
&
go
generate
.
/...
}
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
# Then skip everyhting else and build all the CUDA variants
# Then skip everyhting else and build all the CUDA variants
foreach
(
$
env
:
CUDA_LIB_DIR
in
$
script
:
CUDA_DIRS
)
{
foreach
(
$
env
:
CUDA_LIB_DIR
in
$
script
:
CUDA_DIRS
)
{
write-host
"Building CUDA
${env:CUDA_LIB_DIR}
"
write-host
"Building CUDA
${env:CUDA_LIB_DIR}
runner
"
if
(
$
env
:
CUDA_LIB_DIR
.
Contains
(
"v12"
))
{
if
(
$
env
:
CUDA_LIB_DIR
.
Contains
(
"v12"
))
{
p
wsh
-Command
{
p
owershell
-Command
{
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
""
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
""
$
env
:
OLLAMA_SKIP_STATIC_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_STATIC_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_CPU_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_CPU_GENERATE
=
"1"
...
@@ -99,7 +109,7 @@ function buildOllama() {
...
@@ -99,7 +109,7 @@ function buildOllama() {
&
go
generate
.
/...
&
go
generate
.
/...
}
}
}
else
{
}
else
{
p
wsh
-Command
{
p
owershell
-Command
{
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
""
$
env
:
OLLAMA_SKIP_CUDA_GENERATE
=
""
$
env
:
OLLAMA_SKIP_STATIC_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_STATIC_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_CPU_GENERATE
=
"1"
$
env
:
OLLAMA_SKIP_CPU_GENERATE
=
"1"
...
@@ -118,6 +128,7 @@ function buildOllama() {
...
@@ -118,6 +128,7 @@ function buildOllama() {
}
else
{
}
else
{
write-host
"Skipping generate step with OLLAMA_SKIP_GENERATE set"
write-host
"Skipping generate step with OLLAMA_SKIP_GENERATE set"
}
}
write-host
"Building ollama CLI"
&
go
build
-trimpath
-ldflags
"-s -w -X=github.com/ollama/ollama/version.Version=
$
script
:
VERSION
-X=github.com/ollama/ollama/server.mode=release"
.
&
go
build
-trimpath
-ldflags
"-s -w -X=github.com/ollama/ollama/version.Version=
$
script
:
VERSION
-X=github.com/ollama/ollama/server.mode=release"
.
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
"
${env:KEY_CONTAINER}
"
)
{
if
(
"
${env:KEY_CONTAINER}
"
)
{
...
@@ -137,7 +148,7 @@ function buildApp() {
...
@@ -137,7 +148,7 @@ function buildApp() {
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
"
${env:KEY_CONTAINER}
"
)
{
if
(
"
${env:KEY_CONTAINER}
"
)
{
&
"
${script:SignTool}
"
sign
/v
/fd
sha256
/t
http://timestamp.digicert.com
/f
"
${script:OLLAMA_CERT}
"
`
&
"
${script:SignTool}
"
sign
/v
/fd
sha256
/t
http://timestamp.digicert.com
/f
"
${script:OLLAMA_CERT}
"
`
/csp
"Google Cloud KMS Provider"
/kc
${env:KEY_CONTAINER}
app.exe
/csp
"Google Cloud KMS Provider"
/kc
${env:KEY_CONTAINER}
"
${script:SRC_DIR}
\dist\windows-
${script:TARGET_ARCH}
-
app.exe
"
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
if
(
$LASTEXITCODE
-ne
0
)
{
exit
(
$LASTEXITCODE
)}
}
}
}
}
...
...
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