Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Julia: add windows-cpu build
Browse files Browse the repository at this point in the history
- Julia v0.7
- Julia v1.0
  • Loading branch information
iblislin committed Jan 21, 2019
1 parent e8a2b8b commit 298b6ec
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 63 deletions.
28 changes: 28 additions & 0 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,34 @@ def test_windows_python3_cpu() {
}]
}

def test_windows_julia07_cpu() {
return ['Julia 0.7: CPU Win': {
node(NODE_WINDOWS_CPU) {
ws('workspace/ut-julia07-cpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git_win()
unstash 'windows_package_cpu'
powershell 'ci/windows/test_jl07_cpu.ps1'
}
}
}
}]
}

def test_windows_julia10_cpu() {
return ['Julia 1.0: CPU Win': {
node(NODE_WINDOWS_CPU) {
ws('workspace/ut-julia10-cpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git_win()
unstash 'windows_package_cpu'
powershell 'ci/windows/test_jl10_cpu.ps1'
}
}
}
}]
}

def test_qemu_armv7_cpu() {
return ['ARMv7 QEMU': {
node(NODE_LINUX_CPU) {
Expand Down
8 changes: 5 additions & 3 deletions ci/jenkins/Jenkinsfile_windows_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ utils.main_wrapper(
core_logic: {
utils.parallel_stage('Build', [
custom_steps.compile_windows_cpu()
])
])

utils.parallel_stage('Tests', [
custom_steps.test_windows_python2_cpu(),
custom_steps.test_windows_python3_cpu()
])
custom_steps.test_windows_python3_cpu(),
custom_steps.test_windows_julia07_cpu(),
custom_steps.test_windows_julia10_cpu()
])
}
,
failure_handler: {
Expand Down
54 changes: 54 additions & 0 deletions ci/windows/test_jl07_cpu.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

7z x -y windows_package.7z

# set default output encoding to utf8
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'

$env:MXNET_HOME = [System.IO.Path]::GetFullPath('.\windows_package')
$env:JULIA_URL = "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7.0-win64.exe"
$env:JULIA_DEPOT_PATH = [System.IO.Path]::GetFullPath('.\julia-depot')

$JULIA_DIR = [System.IO.Path]::GetFullPath('.\julia07')
$JULIA = "$JULIA_DIR\bin\julia"

# Download most recent Julia Windows binary
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($env:JULIA_URL, "julia-binary.exe")
if (! $?) { Throw ("Error on downloading Julia Windows binary") }

# Run installer silently, output to C:\julia07\julia
Start-Process -Wait "julia-binary.exe" -ArgumentList "/S /D=$JULIA_DIR"
if (! $?) { Throw ("Error on installing Julia") }

& $JULIA -e "using InteractiveUtils; versioninfo()"

# workaround a bug of Julia 0.7
# use PackageSpec(name = "MXNet", path = "...") if we drop the 0.7 support
Copy-Item -Path .\julia -Recurse -Destination "$env:JULIA_DEPOT_PATH\dev\MXNet"

$src='
using Pkg
Pkg.develop("MXNet")
Pkg.build("MXNet")
Pkg.test("MXNet")
'

$src > .\ci-build.jl
& $JULIA .\ci-build.jl
if (! $?) { Throw ("Error") }
54 changes: 54 additions & 0 deletions ci/windows/test_jl10_cpu.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

7z x -y windows_package.7z

# set default output encoding to utf8
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'

$env:MXNET_HOME = [System.IO.Path]::GetFullPath('.\windows_package')
$env:JULIA_URL = "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.3-win64.exe"
$env:JULIA_DEPOT_PATH = [System.IO.Path]::GetFullPath('.\julia-depot')

$JULIA_DIR = [System.IO.Path]::GetFullPath('.\julia10')
$JULIA = "$JULIA_DIR\bin\julia"

# Download most recent Julia Windows binary
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($env:JULIA_URL, "julia-binary.exe")
if (! $?) { Throw ("Error on downloading Julia Windows binary") }

# Run installer silently, output to C:\julia10\julia
Start-Process -Wait "julia-binary.exe" -ArgumentList "/S /D=$JULIA_DIR"
if (! $?) { Throw ("Error on installing Julia") }

& $JULIA -e "using InteractiveUtils; versioninfo()"

# workaround a bug of Julia 0.7
# use PackageSpec(name = "MXNet", path = "...") if we drop the 0.7 support
Copy-Item -Path .\julia -Recurse -Destination "$env:JULIA_DEPOT_PATH\dev\MXNet"

$src='
using Pkg
Pkg.develop("MXNet")
Pkg.build("MXNet")
Pkg.test("MXNet")
'

$src > .\ci-build.jl
& $JULIA .\ci-build.jl
if (! $?) { Throw ("Error") }
56 changes: 0 additions & 56 deletions julia/appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion julia/deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if HAS_CUDA
if HAS_CUDNN
@info("Found a CuDNN installation.")
end
@info("CUDA_HOME -> $(get(ENV, "CUDA_HOME", nothing))")
@info("CUDA_HOME -> $(get(ENV, "CUDA_HOME", "nothing"))")
else
@info("Did not find a CUDA installation, using CPU-only version of MXNet.")
end
Expand Down
6 changes: 3 additions & 3 deletions julia/src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function get_mnist_ubyte()
filenames = Dict((x[1] => joinpath(mnist_dir, x[2]) for x pairs(filenames)))
if !all(isfile, values(filenames))
cd(mnist_dir) do
mnist_dir = download("http://data.mxnet.io/mxnet/data/mnist.zip", "mnist.zip")
data = download("http://data.mxnet.io/mxnet/data/mnist.zip", "mnist.zip")
try
run(`unzip -u $mnist_dir`)
run(`unzip -u $data`)
catch
try
run(pipe(`7z x $mnist_dir`,stdout = devnull))
run(pipeline(`7z x $data`,stdout = devnull))
catch
error("Extraction Failed:No extraction program found in path")
end
Expand Down

0 comments on commit 298b6ec

Please sign in to comment.