-
Notifications
You must be signed in to change notification settings - Fork 0
#219: Notebook-Connector can add Conda-Packages to SLCs #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tomuben
merged 24 commits into
main
from
feature/219_slct_manager_support_for_conda_packages
Aug 13, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
43a838e
#219: Notebook-Connector can add Conda-Packages to SLCs
tomuben 1f5228d
Fixed test matrix
tomuben 489399b
Fixed formatting
tomuben bc67040
Fixed tests
tomuben 29f7d6b
Fixed tests
tomuben 5777cde
Fixed formatting
tomuben df907f3
Reactivated GZIP compression for SLC and fixed tests-ordinary-integra…
tomuben 8171ca5
Fixes from review
tomuben c5688be
Update test/package_manager.py
tomuben 3c66e0a
Merge remote-tracking branch 'origin/main' into feature/219_slct_mana…
tomuben 591411f
1. Reformatted and fixed cicrular import
tomuben f9813aa
Added compression strategy to SecretsMock
tomuben d1f766b
Fixed unit test
tomuben 098690f
Use matrix builds for gpu
tomuben 3f17778
Reverted matrix builds for GPU Tests
tomuben addaa1e
Moved start/stop of ITDE into common fixture
tomuben cefa15d
Reformatted files
tomuben 6f06c6e
Changed fixture sample_file() to private context function
tomuben 71c98e4
fixed fixture secrets_module()
tomuben 1407ece
fixed fixture secrets_module()
tomuben 40c9db7
fixed fixture secrets_module()
tomuben e2544cd
Fixed formatting
tomuben 977b9b7
Fixed test_secret_store.py
tomuben 9ea29d3
Update test/integration/gpu/itest_slct_manager_with_gpu.py
tomuben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ __pycache__/ | |
.build_output | ||
# drawio backup files | ||
/doc/user_guide/*.bkp | ||
.workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from exasol.nb_connector.slc.script_language_container import ( | ||
CondaPackageDefinition, | ||
PipPackageDefinition, | ||
ScriptLanguageContainer, | ||
) | ||
from exasol.nb_connector.slc.slc_flavor import SlcError | ||
from exasol.nb_connector.slc.slc_error import SlcError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from __future__ import annotations | ||
|
||
from exasol.slc.models.compression_strategy import CompressionStrategy | ||
|
||
from exasol.nb_connector.secret_store import Secrets | ||
from exasol.nb_connector.slc.slc_error import SlcError | ||
|
||
|
||
class SlcCompressionStrategy: | ||
def __init__(self, slc_name): | ||
self.slc_name = slc_name | ||
|
||
@property | ||
def key(self): | ||
return f"SLC_COMPRESSION_STRATEGY_{self.slc_name.upper()}" | ||
|
||
def save(self, secrets: Secrets, compression_strategy: CompressionStrategy) -> None: | ||
secrets.save(self.key, compression_strategy.value) | ||
|
||
def exists(self, secrets: Secrets) -> bool: | ||
return True if secrets.get(self.key) else False | ||
|
||
def verify(self, secrets: Secrets) -> CompressionStrategy: | ||
try: | ||
value = secrets[self.key] | ||
return CompressionStrategy(value) | ||
except AttributeError as ex: | ||
raise SlcError( | ||
"Secure Configuration Storage does not contain a" | ||
f" compression strategy for SLC {self.slc_name}." | ||
) from ex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class SlcError(Exception): | ||
""" | ||
Signals errors related to ScriptLanguageContainer: | ||
|
||
* The name of the SLC is not unique | ||
|
||
* the Secure Configuration Storage (SCS / secrets / conf) does not contain | ||
a required option | ||
|
||
* The SLC Git repository has not been checked out (cloned) | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,52 @@ | ||
from pathlib import Path | ||
from collections.abc import Iterator | ||
from test.package_manager import PackageManager | ||
from test.utils.integration_test_utils import sample_db_file | ||
|
||
import pytest | ||
from exasol.slc.models.compression_strategy import CompressionStrategy | ||
|
||
from exasol.nb_connector.secret_store import Secrets | ||
|
||
|
||
@pytest.fixture | ||
def sample_file(tmp_path: Path) -> Path: | ||
return tmp_path / "sample_database.db" | ||
def secrets() -> Iterator[Secrets]: | ||
with sample_db_file() as secret_db: | ||
yield Secrets(secret_db, master_password="abc") | ||
|
||
|
||
@pytest.fixture | ||
def secrets(sample_file) -> Secrets: # pylint: disable=W0621 | ||
return Secrets(sample_file, master_password="abc") | ||
@pytest.fixture(scope="module") | ||
def secrets_module() -> Iterator[Secrets]: | ||
tomuben marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with sample_db_file() as secret_db: | ||
yield Secrets(secret_db, master_password="abc") | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--package-manager", | ||
action="store", | ||
type=PackageManager, | ||
choices=list(PackageManager), | ||
default="pip", | ||
tomuben marked this conversation as resolved.
Show resolved
Hide resolved
|
||
help="Package Manager to use", | ||
) | ||
|
||
parser.addoption( | ||
"--compression-strategy", | ||
action="store", | ||
type=CompressionStrategy, | ||
choices=list(CompressionStrategy), | ||
default="gzip", | ||
help="Compression Strategy to use", | ||
) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def package_manager(request) -> PackageManager: | ||
val = request.config.getoption("--package-manager") | ||
return PackageManager(val) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def compression_strategy(request) -> CompressionStrategy: | ||
val = request.config.getoption("--compression-strategy") | ||
return CompressionStrategy(val) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha - maybe we should add
SlcSession
again, containing flavor and compression strategy.