Skip to content
Open

1.4.3 #216

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4ee1d71
Update table_name parameter handling
LukasFehring Feb 11, 2025
378bd44
Update .gitignore and dependencies
LukasFehring Feb 11, 2025
85e665e
Update poetry lock
LukasFehring Feb 11, 2025
df8b564
Add to changelog.rst
LukasFehring Feb 11, 2025
a02f95f
Add condiiton functionality
LukasFehring Apr 25, 2025
5a9c283
Merge pull request #208 from tornede/204-table_name-parameter-does-no…
LukasFehring May 9, 2025
bb51086
Update test
LukasFehring May 16, 2025
147377a
Update Changelog.rst
LukasFehring May 16, 2025
c86f7ea
Merge pull request #209 from tornede/207-get_table-with-condition
LukasFehring May 16, 2025
0ef424d
First version of using mtls
LukasFehring Jul 10, 2025
a9db378
Update config
LukasFehring Jul 10, 2025
2e44a7e
Add mtls docs
LukasFehring Jul 10, 2025
2525d57
Update handling
LukasFehring Jul 11, 2025
b0658fa
Merge pull request #212 from tornede/211-support-mtls
LukasFehring Jul 15, 2025
9978ac7
Add first version of staggered logging
LukasFehring Jul 28, 2025
0293313
Update test
LukasFehring Jul 28, 2025
12e82ca
Adapt changelog
LukasFehring Jul 28, 2025
88c36c2
Merge pull request #213 from tornede/210-adapt-mysql-logtables-to-do-…
LukasFehring Jul 28, 2025
3ae33cb
REmove ssh
LukasFehring Mar 2, 2026
fbd9812
Update CodeCarbon
LukasFehring Mar 3, 2026
4f0b76f
Fix to old poetry
LukasFehring Mar 3, 2026
bbc83ed
Revert ocdecarbon changes
LukasFehring Mar 3, 2026
43f18db
Merge pull request #221 from tornede/220-remove-ssh
LukasFehring Mar 4, 2026
7b19ce4
Possibly fix that rows get added multiple times
LukasFehring Mar 2, 2026
bc970bf
Merge pull request #219 from tornede/fix/duplicate-row-detection
LukasFehring Mar 18, 2026
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
2 changes: 2 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/database_credentials.yml
config/certificates
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ dmypy.json
.idea/
.DS_Store

# Cursor
.cursor/

# Database
*.db

Expand All @@ -150,6 +153,15 @@ output/
# codecarbon
.codecarbon.config
emissions.csv
powermetrics_log.txt

# development folder
development/

# MTLS certificates
config/certificates/ca.crt
config/certificates/user_cert.crt
config/certificates/user_private_key.key
emissions.csv.bak
.cursor/rules/interaction-preferences.mdc
.cursor/rules/research-coding-standards.mdc
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
=========
Changelog
=========
v1.4.3 (**.**.2025)
===================

Feature
-------

- Added stagger_logging functionality to logtables.
- Allow condition for experimenter.get_table() and experimenter.get_logtable()

Fix
===

- Fix bug, where the logtable_name was not overwritten by `table_name` updates in the `PyExperimenter` class.

v1.4.2 (12.06.2024)
===================
Expand Down
14 changes: 5 additions & 9 deletions config/example_database_credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ CREDENTIALS:
Connection:
Standard:
server: example.mysqlserver.com
Ssh:
server: example.sshmysqlserver.com (address from ssh server)
address: example.sslserver.com
port: optional_ssh_port
remote_address: optional_mysql_server_address
remote_port: optional_mysql_server_port
local_address: optional_local_address
local_port: optional_local_port
passphrase: optional_ssh_passphrase
use_ssl: some_boolean_value
ssl_params:
ca: config/certificates/ca.crt
cert: config/certificates/user_cert.crt
key: config/certificates/user_private_key.key
1,338 changes: 678 additions & 660 deletions docs/source/examples/example_general_usage.ipynb

Large diffs are not rendered by default.

560 changes: 273 additions & 287 deletions docs/source/examples/example_logtables.ipynb

Large diffs are not rendered by default.

28 changes: 12 additions & 16 deletions docs/source/usage/database_credential_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ Below is an example of a database credential file, that connects to a server wit
Standard:
server: example.mysqlserver.com

However, for security reasons, databases might only be accessible from a specific IP address. In these cases, one can use an ssh jumphost. This means that ``PyExperimenter`` will first connect to the ssh server
that has access to the database and then connect to the database server from there. This is done by adding an additional ``Ssh`` section to the database credential file, and can be activated either by a ``PyExperimenter`` keyword argument or in the :ref:`experimenter configuration file <experiment_configuration_file>`.
The following example shows how to connect to a database server using an SSH server with the address ``ssh_hostname`` and the port ``optional_ssh_port``.
We additionally also support utilizing encrypted connections with (m)tls. To that end, the following parameters can be added to the ``Standard`` section of the database credential file
- ``use_ssl``: a boolean value indicating whether to use ssl
- ``ssl_params``: a dictionary containing the following keys:
- ``ca``: the path to the ca certificate (optional, needed if the database server uses a custom ca certificate not trusted by the client)
- ``cert``: the path to the user certificate (optional, needed in case of client authentication with mtls)
- ``key``: the path to the user private key (optional, needed in case of client authentication with mtls)

.. code-block:: yaml

Expand All @@ -30,16 +33,9 @@ The following example shows how to connect to a database server using an SSH ser
password: example_password
Connection:
Standard:
server: example.sshmysqlserver.com
Ssh:
server: example.mysqlserver.com (address from ssh server)
address: ssh_hostname (either name/ip address of the ssh server or a name from you local ssh config file)
port: optional_ssh_port (default: 22)
ssh_private_key_password: passphrase
remote_address: optional_mysql_server_address (default: 127.0.0.1)
remote_port: optional_mysql_server_port (default: 3306)
local_address: optional_local_address (default: 127.0.0.1)
local_port: optional_local_port (default: 3306)

.. note::
Note that we do not support further parameters for the SSH connection, such as explicitly setting the private key file. To use these, you have to adapt your local ssh config file.
server: example.mysqlserver.com
use_ssl: some_boolean_value
ssl_params:
ca: config/certificates/ca.crt
cert: config/certificates/user_cert.crt
key: config/certificates/user_private_key.key
16 changes: 0 additions & 16 deletions docs/source/usage/execution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Additionally, further information can be given to ``PyExperimenter``:

- ``experiment_configuration_file_path``: The path of the :ref:`experiment configuration file <experiment_configuration_file>`. Default: ``config/experiment_configuration.cfg``.
- ``database_credential_file_path``: The path of the :ref:`database credential file <database_credential_file>`. Default: ``config/database_credentials.cfg``
- ``use_ssh_tunnel``: Specifies if a SSH tunnel will be used to connect to the database. Default: ``False``. If ``use_ssh_tunnel`` is set to ``True``, creating a ``PyExperimenter`` will also open an ssh tunnel, which should be :ref:`closed manually <close_ssh_tunnel>`. The details of the ssh-connection have to be specified in the :ref:`database credential file <database_credential_file>`.
- ``database_name``: The name of the database to manage the experiments. If given, it will overwrite the database name given in the `experiment_configuration_file_path`.
- ``table_name``: The name of the database table to manage the experiments. If given, it will overwrite the table name given in the `experiment_configuration_file_path`.
- ``use_codecarbon``: Specifies if :ref:`CodeCarbon <experiment_configuration_file_codecarbon>` will be used to track experiment emissions. Default: ``True``.
Expand Down Expand Up @@ -274,19 +273,4 @@ At a later point in time, the experiment can be unpaused and continued. This can
A complete example on how to pause and continue an experiment can be found in the :ref:`examples section <examples>`.



.. _close_ssh_tunnel:

----------------
Close SSH Tunnel
----------------

If an SSH tunnel was opened during the creation of the ``PyExperimenter``, it has to be closed manually by calling the following method:

.. code-block:: python

experimenter.execute(...)
experimenter.close_ssh_tunnel()


.. _hydra: https://hydra.cc/
2 changes: 0 additions & 2 deletions docs/source/usage/experiment_configuration_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ The experiment configuration file is primarily used to define the database backe
Database:
provider: sqlite
database: py_experimenter
use_ssh_tunnel: False
table:
name: example_general_usage
keyfields:
Expand Down Expand Up @@ -70,7 +69,6 @@ The ``Database`` section defines the database and its structure.

- ``provider``: The provider of the database connection. Currently, ``sqlite`` and ``mysql`` are supported. In the case of ``mysql`` an additional :ref:`database credential file <database_credential_file>` has to be created.
- ``database``: The name of the database to create or connect to.
- ``use_ssh_tunnel``: Flag to decide if the database is connected via ssh as defined in the :ref:`database credential file <database_credential_file>`. This is ignored if ``sqlite`` is chosen as provider. Optional Parameter, default is False.
- ``table``: Defines the structure and predefined values for the experiment table.

- ``name``: The name of the experiment table to create or connect to.
Expand Down
Loading
Loading