Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Add first build
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack committed Mar 2, 2021
1 parent 9d1f715 commit 2ff0bf1
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
["densenet121.bson"]
git-tree-sha1 = "ffc7f7ed1e7f67baca4b76f6c100e0d5042ff063"
lazy = true

[["densenet121.bson".download]]
sha256 = "9bf4c85ab1c6d5a1bd05c693c71323e2d1363bb31e03a774d2e01f935cd648a8"
url = "https://github.com/darsnack/MetalheadWeights/releases/download/v0.1.0/densenet121.bson-0.1.0.tar.gz"

["googlenet.bson"]
git-tree-sha1 = "56cc81845fcca30508fe81da18c7ba0d96d72cdd"
lazy = true

[["googlenet.bson".download]]
sha256 = "4f29624b03b59e955a0830897c25eb7245549d9714438b36d5ce0ee835b0304f"
url = "https://github.com/darsnack/MetalheadWeights/releases/download/v0.1.0/googlenet.bson-0.1.0.tar.gz"

["resnet50.bson"]
git-tree-sha1 = "ea3effeaf1ea3969ed5c609f5db5cd0e456ce799"
lazy = true

[["resnet50.bson".download]]
sha256 = "5bf4a0a5117aaee660844ef42abff0ffce3c00462b384c4b6ca6a712627b7d81"
url = "https://github.com/darsnack/MetalheadWeights/releases/download/v0.1.0/resnet50.bson-0.1.0.tar.gz"

["squeezenet.bson"]
git-tree-sha1 = "e0e53eb402efe4693417db8cbcc31519e74c8c74"
lazy = true

[["squeezenet.bson".download]]
sha256 = "4fc122a16f7a6729e4c357024614bc973a20ca157b6c8e2021043b3fbf8e2023"
url = "https://github.com/darsnack/MetalheadWeights/releases/download/v0.1.0/squeezenet.bson-0.1.0.tar.gz"

["vgg19.bson"]
git-tree-sha1 = "072056ec63bf7308cf89885e91852666e191e80a"
lazy = true

[["vgg19.bson".download]]
sha256 = "db24db0ed75e89063ca05421588380802da79e2787b2479e7d3178ce56d88dc0"
url = "https://github.com/darsnack/MetalheadWeights/releases/download/v0.1.0/vgg19.bson-0.1.0.tar.gz"
37 changes: 37 additions & 0 deletions build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Pkg.Artifacts
using Pkg.TOML

WEIGHT_DIR = joinpath(@__DIR__, "weights")
BUILD_DIR = joinpath(@__DIR__, "build")
URL = "https://github.com/darsnack/MetalheadWeights/releases/download"
ARTIFACT_TOML = joinpath(@__DIR__, "Artifacts.toml")

function build(version; weights = WEIGHT_DIR,
build = BUILD_DIR,
artifact_toml = ARTIFACT_TOML,
url = URL)
# Clean up prior builds.
ispath(build) && rm(build; recursive=true, force=true)
mkdir(build)

# Package up weights
for weight in readdir(weights)
model = basename(weight)
artifact_filename = "$model-$version.tar.gz"
product_hash = create_artifact() do artifact_dir
mkdir(joinpath(artifact_dir, model))
cp(joinpath(weights, weight), joinpath(artifact_dir, model); force=true)
end
download_hash = archive_artifact(product_hash, joinpath(build, artifact_filename))
remote_url = "$url/v$version/$artifact_filename"

@info "Creating:" model version product_hash artifact_filename download_hash remote_url
bind_artifact!(
artifact_toml,
"$model",
product_hash,
force=true,
lazy=true,
download_info=Tuple[(remote_url, download_hash)])
end
end

0 comments on commit 2ff0bf1

Please sign in to comment.