We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 262d11b commit 20b6265Copy full SHA for 20b6265
src/aleph_client/docker/image.py
@@ -74,6 +74,23 @@ def recursive_compute_chain_id(index: int) -> str:
74
chain_ids.append(chain_id)
75
return chain_id
76
77
+
78
79
+ # TODO: test this iterative version
80
+ iterative_chain_ids = []
81
+ def iterative_compute_chain_id(index: int) -> str:
82
+ diff_id = self.diff_ids[0]
83
+ iterative_chain_ids.append(diff_id)
84
+ i = 1
85
+ while i < index:
86
+ chain_id = "sha256:" + sha256(
87
+ iterative_chain_ids[i - 1].encode()
88
+ + " ".encode()
89
+ + self.diff_ids[i].encode()
90
+ ).hexdigest()
91
+ iterative_chain_ids.append(chain_id)
92
+ return
93
94
recursive_compute_chain_id(len(self.layers_ids) - 1)
95
96
return chain_ids
0 commit comments