Skip to content

Commit 0175a1e

Browse files
committed
AL-5634: Integrate shared library into CLBS and ALBS
1 parent 61b1443 commit 0175a1e

19 files changed

Lines changed: 140 additions & 1463 deletions

almalinux_sign_node.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,33 @@
44
# created: 2018-03-31
55

66
"""
7-
CloudLinux Build System builds sign node.
7+
AlmaLinux Build System builds sign node.
88
"""
99

1010
import argparse
1111
import logging
1212
import sys
1313

1414
import sentry_sdk
15+
from albs_common_lib.errors import ConfigurationError
16+
from albs_common_lib.utils.file_utils import clean_dir, safe_mkdir
17+
from albs_common_lib.utils.pgp_utils import PGPPasswordDB, init_gpg
1518

1619
from sign_node.config import SignNodeConfig
17-
from sign_node.errors import ConfigurationError
1820
from sign_node.signer import Signer
1921
from sign_node.utils.config import locate_config_file
20-
from sign_node.utils.file_utils import clean_dir, safe_mkdir
21-
from sign_node.utils.pgp_utils import PGPPasswordDB, init_gpg
2222

2323

2424
def init_arg_parser():
2525
parser = argparse.ArgumentParser(
26-
prog="sign_node", description="CloudLinux Build System builds sign node"
26+
prog="sign_node", description="AlmaLinux Build System builds sign node"
2727
)
2828
parser.add_argument("-c", "--config", help="configuration file path")
2929
parser.add_argument(
30-
"-v", "--verbose", action="store_true", help="enable additional debug output"
30+
"-v",
31+
"--verbose",
32+
action="store_true",
33+
help="enable additional debug output",
3134
)
3235
return parser
3336

@@ -70,7 +73,10 @@ def main():
7073
logger = init_logger(args.verbose)
7174
try:
7275
config_file = locate_config_file('sign_node', args.config)
73-
logger.debug("Loading %s", config_file if config_file else 'default configuration')
76+
logger.debug(
77+
"Loading %s",
78+
config_file if config_file else 'default configuration',
79+
)
7480
config = SignNodeConfig(config_file)
7581
except ValueError as e:
7682
args_parser.error('Configuration error: {0}'.format(e))
@@ -82,7 +88,7 @@ def main():
8288
key_ids_from_config=config.pgp_keys.copy(),
8389
is_community_sign_node=config.is_community_sign_node,
8490
development_mode=config.development_mode,
85-
development_password=config.dev_pgp_key_password
91+
development_password=config.dev_pgp_key_password,
8692
)
8793
try:
8894
password_db.ask_for_passwords()

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
plumbum==1.9.0
22
requests>=2.31.0
33
filesplit==3.0.2
4-
pulpcore-client==3.68.0
4+
pulpcore-client==3.69.0
55
scikit_build==0.18.1
66
cerberus==1.3.5
77
validators==0.34.0
88
pycurl==7.45.3
99
pyyaml==6.0.2
10-
pydantic==2.9.2
1110
pexpect==4.9.0
1211
python-gnupg==0.5.3
1312
sentry-sdk==2.18.0
1413
websocket-client==1.8.0
1514
# Pin cryptography module for now. More info at:
1615
# https://jasonralph.org/?p=997
1716
cryptography==43.0.3
18-
pgpy==0.6.0
1917
git+https://github.com/AlmaLinux/immudb-wrapper.git@0.1.4#egg=immudb_wrapper
18+
git+https://github.com/AlmaLinux/albs-sign-lib.git@0.1.0#egg=albs_sign_lib

sign_node/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# created: 2018-03-31
44

55
"""
6-
CloudLinux Build System builds sign node module.
6+
AlmaLinux Build System builds sign node module.
77
"""

sign_node/config.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,26 @@
33
# created: 2018-03-31
44

55
"""
6-
CloudLinux Build System builds sign node configuration storage.
6+
AlmaLinux Build System builds sign node configuration storage.
77
"""
88

9-
from .utils.config import BaseConfig
10-
from .utils.file_utils import normalize_path
11-
12-
__all__ = ["SignNodeConfig"]
9+
from albs_common_lib.utils.file_utils import normalize_path
10+
from albs_sign_lib.constants import DEFAULT_PARALLEL_FILE_UPLOAD_SIZE
1311

12+
from .utils.config import BaseConfig
1413

1514
DEFAULT_MASTER_URL = 'http://web_server:8000/api/v1/'
1615
DEFAULT_WS_MASTER_URL = 'ws://web_server:8000/api/v1/'
1716
DEFAULT_PULP_HOST = "http://pulp"
1817
DEFAULT_PULP_USER = "pulp"
1918
DEFAULT_PULP_PASSWORD = "test_pwd"
2019
DEFAULT_PULP_CHUNK_SIZE = 8388608 # 8 MiB
21-
# Max file size to allow parallel upload for
22-
DEFAULT_PARALLEL_FILE_UPLOAD_SIZE = 52428800 # 500 MB
2320
DEFAULT_PGP_PASSWORD = "test_pwd"
2421
DEFAULT_SENTRY_DSN = ""
2522
DEFAULT_SENTRY_ENVIRONMENT = "dev"
2623
DEFAULT_SENTRY_TRACES_SAMPLE_RATE = 0.2
2724
DEFAULT_JWT_TOKEN = "test_jwt"
2825

29-
COMMUNITY_KEY_SUFFIX = 'ALBS community repo'
30-
3126
GPG_SCENARIO_TEMPLATE = (
3227
'%no-protection\n'
3328
'Key-Type: RSA\n'
@@ -64,6 +59,7 @@ def __init__(self, config_file=None, **cmd_args):
6459
"pulp_user": DEFAULT_PULP_USER,
6560
"pulp_password": DEFAULT_PULP_PASSWORD,
6661
"pulp_chunk_size": DEFAULT_PULP_CHUNK_SIZE,
62+
"parallel_upload": True,
6763
"parallel_upload_file_size": DEFAULT_PARALLEL_FILE_UPLOAD_SIZE,
6864
"dev_pgp_key_password": DEFAULT_PGP_PASSWORD,
6965
'sentry_dsn': DEFAULT_SENTRY_DSN,
@@ -83,13 +79,24 @@ def __init__(self, config_file=None, **cmd_args):
8379
"node_id": {"type": "string", "required": True},
8480
"master_url": {"type": "string", "required": True},
8581
"ws_master_url": {"type": "string", "required": True},
86-
"working_dir": {"type": "string", "required": True,
87-
"coerce": normalize_path},
82+
"working_dir": {
83+
"type": "string",
84+
"required": True,
85+
"coerce": normalize_path,
86+
},
8887
"pulp_host": {"type": "string", "nullable": False},
8988
"pulp_user": {"type": "string", "nullable": False},
9089
"pulp_password": {"type": "string", "nullable": False},
9190
"pulp_chunk_size": {"type": "integer", "nullable": False},
92-
"parallel_upload_file_size": {"type": "integer", "nullable": False},
91+
"parallel_upload": {
92+
"type": "boolean",
93+
"nullable": False,
94+
"default": True,
95+
},
96+
"parallel_upload_file_size": {
97+
"type": "integer",
98+
"nullable": False,
99+
},
93100
"jwt_token": {"type": "string", "required": True},
94101
"dev_pgp_key_password": {"type": "string", "nullable": False},
95102
"sentry_dsn": {"type": "string", "nullable": True},
@@ -101,7 +108,8 @@ def __init__(self, config_file=None, **cmd_args):
101108
'immudb_address': {'type': 'string', 'nullable': True},
102109
'immudb_public_key_file': {'type': 'string', 'nullable': True},
103110
'files_sign_cert_path': {
104-
'type': 'string', 'required': False,
111+
'type': 'string',
112+
'required': False,
105113
'coerce': normalize_path,
106114
},
107115
}

sign_node/errors.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

sign_node/models.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

sign_node/package_sign.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)