Skip to content
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

Implemented ticket #329 and fixed authorized_keys #339

Merged
merged 55 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
92d6a29
Implemented ticket #329 and fixed authorized_keys
ckunki Jun 6, 2023
34417ee
Updated changelog
ckunki Jun 6, 2023
a2eb031
removed stray parenthesis in test_cli_test_environment.py
ckunki Jun 6, 2023
e475c9e
Fixed some review findings
ckunki Jun 6, 2023
29e0617
Added generation of environment variable DATABASE_SSH_PORT incl. docu…
ckunki Jun 7, 2023
bfd28b3
Fixed review findings
ckunki Jun 7, 2023
d21dae5
fixed syntax error
ckunki Jun 7, 2023
af17e7a
fixed changelog
ckunki Jun 7, 2023
798da92
updated version number in file pyproject.toml
ckunki Jun 7, 2023
3f0c3b8
fixed test
ckunki Jun 7, 2023
2adeb4e
Added mandatory parameters to test case
ckunki Jun 7, 2023
28c18dd
changed class level property to method
ckunki Jun 9, 2023
bd1894f
changed default fort for SSH port forwarding to 20002
ckunki Jun 9, 2023
a1ae38a
fixed test
ckunki Jun 9, 2023
0faf96b
Fixed test
ckunki Jun 9, 2023
c323f28
Fixed test
ckunki Jun 9, 2023
7e0fe22
refactored class PortForwarding
ckunki Jun 12, 2023
fdecff0
updated files in eitde/docker_db_config/
ckunki Jun 12, 2023
9272968
Renamed class PortForwarding to Ports
ckunki Jun 12, 2023
403cb52
Updated user guide and fixes test
ckunki Jun 12, 2023
e5c45b0
Fixed review findings
ckunki Jun 12, 2023
b25078e
Updated changes file
ckunki Jun 12, 2023
704a229
Simplified tests for shell variables
ckunki Jun 12, 2023
844c877
removed unused property Ports.forward
ckunki Jun 12, 2023
77276cc
fixed syntax error
ckunki Jun 13, 2023
4b9a66c
fixed parameters for _connect_docker_network()
ckunki Jun 13, 2023
53dcc64
Fixed abstract_spawn_test_environment.py
ckunki Jun 13, 2023
6609885
Fixed abstract_spawn_test_environment.py
ckunki Jun 13, 2023
d060465
Fixed abstract_spawn_test_environment.py
ckunki Jun 13, 2023
32d7f8a
Merge branch 'main' into feature/329_forward_ssh_port
ckunki Jun 13, 2023
830cdfa
updated changelog.md
ckunki Jun 13, 2023
7c54baf
Fixed abstract_spawn_test_environment.py
ckunki Jun 13, 2023
1a66afa
Fixed abstract_spawn_test_environment.py
ckunki Jun 13, 2023
71a2d5a
fixed template for EXAConf in version 8.18.1
ckunki Jun 13, 2023
51b83e6
prefix environment variables with "ITDE" rather than "ENVIRONMENT"
ckunki Jun 14, 2023
5494032
changed ShellVariables to infer test_container_name from test_environ…
ckunki Jun 14, 2023
b03aea7
removed commented out import
ckunki Jun 14, 2023
d5bbe2f
fixed review findings.
ckunki Jun 14, 2023
70a54cc
Merge branch 'main' into feature/329_forward_ssh_port
ckunki Jun 15, 2023
a824b17
fixed merge error
ckunki Jun 15, 2023
6195a02
[run all tests]
ckunki Jun 15, 2023
a12d5eb
Moved container_named to test_ssh_access.py
ckunki Jun 15, 2023
8dda8c6
[run all tests]
ckunki Jun 15, 2023
8f7fd86
test with empty commit
ckunki Jun 19, 2023
d5b36c2
x
ckunki Jun 19, 2023
61e1e7b
x
ckunki Jun 19, 2023
83d5a13
x2
ckunki Jun 19, 2023
aecbe22
x3
ckunki Jun 19, 2023
b2f2d17
Merge branch 'main' into feature/329_forward_ssh_port
ckunki Jun 19, 2023
0a6e0f1
[run all tests]
ckunki Jun 19, 2023
caab992
fixed test_udf_execution.py
ckunki Jun 20, 2023
1647981
[run all tests]
ckunki Jun 20, 2023
9de3bea
fixed review finding
ckunki Jun 20, 2023
094f13d
changed import
ckunki Jun 20, 2023
307ec1f
[run all tests]
ckunki Jun 20, 2023
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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.sh text eol=lf
.sh.sha512sum text eol=lf
EXAConf text eol=lf

poetry.lock linguist-generated=true
exasol_integration_test_docker_environment/docker_db_config/**/* linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Pipfile.lock
.build_output/
dist/
.vagrant
TAGS
2 changes: 2 additions & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* [2.0.0](changes_2.0.0.md)
* [1.7.0](changes_1.7.0.md)
* [1.6.0](changes_1.6.0.md)
* [1.5.0](changes_1.5.0.md)
Expand Down Expand Up @@ -27,6 +28,7 @@
---
hidden:
---
changes_2.0.0
changes_1.7.0
changes_1.6.0
changes_1.5.0
Expand Down
21 changes: 21 additions & 0 deletions doc/changes/changes_2.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Integration-Test-Docker-Environment 2.0.0, released t.b.d.

## Summary

Version 2.0.0 of ITDE comes with breaking changes as public API class `DatabaseInfo` has been changed. Former separate attributes `database_port_forward`and `bucketfs_port_forward` have been replaced by a single attribute `port` set to an instance of `PortForwarding` with attributes `database`, `bucketfs`, and `ssh`.

T.B.D.

### Supported Exasol Versions

* **7.0**: up to 7.0.20, **except 7.0.5**
* **7.1**: up to 7.1.17
tkilias marked this conversation as resolved.
Show resolved Hide resolved
* **8.17.0** and 8.18.1

If you need further versions, please open an issue.

## Internal

## Changes

* #329: Added CLI option `--ssh-port-forward` to forward SSH port
15 changes: 14 additions & 1 deletion doc/developer_guide/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,23 @@ You can execute all tests in a single file with the following command:

Some tests will use prebuilt Docker Containers.
After changing the implementation you might need to rebuild the container in order to make
your changes effective when executing the tests.
your changes effective when executing the tests.

Please use the following command to rebuild the Docker Container:

.. code-block:: shell

starter_scripts/build_docker_runner_image.sh

Configuring Tests
-----------------

ITDE supports tests with pytest although there currently are also tests using
``python.unittest`` mainly in directory
``exasol_integration_test_docker_environment/test``. The plan is to migrate
all tests to pytest in directory ``test``

For pytest ITDE uses a pytest plugin in directory ``pytest_itde``. This plugin
enables to configure test execution, e.g. setting the hostname, user and
password of the database. For some configuration parameters there are also
default values.
38 changes: 24 additions & 14 deletions doc/user_guide/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ The following options are available to customize the test environment.
Host port to which the BucketFS port gets
forwarded

--ssh-port-forward INTEGER
Host port to which the SSH port gets
forwarded

--db-mem-size TEXT The main memory used by the database. Format
<number> <unit>, e.g. 1 GiB. The minimum
size is 1 GB, below that the database will
Expand Down Expand Up @@ -223,7 +227,7 @@ The python setup script creates configuration files on the host and in
the test container.

On the host the container information get stored in the build output
directory usually under ``.build_output/cache/<ENVIRONMENT_NAME>/*``. In
directory usually under ``.build_output/cache/<ITDE_NAME>/*``. In
the test container the config file is stored at the root directory
``/``.

Expand All @@ -235,25 +239,26 @@ The following config files are available:

::

export ENVIRONMENT_NAME=test
export ENVIRONMENT_TYPE=EnvironmentType.docker_db
export ITDE_NAME=test
export ITDE_TYPE=EnvironmentType.docker_db

# Database IP in environment docker network
export ENVIRONMENT_DATABASE_HOST=172.21.0.2
export ENVIRONMENT_DATABASE_DB_PORT=8888
export ENVIRONMENT_DATABASE_BUCKETFS_PORT=6583
export ENVIRONMENT_DATABASE_CONTAINER_NAME=db_container_test
export ENVIRONMENT_DATABASE_CONTAINER_NETWORK_ALIASES="exasol_test_database db_container_test"
export ITDE_DATABASE_HOST=172.21.0.2
export ITDE_DATABASE_DB_PORT=8888
export ITDE_DATABASE_BUCKETFS_PORT=6583
export ITDE_DATABASE_SSH_PORT=22
export ITDE_DATABASE_CONTAINER_NAME=db_container_test
export ITDE_DATABASE_CONTAINER_NETWORK_ALIASES="exasol_test_database db_container_test"
# Database IP in the environment docker network
export ENVIRONMENT_DATABASE_CONTAINER_IP_ADDRESS=172.21.0.2
export ENVIRONMENT_DATABASE_CONTAINER_VOLUMNE_NAME=db_container_test_volume
export ITDE_DATABASE_CONTAINER_IP_ADDRESS=172.21.0.2
export ITDE_DATABASE_CONTAINER_VOLUMNE_NAME=db_container_test_volume
# Database IP on the docker default bridge which under Linux available from the host
export ENVIRONMENT_DATABASE_CONTAINER_DEFAULT_BRIDGE_IP_ADDRESS=172.17.0.3
export ITDE_DATABASE_CONTAINER_DEFAULT_BRIDGE_IP_ADDRESS=172.17.0.3

export ENVIRONMENT_TEST_CONTAINER_NAME=test_container_test
export ENVIRONMENT_TEST_CONTAINER_NETWORK_ALIASES="test_container test_container_test"
export ITDE_TEST_CONTAINER_NAME=test_container_test
export ITDE_TEST_CONTAINER_NETWORK_ALIASES="test_container test_container_test"
# Test Container IP in the environment docker network
export ENVIRONMENT_TEST_CONTAINER_IP_ADDRESS=172.21.0.3
export ITDE_TEST_CONTAINER_IP_ADDRESS=172.21.0.3

- environment_info.json: Contains the EnvironmentInfo objects pickled
with JsonPickle
Expand Down Expand Up @@ -289,6 +294,11 @@ which leaves the container unchanged and hence reusable.
The public key will be added as file ``/root/.ssh/authorized_keys`` inside the
Docker Container to enable SSH access with public key authentication.

You can use command line option ``--ssh-port-forward`` to specify a port on
your host machine to which ITDE forwards the SSH port of the Docker Container
running the Exasol database. If you do not specify a port then ITDE will
select a random free port.


Tested Docker Runtimes
~~~~~~~~~~~~~~~~~~~~~~
Expand Down
9 changes: 5 additions & 4 deletions docker_db_config_template/7.0.0/EXAConf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# List of networks for this cluster: 'private' is mandatory, 'public' is optional.
Networks = private
# Comma-separated list of nameservers for this cluster.
NameServers = {{ name_servers }}
NameServers = {{ name_servers }}
Timezone = Europe/Berlin
# Nr. of hugepages ('0' = disabled, 'host' = manually configured on the host, 'auto' = set automatically based on DB config)
Hugepages = 0
Expand Down Expand Up @@ -39,7 +39,7 @@
DeviceType = file
# Comma-separated list of volumes to be mounted in all containers (e. g. '/mnt/my_data:/exa/my_data:rw' )
# These user-defined volumes are mounted additionally to the internal ones (like the node root volume)
AdditionalVolumes =
AdditionalVolumes =

[Groups]
[[root]]
Expand All @@ -61,6 +61,7 @@
Group = root
LoginEnabled = True
AdditionalGroups = exausers, exadbadm, exastoradm, exabfsadm, exaadm
AuthorizedKeys = {{authorized_keys}}
[[exadefusr]]
ID = 500
Group = exausers
Expand All @@ -69,7 +70,7 @@

[Node : 11]
PrivateNet = {{private_network}}
PublicNet =
PublicNet =
Name = n11
UUID = A5F8F92113A34BA4B0A48D5397423BBA5CF95161
DockerVolume = n11
Expand All @@ -85,7 +86,7 @@
# Enable or disable background recovery / data restoration (does not affect on-demand recovery)
BgRecEnabled = True
# Max. throughput for background recovery / data restoration (in MiB/s)
BgRecLimit =
BgRecLimit =
# Space usage threshold (in percent, per node) for sending a warning
SpaceWarnThreshold = 90

Expand Down
9 changes: 5 additions & 4 deletions docker_db_config_template/7.1.0/EXAConf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Options to verify certificates: none, optional, required
CertVerify = none
# Domain name in the certifcate
CertDomainName =
CertDomainName =

# Docker related options
[Docker]
Expand All @@ -51,7 +51,7 @@
DeviceType = file
# Comma-separated list of volumes to be mounted in all containers (e. g. '/mnt/my_data:/exa/my_data:rw' )
# These user-defined volumes are mounted additionally to the internal ones (like the node root volume)
AdditionalVolumes =
AdditionalVolumes =

[Groups]
[[root]]
Expand All @@ -73,6 +73,7 @@
Group = root
LoginEnabled = True
AdditionalGroups = exausers, exadbadm, exastoradm, exabfsadm, exaadm
AuthorizedKeys = {{ authorized_keys }}
[[exadefusr]]
ID = 500
Group = exausers
Expand All @@ -81,7 +82,7 @@

[Node : 11]
PrivateNet = {{private_network}}
PublicNet =
PublicNet =
Name = n11
# Affinity decides how this node is used in the cluster. i.e, the possibility to become master
Affinity = 11
Expand All @@ -99,7 +100,7 @@
# Enable or disable background recovery / data restoration (does not affect on-demand recovery)
BgRecEnabled = True
# Max. throughput for background recovery / data restoration (in MiB/s)
BgRecLimit =
BgRecLimit =
# Space usage threshold (in percent, per node) for sending a warning
SpaceWarnThreshold = 90

Expand Down
13 changes: 7 additions & 6 deletions docker_db_config_template/8.17.0/EXAConf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
CoredAllowOnlySameSubnet = True
# Which subnets Cored will allow messages from. Each subnet must be sepparated by a comma.
# A subnet is either an IPv4 or IPv6 address in CIDR notation.
CoredSubnets =
CoredSubnets =

# SSL options
[SSL]
Expand All @@ -47,7 +47,7 @@
# Options to verify certificates: none, optional, required
CertVerify = none
# Domain name in the certifcate
CertDomainName =
CertDomainName =

# Docker related options
[Docker]
Expand All @@ -60,7 +60,7 @@
DeviceType = file
# Comma-separated list of volumes to be mounted in all containers (e. g. '/mnt/my_data:/exa/my_data:rw' )
# These user-defined volumes are mounted additionally to the internal ones (like the node root volume)
AdditionalVolumes =
AdditionalVolumes =

[Groups]
[[root]]
Expand All @@ -84,6 +84,7 @@
Group = root
LoginEnabled = True
AdditionalGroups = exausers, exaadm, exadbadm, exastoradm, exabfsadm, exasaasadm
AuthorizedKeys = {{authorized_keys}}
[[exadefusr]]
ID = 500
Group = exausers
Expand All @@ -97,7 +98,7 @@

[Node : 11]
PrivateNet = {{private_network}}
PublicNet =
PublicNet =
Name = n11
# Affinity decides how this node is used in the cluster. i.e, the possibility to become master
Affinity = 11
Expand All @@ -115,7 +116,7 @@
# Enable or disable background recovery / data restoration (does not affect on-demand recovery)
BgRecEnabled = True
# Max. throughput for background recovery / data restoration (in MiB/s)
BgRecLimit =
BgRecLimit =
# Space usage threshold (in percent, per node) for sending a warning
SpaceWarnThreshold = 90

Expand Down Expand Up @@ -183,7 +184,7 @@
# Directory within the bucket that contains the drivers
Dir = drivers/jdbc
# Additional URLs used to search for JDBC drivers, like: bucketfs://bfs2/bucket3/jdbcdir or file:///exa/etc/jdbc_drivers.
AdditionalURLs =
AdditionalURLs =
# Oracle driver configuration
[[Oracle]]
# BucketFS that contains the JDBC drivers
Expand Down
13 changes: 7 additions & 6 deletions docker_db_config_template/8.18.1/EXAConf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
CoredAllowOnlySameSubnet = True
# Which subnets Cored will allow messages from. Each subnet must be sepparated by a comma.
# A subnet is either an IPv4 or IPv6 address in CIDR notation.
CoredSubnets =
CoredSubnets =

# SSL options
[SSL]
Expand All @@ -47,7 +47,7 @@
# Options to verify certificates: none, optional, required
CertVerify = none
# Domain name in the certifcate
CertDomainName =
CertDomainName =

# Docker related options
[Docker]
Expand All @@ -60,7 +60,7 @@
DeviceType = file
# Comma-separated list of volumes to be mounted in all containers (e. g. '/mnt/my_data:/exa/my_data:rw' )
# These user-defined volumes are mounted additionally to the internal ones (like the node root volume)
AdditionalVolumes =
AdditionalVolumes =

[Groups]
[[root]]
Expand All @@ -84,6 +84,7 @@
Group = root
LoginEnabled = True
AdditionalGroups = exausers, exaadm, exadbadm, exastoradm, exabfsadm, exasaasadm
AuthorizedKeys = {{ authorized_keys }}
[[exadefusr]]
ID = 500
Group = exausers
Expand All @@ -97,7 +98,7 @@

[Node : 11]
PrivateNet = {{private_network}}
PublicNet =
PublicNet =
Name = n11
# Affinity decides how this node is used in the cluster. i.e, the possibility to become master
Affinity = 11
Expand All @@ -115,7 +116,7 @@
# Enable or disable background recovery / data restoration (does not affect on-demand recovery)
BgRecEnabled = True
# Max. throughput for background recovery / data restoration (in MiB/s)
BgRecLimit =
BgRecLimit =
# Space usage threshold (in percent, per node) for sending a warning
SpaceWarnThreshold = 90

Expand Down Expand Up @@ -183,7 +184,7 @@
# Directory within the bucket that contains the drivers
Dir = drivers/jdbc
# Additional URLs used to search for JDBC drivers, like: bucketfs://bfs2/bucket3/jdbcdir or file:///exa/etc/jdbc_drivers.
AdditionalURLs =
AdditionalURLs =
# Oracle driver configuration
[[Oracle]]
# BucketFS that contains the JDBC drivers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
show_default=True,
help="Host port to which the BucketFS port gets forwarded",
)
@click.option(
"--ssh-port-forward",
type=int,
default=None,
show_default=True,
help="Host port to which the SSH port gets forwarded. If not specified then ITDE selects a random free port.",
)
@click.option(
"--db-mem-size",
type=str,
Expand Down Expand Up @@ -83,6 +90,7 @@ def spawn_test_environment(
environment_name: str,
database_port_forward: Optional[int],
bucketfs_port_forward: Optional[int],
ssh_port_forward: Optional[int],
db_mem_size: str,
db_disk_size: str,
nameserver: Tuple[str, ...],
Expand Down Expand Up @@ -117,6 +125,7 @@ def spawn_test_environment(
environment_name,
database_port_forward,
bucketfs_port_forward,
ssh_port_forward,
db_mem_size,
db_disk_size,
nameserver,
Expand Down
Loading