Skip to content

Commit

Permalink
Update artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier committed Dec 7, 2023
1 parent 1d5a4af commit c45caf6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[qubolib]
git-tree-sha1 = "d0b605a8f91779e6ca75f93ad741ba77d7cdef53"
git-tree-sha1 = "001194a93d54a18b5c1b9883b20cf219b4e0a7ee"
lazy = true

[[qubolib.download]]
Expand Down
30 changes: 15 additions & 15 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name = "QUBOLib"
uuid = "c2d3eca2-2309-4628-88a9-9d4a554e7c47"
name = "QUBOLib"
uuid = "c2d3eca2-2309-4628-88a9-9d4a554e7c47"
authors = ["pedromxavier <pedrox@cos.ufrj.br>"]
version = "0.1.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
QUBOTools = "0.9"
11 changes: 4 additions & 7 deletions src/QUBOLib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ using ProgressMeter
const __PROJECT__ = abspath(@__DIR__, "..")
const __VERSION__ = VersionNumber(TOML.parsefile(joinpath(__PROJECT__, "Project.toml"))["version"])

export load_instance, list_collections, list_instances, select

function data_path()::AbstractString
# return abspath(artifact"qubolib")
return @__DIR__
return abspath(artifact"qubolib")
end

# Data management methods
include("management/index.jl")

# Public API
include("public/interface.jl")
include("public/load.jl")
include("public/list.jl")
include("public/archive.jl")
include("public/database.jl")

# Data curation methods
include("curation/index.jl")

end # module QUBOLib
File renamed without changes.
16 changes: 4 additions & 12 deletions src/curation/index.jl → src/management/index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,17 @@ function hash!(index::InstanceIndex)
return nothing
end

function deploy!(index::InstanceIndex; curate_data::Bool = false, on_read_error::Function=msg -> @warn(msg))
if curate_data
curate!(index; on_read_error)
end

deploy(index.dist_path)

return nothing
end
function deploy!(index::InstanceIndex)
hash!(index)

function deploy(dist_path::AbstractString)
# Build tarball
temp_path = abspath(Tar.create(dist_path))
temp_path = abspath(Tar.create(index.dist_path))

# Compress tarball
run(`gzip -9 $temp_path`)

# Move tarball
file_path = mkpath(abspath(dist_path, "qubolib.tar.gz"))
file_path = mkpath(abspath(index.dist_path, "qubolib.tar.gz"))

rm(file_path; force = true)

Expand Down
21 changes: 21 additions & 0 deletions src/management/management.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Management

using ..QUBOLib
using LazyArtifacts
using HDF5
using JSON
using JSONSchema
using JuliaFormatter
using LaTeXStrings
using SQLite
using DataFrames
using Tar
using TOML
using Pkg
using UUIDs
using QUBOTools
using ProgressMeter

include("index.jl")

end
File renamed without changes.

0 comments on commit c45caf6

Please sign in to comment.