Skip to content

Commit

Permalink
#423: updated formatting (#424)
Browse files Browse the repository at this point in the history
closes #423
  • Loading branch information
tomuben authored Nov 26, 2024
1 parent 6ecad55 commit ad11849
Show file tree
Hide file tree
Showing 166 changed files with 5,734 additions and 3,177 deletions.
1 change: 1 addition & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Code name:
* #418: Use exasol/python-toolbox
* #411: Removed usage of exasol-bucketfs
* #425: Fixed type checks found by MyPy
* #423: Updated formatting
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys

from exasol_integration_test_docker_environment.cli.cli import cli
from exasol_integration_test_docker_environment.lib.api.api_errors import HealthProblem
from exasol_integration_test_docker_environment.lib import api
from exasol_integration_test_docker_environment.lib.api.api_errors import HealthProblem


@cli.command()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import Optional, Tuple
from typing import (
Optional,
Tuple,
)

import click

Expand All @@ -7,9 +10,10 @@
docker_repository_options,
)
from exasol_integration_test_docker_environment.cli.options.system_options import (
luigi_logging_options,
output_directory_option,
system_options,
tempory_base_directory_option, luigi_logging_options,
tempory_base_directory_option,
)
from exasol_integration_test_docker_environment.cli.options.test_environment_options import (
docker_db_options,
Expand Down Expand Up @@ -87,33 +91,33 @@
@add_options(system_options)
@add_options(luigi_logging_options)
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, ...],
docker_runtime: Optional[str],
docker_db_image_version: str,
docker_db_image_name: str,
db_os_access: Optional[str],
create_certificates: bool,
additional_db_parameter: Tuple[str, ...],
source_docker_repository_name: str,
source_docker_tag_prefix: str,
source_docker_username: Optional[str],
source_docker_password: Optional[str],
target_docker_repository_name: str,
target_docker_tag_prefix: str,
target_docker_username: Optional[str],
target_docker_password: Optional[str],
output_directory: str,
temporary_base_directory: str,
workers: int,
task_dependencies_dot_file: Optional[str],
log_level: Optional[str],
use_job_specific_log_file: bool
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, ...],
docker_runtime: Optional[str],
docker_db_image_version: str,
docker_db_image_name: str,
db_os_access: Optional[str],
create_certificates: bool,
additional_db_parameter: Tuple[str, ...],
source_docker_repository_name: str,
source_docker_tag_prefix: str,
source_docker_username: Optional[str],
source_docker_password: Optional[str],
target_docker_repository_name: str,
target_docker_tag_prefix: str,
target_docker_username: Optional[str],
target_docker_password: Optional[str],
output_directory: str,
temporary_base_directory: str,
workers: int,
task_dependencies_dot_file: Optional[str],
log_level: Optional[str],
use_job_specific_log_file: bool,
):
"""
This command spawns a test environment with a docker-db container and a connected test-container.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
import click

from exasol_integration_test_docker_environment.cli.options.system_options import tempory_base_directory_option, \
output_directory_option
from exasol_integration_test_docker_environment.cli.options.system_options import (
output_directory_option,
tempory_base_directory_option,
)

build_options = [
click.option('--force-rebuild/--no-force-rebuild', default=False,
help="Forces the system to complete rebuild all stages down to the stages "
"specified with the options --force-rebuild-from."),
click.option('--force-rebuild-from', multiple=True, type=str,
help="If the option --force-rebuild is given, "
"this options specifies for which stages and dependent stages system will force a rebuild. "
"The option can be repeated with different stages. "
"The system will than force the rebuild of these stages and their. dependet stages."
),
click.option('--force-pull/--no-force-pull', default=False,
help="Forces the system to pull all stages if available, otherwise it rebuilds a stage."),
click.option(
"--force-rebuild/--no-force-rebuild",
default=False,
help="Forces the system to complete rebuild all stages down to the stages "
"specified with the options --force-rebuild-from.",
),
click.option(
"--force-rebuild-from",
multiple=True,
type=str,
help="If the option --force-rebuild is given, "
"this options specifies for which stages and dependent stages system will force a rebuild. "
"The option can be repeated with different stages. "
"The system will than force the rebuild of these stages and their. dependet stages.",
),
click.option(
"--force-pull/--no-force-pull",
default=False,
help="Forces the system to pull all stages if available, otherwise it rebuilds a stage.",
),
output_directory_option,
tempory_base_directory_option,
click.option('--log-build-context-content/--no-log-build-context-content',
default=False,
help="For Debugging: Logs the files and directories in the build context of a stage"),
click.option('--cache-directory', default=None, type=click.Path(file_okay=False, dir_okay=True, exists=False),
help="Directory from where saved docker images can be loaded"),
click.option('--build-name', default=None, type=str,
help="Name of the build. For example: Repository + CI Build Number"),
click.option(
"--log-build-context-content/--no-log-build-context-content",
default=False,
help="For Debugging: Logs the files and directories in the build context of a stage",
),
click.option(
"--cache-directory",
default=None,
type=click.Path(file_okay=False, dir_okay=True, exists=False),
help="Directory from where saved docker images can be loaded",
),
click.option(
"--build-name",
default=None,
type=str,
help="Name of the build. For example: Repository + CI Build Number",
),
]
Original file line number Diff line number Diff line change
@@ -1,54 +1,84 @@
import click

DEFAULT_DOCKER_REPOSITORY_NAME = 'exasol/script-language-container'
DEFAULT_DOCKER_REPOSITORY_NAME = "exasol/script-language-container"

docker_repository_options = [
click.option('--source-docker-repository-name', type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for pulling cached stages. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>"),
click.option('--source-docker-tag-prefix', type=str,
default="",
show_default=True,
help="Prefix for the tags which are used for pulling of cached stages"),
click.option('--source-docker-username', type=str,
help="Username for the docker registry from where the system pulls cached stages.",
required=False),
click.option('--source-docker-password', type=str,
help="Password for the docker registry from where the system pulls cached stages. "
"Without password option the system prompts for the password."),
click.option('--target-docker-repository-name', type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for naming and pushing images of stages. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>"),
click.option('--target-docker-tag-prefix', type=str,
default="",
show_default=True,
help="Prefix for the tags which are used for naming and pushing of stages"),
click.option('--target-docker-username', type=str,
help="Username for the docker registry where the system pushes images of stages.",
required=False),
click.option('--target-docker-password', type=str,
help="Password for the docker registry where the system pushes images of stages. "
"Without password option the system prompts for the password."),
click.option(
"--source-docker-repository-name",
type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for pulling cached stages. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>",
),
click.option(
"--source-docker-tag-prefix",
type=str,
default="",
show_default=True,
help="Prefix for the tags which are used for pulling of cached stages",
),
click.option(
"--source-docker-username",
type=str,
help="Username for the docker registry from where the system pulls cached stages.",
required=False,
),
click.option(
"--source-docker-password",
type=str,
help="Password for the docker registry from where the system pulls cached stages. "
"Without password option the system prompts for the password.",
),
click.option(
"--target-docker-repository-name",
type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for naming and pushing images of stages. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>",
),
click.option(
"--target-docker-tag-prefix",
type=str,
default="",
show_default=True,
help="Prefix for the tags which are used for naming and pushing of stages",
),
click.option(
"--target-docker-username",
type=str,
help="Username for the docker registry where the system pushes images of stages.",
required=False,
),
click.option(
"--target-docker-password",
type=str,
help="Password for the docker registry where the system pushes images of stages. "
"Without password option the system prompts for the password.",
),
]

simple_docker_repository_options = [
click.option('--docker-repository-name', type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for naming images. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>"),
click.option('--docker-tag-prefix', type=str,
default="",
show_default=True,
help="Prefix for the tags of the images"),
click.option(
"--docker-repository-name",
type=str,
default=DEFAULT_DOCKER_REPOSITORY_NAME,
show_default=True,
help="Name of the docker repository for naming images. "
"The repository name may contain the URL of the docker registry, "
"the username and the actual repository name. "
"A common structure is <docker-registry-url>/<username>/<repository-name>",
),
click.option(
"--docker-tag-prefix",
type=str,
default="",
show_default=True,
help="Prefix for the tags of the images",
),
]
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import click

push_options = [
click.option('--force-push/--no-force-push', default=False,
help="Forces the system to overwrite existing images in registry for build steps that run"),
click.option('--push-all/--no-push-all', default=False,
help="Forces the system to push all images of build-steps that are specified by the goals")

]
click.option(
"--force-push/--no-force-push",
default=False,
help="Forces the system to overwrite existing images in registry for build steps that run",
),
click.option(
"--push-all/--no-push-all",
default=False,
help="Forces the system to push all images of build-steps that are specified by the goals",
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,50 @@

DEFAULT_OUTPUT_DIRECTORY = ".build_output"

output_directory_option = click.option('--output-directory', type=click.Path(file_okay=False, dir_okay=True),
default=DEFAULT_OUTPUT_DIRECTORY,
show_default=True,
help="Output directory where the system stores all output and log files.")
output_directory_option = click.option(
"--output-directory",
type=click.Path(file_okay=False, dir_okay=True),
default=DEFAULT_OUTPUT_DIRECTORY,
show_default=True,
help="Output directory where the system stores all output and log files.",
)

tempory_base_directory_option = click.option('--temporary-base-directory',
type=click.Path(file_okay=False,
dir_okay=True),
default="/tmp",
show_default=True,
help="Directory where the system creates temporary directories.")
tempory_base_directory_option = click.option(
"--temporary-base-directory",
type=click.Path(file_okay=False, dir_okay=True),
default="/tmp",
show_default=True,
help="Directory where the system creates temporary directories.",
)

system_options = [
click.option('--workers', type=int,
default=5, show_default=True,
help="Number of parallel workers"),
click.option('--task-dependencies-dot-file', type=click.Path(file_okay=True),
default=None, help="Path where to store the Task Dependency Graph as dot file"),
click.option(
"--workers",
type=int,
default=5,
show_default=True,
help="Number of parallel workers",
),
click.option(
"--task-dependencies-dot-file",
type=click.Path(file_okay=True),
default=None,
help="Path where to store the Task Dependency Graph as dot file",
),
]

luigi_logging_options = [
click.option('--log-level', type=click.Choice(['DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL']),
default=None, help="Log level used for console logging"),
click.option('--use-job-specific-log-file', type=bool,
default=True, help="Use a job specific log file which write the debug log "
"to the job directory in the build directory")
click.option(
"--log-level",
type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR", "FATAL"]),
default=None,
help="Log level used for console logging",
),
click.option(
"--use-job-specific-log-file",
type=bool,
default=True,
help="Use a job specific log file which write the debug log "
"to the job directory in the build directory",
),
]
Loading

0 comments on commit ad11849

Please sign in to comment.