Skip to content

Commit

Permalink
#212: Updating dependencies and Python to 3.10 (#213)
Browse files Browse the repository at this point in the history
fixes #212 
---------

Co-authored-by: Christoph Pirkl <4711730+kaklakariada@users.noreply.github.com>
  • Loading branch information
tomuben and kaklakariada authored May 22, 2024
1 parent f906087 commit 90261c0
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 197 deletions.
4 changes: 2 additions & 2 deletions .github/actions/prepare_poetry_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
python-version:
description: 'The Python version to use'
required: true
default: '3.8'
default: '3.10'
runs:
using: "composite"
steps:
Expand All @@ -13,7 +13,7 @@ runs:
python-version: ${{ inputs.python-version }}
- uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4.2
poetry-version: 1.8.2
- name: Poetry install
run: poetry install
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
exasol_version:
- "default"
python_version:
- 3.8
- 3.10
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
runs-on: ubuntu-latest
name: ${{ matrix.test-path.name }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ the following prerequisites:
* sha512sum
* sed
* [curl](https://curl.se/)
* Python 3 (>=3.8)
* Python 3 (>=3.10)
* Pip


Expand Down
1 change: 1 addition & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* [0.19.0](changes_0.19.0.md)
* [0.18.3](changes_0.18.3.md)
* [0.18.2](changes_0.18.2.md)
* [0.18.1](changes_0.18.1.md)
Expand Down
12 changes: 12 additions & 0 deletions doc/changes/changes_0.19.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Script-Languages-Container-Tool 0.19.0, released 2024-05-22

Code name: Updated dependencies

## Summary

This releases updated the dependency to exasol-integration-test-docker-environment.

## Refactorings

- #212: Updating dependencies and Python

8 changes: 4 additions & 4 deletions docker_runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

COPY ext/01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc
Expand All @@ -7,7 +7,7 @@ RUN apt-get -y update && \
apt-get -y install --no-install-recommends\
ca-certificates \
locales \
python3.8-venv \
python3.10-venv \
git \
bash \
curl && \
Expand All @@ -17,7 +17,7 @@ RUN apt-get -y update && \
apt-get -y autoremove && \
ldconfig

RUN curl https://bootstrap.pypa.io/get-pip.py | python3.8
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.10

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
Expand All @@ -30,7 +30,7 @@ COPY LICENSE /script-languages-container-tool/LICENSE
COPY README.md /script-languages-container-tool/README.md

WORKDIR /script-languages-container-tool
RUN python3.8 -m pip install .
RUN python3.10 -m pip install .

RUN mkdir -p runner
COPY docker_runner/ /docker_runner
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def run_db_test(flavor_path: Tuple[str, ...],
external_exasol_db_host: Optional[str],
external_exasol_db_port: int,
external_exasol_bucketfs_port: int,
external_exasol_ssh_port: Optional[int],
external_exasol_db_user: Optional[str],
external_exasol_db_password: Optional[str],
external_exasol_bucketfs_write_password: Optional[str],
Expand Down Expand Up @@ -161,6 +162,7 @@ def run_db_test(flavor_path: Tuple[str, ...],
external_exasol_bucketfs_port=external_exasol_bucketfs_port,
external_exasol_db_user=external_exasol_db_user,
external_exasol_db_password=external_exasol_db_password,
external_exasol_ssh_port=external_exasol_ssh_port,
external_exasol_bucketfs_write_password=external_exasol_bucketfs_write_password,
external_exasol_xmlrpc_host=external_exasol_xmlrpc_host,
external_exasol_xmlrpc_port=external_exasol_xmlrpc_port,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from exasol_integration_test_docker_environment.lib.api.common import run_task, generate_root_task, \
set_docker_repository_config, set_build_config, import_build_steps, cli_function
from exasol_integration_test_docker_environment.lib.base.dependency_logger_base_task import DependencyLoggerBaseTask
from exasol_integration_test_docker_environment.lib.test_environment.parameter.docker_db_test_environment_parameter import \
DbOsAccess

from exasol_script_languages_container_tool.lib.api import api_errors
from exasol_script_languages_container_tool.lib.tasks.test.test_container import TestContainer, AllTestsResult
Expand All @@ -30,7 +32,8 @@ def run_db_test(flavor_path: Tuple[str, ...],
additional_db_parameter: Tuple[str, ...] = tuple(),
external_exasol_db_host: Optional[str] = None,
external_exasol_db_port: int = 8563,
external_exasol_bucketfs_port: int = 6583,
external_exasol_bucketfs_port: int = 2580,
external_exasol_ssh_port: Optional[int] = None,
external_exasol_db_user: Optional[str] = None,
external_exasol_db_password: Optional[str] = None,
external_exasol_bucketfs_write_password: Optional[str] = None,
Expand Down Expand Up @@ -125,6 +128,7 @@ def root_task_generator() -> DependencyLoggerBaseTask:
reuse_database_setup=reuse_database_setup,
reuse_test_container=reuse_test_container,
reuse_database=reuse_database,
db_os_access=DbOsAccess[db_os_access],
no_test_container_cleanup_after_success=reuse_test_container,
no_test_container_cleanup_after_failure=reuse_test_container,
no_database_cleanup_after_success=reuse_database,
Expand All @@ -137,6 +141,7 @@ def root_task_generator() -> DependencyLoggerBaseTask:
external_exasol_bucketfs_port=external_exasol_bucketfs_port,
external_exasol_db_user=external_exasol_db_user,
external_exasol_db_password=external_exasol_db_password,
external_exasol_ssh_port=external_exasol_ssh_port,
external_exasol_bucketfs_write_password=external_exasol_bucketfs_write_password,
external_exasol_xmlrpc_host=external_exasol_xmlrpc_host,
external_exasol_xmlrpc_port=external_exasol_xmlrpc_port,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def run_test_command(self, docker_client: docker.client, bash_cmd: str,
def generate_test_command(self) -> str:
credentials = f"--user '{self.db_user}' --password '{self.db_password}'"
log_level = f"--loglevel={self.test_log_level}"
server = f"--server '{self._database_info.host}:{self._database_info.db_port}'"
server = f"--server '{self._database_info.host}:{self._database_info.ports.database}'"
environment = "--driver=/downloads/ODBC/lib/linux/x86_64/libexaodbc-uo2214lv2.so " \
"--jdbc-path /downloads/JDBC/exajdbc.jar"
language_definition = f"--script-languages '{self.language_definition}'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
from typing import Generator, Any, Dict

import luigi
from docker.models.containers import ExecResult
from exasol_integration_test_docker_environment.lib.base.db_os_executor import DbOsExecFactory, SshExecFactory, \
DockerClientFactory, DockerExecFactory, DbOsExecutor
from exasol_integration_test_docker_environment.lib.base.json_pickle_parameter import JsonPickleParameter
from exasol_integration_test_docker_environment.lib.data.database_info import DatabaseInfo
from exasol_integration_test_docker_environment.lib.test_environment.parameter.docker_db_test_environment_parameter import \
DbOsAccess

from exasol_script_languages_container_tool.lib.tasks.export.export_containers import ExportFlavorContainer
from exasol_script_languages_container_tool.lib.tasks.export.export_info import ExportInfo
from exasol_script_languages_container_tool.lib.tasks.test.populate_test_engine import PopulateTestEngine
Expand All @@ -19,6 +27,26 @@
from exasol_integration_test_docker_environment.lib.test_environment.spawn_test_environment import SpawnTestEnvironment


class DummyExecutor(DbOsExecutor):

def exec(self, cmd: str) -> ExecResult:
raise RuntimeError("Not supposed to be called.")

def prepare(self):
pass

def __enter__(self):
return self

def __exit__(self, type_, value, traceback):
pass


class DummyExecFactory(DbOsExecFactory):
def executor(self) -> DbOsExecutor:
return DummyExecutor()


class TestRunnerDBTestTask(FlavorBaseTask,
SpawnTestEnvironmentParameter,
RunDBTestsInTestConfigParameter):
Expand Down Expand Up @@ -63,6 +91,15 @@ def run_task(self):
test_results = yield from self.run_test(self.test_environment_info, export_info)
self.return_object(test_results)

def _executor_factory(self, database_info: DatabaseInfo) -> DbOsExecFactory:

if self.db_os_access == DbOsAccess.SSH:
return SshExecFactory.from_database_info(database_info)
client_factory = DockerClientFactory(timeout=100000)
if database_info.container_info is not None:
return DockerExecFactory(database_info.container_info.container_name, client_factory)
return DummyExecFactory()

def upload_container(self, database_credentials: DatabaseCredentials, export_info: ExportInfo):
reuse = \
self.reuse_database and \
Expand All @@ -75,7 +112,8 @@ def upload_container(self, database_credentials: DatabaseCredentials, export_inf
test_environment_info=self.test_environment_info,
release_name=export_info.name,
reuse_uploaded=reuse,
bucketfs_write_password=database_credentials.bucketfs_write_password
bucketfs_write_password=database_credentials.bucketfs_write_password,
executor_factory=self._executor_factory(self.test_environment_info.database_info)
)
yield from self.run_dependencies(upload_task)

Expand Down
Loading

0 comments on commit 90261c0

Please sign in to comment.