Skip to content
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aebbd1a
Start of the configuration library
dennisweil Dec 10, 2024
b612812
Use platformdirs for paths resolver
dennisweil Dec 12, 2024
97127ba
First iteration of composition resolver
dennisweil Dec 12, 2024
2f0bd68
Compose resolver is now more flexible
dennisweil Dec 12, 2024
6e28f2e
Attempt at cleaner composition authoring
dennisweil Dec 16, 2024
881959e
Add some type hinting and docstrings
dennisweil Dec 16, 2024
5f653fa
Small update
dennisweil Dec 16, 2024
0e0be49
Better typing and separation of concerns
dennisweil Dec 17, 2024
22753db
Clean up composition keys after resolving
dennisweil Dec 17, 2024
eaab004
Namespace our own resolvers with ft
dennisweil Dec 17, 2024
ed52aeb
Fix small typo
dennisweil Dec 17, 2024
eb8cbeb
Minor fixes and docstring additions
dennisweil Dec 17, 2024
d9c11c0
Add module/file level docstring
dennisweil Dec 17, 2024
71e6f27
More docstring work
dennisweil Dec 17, 2024
58b008f
Add root level metadata key
dennisweil Dec 18, 2024
96e9be8
Make the metadata keys configurable
dennisweil Dec 18, 2024
4fde845
Wrape our internal config repr. into class
dennisweil Dec 18, 2024
46acd8c
Identify merge conflicts
dennisweil Dec 18, 2024
339d0d6
Better formatting for the sources
dennisweil Dec 18, 2024
92a9297
Small change on how to deal with keys to be deleted
dennisweil Dec 19, 2024
cc63bc6
Merge remote-tracking branch 'origin/backlog/monorepo-refactor-2025/s…
dennisweil Dec 19, 2024
d5c1de4
Start of refactoring the configuration lib
dennisweil Dec 19, 2024
bab36bc
Improved metadata handling
dennisweil Jan 2, 2025
f30538b
Extensive work on the configuration library
dennisweil Jan 3, 2025
0be0676
Create conflicts file and compose from metadata
dennisweil Jan 6, 2025
77c9042
Add exec resolver
dennisweil Jan 6, 2025
496df93
Enable configspec loading from metadata
dennisweil Jan 6, 2025
15cc1d7
Docstrings, comments and todos
dennisweil Jan 6, 2025
0ac5c56
Ensure deterministic ordering
dennisweil Jan 6, 2025
c207998
First version of conflict resolution functionality
dennisweil Jan 7, 2025
5963e7f
Code hygiene
dennisweil Jan 7, 2025
706d079
A bunch of new resolvers.
dennisweil Jan 13, 2025
5ff7f4c
Additional resolvers to support package versions
dennisweil Jan 14, 2025
e7e8f57
Move custom resolver registration
dennisweil Jan 16, 2025
955ecd4
Remove pickle due to security vulnerabilities
dennisweil Jan 22, 2025
443f3e8
Merge branch 'backlog/monorepo-refactor-2025/story' into backlog/mono…
dennisweil Jan 22, 2025
42a8693
Import base64
dennisweil Jan 22, 2025
f67f7f2
Use yaml.SafeLoader to prevent code execution
dennisweil Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import base64
import pickle
import yaml

from typing import Self
from pathlib import Path
Expand Down Expand Up @@ -46,21 +46,21 @@ def __eq__(self, other):

def config_as_base64(self) -> str:
# Serialize the object to a pickle byte stream
pickled_data = pickle.dumps(self.configuration)
# Encode the byte stream to a base64 string
base64_encoded = base64.b64encode(pickled_data).decode("utf-8")
# Convert the base64 string to a hexdump
hexdump = base64_encoded.encode("utf-8").hex()
encoded_bytes = bytes(OmegaConf.to_yaml(self.configuration).encode("utf-8"))
# Encode the byte stream to a base64 string and dump as hex
hexdump = base64.b64encode(encoded_bytes).hex()
return hexdump

@staticmethod
def config_from_base64(hexdump: str) -> DictConfig:
# Convert the hexdump back to a base64 string
base64_encoded = bytes.fromhex(hexdump).decode("utf-8")
# Decode the base64 string to a pickle byte stream
pickled_data = base64.b64decode(base64_encoded)
# Deserialize the pickle byte stream to an object
configuration = pickle.loads(pickled_data)
decoded_string = base64.b64decode(base64_encoded)
# Load the string as yaml and convert it to an OmegaConf Configuration
configuration = OmegaConf.create(
yaml.load(decoded_string, Loader=yaml.SafeLoader)
)
return configuration

def to_dict(self) -> dict:
Expand Down