Skip to content

Commit

Permalink
chore: update client version
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <gaius.qi@gmail.com>
  • Loading branch information
gaius-qi committed Jul 26, 2024
1 parent 29ab308 commit 480ceb7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 49 deletions.
2 changes: 1 addition & 1 deletion client-rs
Submodule client-rs updated 38 files
+573 −40 Cargo.lock
+24 −13 Cargo.toml
+5 −0 README.md
+1 −0 dragonfly-client-backend/Cargo.toml
+18 −12 dragonfly-client-backend/src/http.rs
+80 −1 dragonfly-client-backend/src/lib.rs
+583 −0 dragonfly-client-backend/src/object_storage.rs
+2 −0 dragonfly-client-config/Cargo.toml
+22 −20 dragonfly-client-config/src/dfdaemon.rs
+1 −0 dragonfly-client-core/Cargo.toml
+2 −2 dragonfly-client-core/src/error/errors.rs
+20 −0 dragonfly-client-core/src/error/mod.rs
+41 −0 dragonfly-client-storage/src/content.rs
+13 −1 dragonfly-client-storage/src/lib.rs
+15 −0 dragonfly-client-storage/src/metadata.rs
+7 −0 dragonfly-client-util/src/http/mod.rs
+7 −2 dragonfly-client/Cargo.toml
+400 −3 dragonfly-client/src/bin/dfcache/export.rs
+142 −27 dragonfly-client/src/bin/dfcache/import.rs
+13 −0 dragonfly-client/src/bin/dfcache/main.rs
+170 −3 dragonfly-client/src/bin/dfcache/remove.rs
+234 −3 dragonfly-client/src/bin/dfcache/stat.rs
+1 −7 dragonfly-client/src/bin/dfdaemon/main.rs
+517 −195 dragonfly-client/src/bin/dfget/main.rs
+128 −16 dragonfly-client/src/gc/mod.rs
+228 −29 dragonfly-client/src/grpc/dfdaemon_download.rs
+229 −29 dragonfly-client/src/grpc/dfdaemon_upload.rs
+1 −0 dragonfly-client/src/grpc/health.rs
+1 −0 dragonfly-client/src/grpc/manager.rs
+1 −1 dragonfly-client/src/grpc/mod.rs
+4 −0 dragonfly-client/src/grpc/scheduler.rs
+1 −0 dragonfly-client/src/grpc/security.rs
+137 −91 dragonfly-client/src/proxy/mod.rs
+896 −14 dragonfly-client/src/resource/cache_task.rs
+12 −8 dragonfly-client/src/resource/piece.rs
+18 −8 dragonfly-client/src/resource/piece_collector.rs
+82 −122 dragonfly-client/src/resource/task.rs
+1 −1 rust-toolchain.toml
84 changes: 36 additions & 48 deletions test/e2e/v2/dfget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/etc/containerd/config.toml"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/etc/containerd/config.toml-1"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "1fc5ed9922a3d741063c169ec49c2071a391db5fda8de30eb6a97f60b5038c16",
Expand All @@ -47,7 +46,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml-1"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -71,10 +70,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/kubectl"), util.GetOutputPath("kubectl"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/kubectl"), util.GetOutputPath("kubectl-1"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "aaa32162d94ffb18dd407dc9abf2ac915b6dac4687dcf936a364818717d0155b",
Expand All @@ -85,7 +83,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("kubectl"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("kubectl-1"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -109,10 +107,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/x86_64"), util.GetOutputPath("x86_64"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/x86_64"), util.GetOutputPath("x86_64-1"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "3e9135a3e652efb9e6ae0b430f61d36a91093208009ddb839a1c9a1979274f89",
Expand All @@ -123,7 +120,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("x86_64"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("x86_64-1"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -147,10 +144,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/zless"), util.GetOutputPath("zless"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/zless-1"), util.GetOutputPath("zless"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "a36732ab9c09237884ceefe8c1a007558fd15a9c891f1f905e4b95136266da70",
Expand All @@ -161,7 +157,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("zless"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("zless-1"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -185,10 +181,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/bash"), util.GetOutputPath("bash"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --output %s", util.GetFileURL("/bin/bash"), util.GetOutputPath("bash-1"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "f2efea3df39f19e192a395843f67cfbb4338f3616014d9c5857da4c14cd01621",
Expand All @@ -199,7 +194,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("bash"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("bash-1"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -223,10 +218,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 134217728 --output %s", util.GetFileURL("/etc/containerd/config.toml"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 134217728 --output %s", util.GetFileURL("/etc/containerd/config.toml-2"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "1ae51fe69c381a4604517f1d00d4315afef070bab3bcb475f11770fc5b194821",
Expand All @@ -237,7 +231,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml-2"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -261,10 +255,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 67108864 --output %s", util.GetFileURL("/bin/kubectl"), util.GetOutputPath("kubectl"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 67108864 --output %s", util.GetFileURL("/bin/kubectl-2"), util.GetOutputPath("kubectl"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "617d59d9cf3f9bd394ee98f327a77fc0b45a34431e59938abd0db20b467d8713",
Expand All @@ -275,7 +268,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("kubectl"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("kubectl-2"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -299,10 +292,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 33554432 --output %s", util.GetFileURL("/bin/x86_64"), util.GetOutputPath("x86_64"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 33554432 --output %s", util.GetFileURL("/bin/x86_64"), util.GetOutputPath("x86_64-2"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "f6b341fff271d4508e6f4820511c44bac3027c005c237798f98b89743c311148",
Expand All @@ -313,7 +305,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("x86_64"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("x86_64-2"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -337,10 +329,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 16777216 --output %s", util.GetFileURL("/bin/zless"), util.GetOutputPath("zless"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 16777216 --output %s", util.GetFileURL("/bin/zless-2"), util.GetOutputPath("zless"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "c358a010a628bd2720634ca245886c06d6555db7c020561bbea96d6c3afc13c9",
Expand All @@ -351,7 +342,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("zless"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("zless-2"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -375,10 +366,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 1048576 --output %s", util.GetFileURL("/bin/bash"), util.GetOutputPath("bash"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --piece-length 1048576 --output %s", util.GetFileURL("/bin/bash-2"), util.GetOutputPath("bash"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "08b79b117296dd83c010d566c11b77e457d8021feb858f2d7b351686f12204e7",
Expand All @@ -389,7 +379,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("bash"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("bash-2"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -413,10 +403,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --application d7y --output %s", util.GetFileURL("/etc/containerd/config.toml"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --application d7y --output %s", util.GetFileURL("/etc/containerd/config.toml-3"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "9746acdb4bd8bf2deeb5dd8a3275e51a7fdd4adf8b0dc1d9d26a4565d3ed6592",
Expand All @@ -427,7 +416,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml-3"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand All @@ -451,10 +440,9 @@ var _ = Describe("Download Using Dfget", func() {
fmt.Println(err)
Expect(err).NotTo(HaveOccurred())

out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --tag d7y --output %s", util.GetFileURL("/etc/containerd/config.toml"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(err)
out, err := clientPod.Command("sh", "-c", fmt.Sprintf("dfget %s --disable-back-to-source --tag d7y --output %s", util.GetFileURL("/etc/containerd/config.toml-4"), util.GetOutputPath("config.toml"))).CombinedOutput()
fmt.Println(out, err)
Expect(err).NotTo(HaveOccurred())
fmt.Println(out)

fileMetadata := util.FileMetadata{
ID: "9746acdb4bd8bf2deeb5dd8a3275e51a7fdd4adf8b0dc1d9d26a4565d3ed6592",
Expand All @@ -465,7 +453,7 @@ var _ = Describe("Download Using Dfget", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml"))
sha256sum, err = util.CalculateSha256ByOutput([]*util.PodExec{clientPod}, util.GetOutputPath("config.toml-4"))
Expect(err).NotTo(HaveOccurred())
Expect(fileMetadata.Sha256).To(Equal(sha256sum))

Expand Down

0 comments on commit 480ceb7

Please sign in to comment.