Skip to content

Commit

Permalink
AL-5634: Integrate shared library into CLBS and ALBS
Browse files Browse the repository at this point in the history
  • Loading branch information
maccelf committed Jan 16, 2025
1 parent 61b1443 commit 091dde2
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 1,461 deletions.
22 changes: 14 additions & 8 deletions almalinux_sign_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@
# created: 2018-03-31

"""
CloudLinux Build System builds sign node.
AlmaLinux Build System builds sign node.
"""

import argparse
import logging
import sys

import sentry_sdk
from albs_common_lib.errors import ConfigurationError
from albs_common_lib.utils.file_utils import clean_dir, safe_mkdir
from albs_common_lib.utils.pgp_utils import PGPPasswordDB, init_gpg

from sign_node.config import SignNodeConfig
from sign_node.errors import ConfigurationError
from sign_node.signer import Signer
from sign_node.utils.config import locate_config_file
from sign_node.utils.file_utils import clean_dir, safe_mkdir
from sign_node.utils.pgp_utils import PGPPasswordDB, init_gpg


def init_arg_parser():
parser = argparse.ArgumentParser(
prog="sign_node", description="CloudLinux Build System builds sign node"
prog="sign_node", description="AlmaLinux Build System builds sign node"
)
parser.add_argument("-c", "--config", help="configuration file path")
parser.add_argument(
"-v", "--verbose", action="store_true", help="enable additional debug output"
"-v",
"--verbose",
action="store_true",
help="enable additional debug output",
)
return parser

Expand Down Expand Up @@ -70,7 +73,10 @@ def main():
logger = init_logger(args.verbose)
try:
config_file = locate_config_file('sign_node', args.config)
logger.debug("Loading %s", config_file if config_file else 'default configuration')
logger.debug(
"Loading %s",
config_file if config_file else 'default configuration',
)
config = SignNodeConfig(config_file)
except ValueError as e:
args_parser.error('Configuration error: {0}'.format(e))
Expand All @@ -82,7 +88,7 @@ def main():
key_ids_from_config=config.pgp_keys.copy(),
is_community_sign_node=config.is_community_sign_node,
development_mode=config.development_mode,
development_password=config.dev_pgp_key_password
development_password=config.dev_pgp_key_password,
)
try:
password_db.ask_for_passwords()
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
plumbum==1.9.0
requests>=2.31.0
filesplit==3.0.2
pulpcore-client==3.68.0
pulpcore-client==3.69.0
scikit_build==0.18.1
cerberus==1.3.5
validators==0.34.0
pycurl==7.45.3
pyyaml==6.0.2
pydantic==2.9.2
pexpect==4.9.0
python-gnupg==0.5.3
sentry-sdk==2.18.0
websocket-client==1.8.0
# Pin cryptography module for now. More info at:
# https://jasonralph.org/?p=997
cryptography==43.0.3
pgpy==0.6.0
git+https://github.com/AlmaLinux/immudb-wrapper.git@0.1.4#egg=immudb_wrapper
git+https://github.com/AlmaLinux/albs-sign-lib.git@0.1.0#egg=albs_sign_lib
2 changes: 1 addition & 1 deletion sign_node/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# created: 2018-03-31

"""
CloudLinux Build System builds sign node module.
AlmaLinux Build System builds sign node module.
"""
34 changes: 21 additions & 13 deletions sign_node/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,26 @@
# created: 2018-03-31

"""
CloudLinux Build System builds sign node configuration storage.
AlmaLinux Build System builds sign node configuration storage.
"""

from .utils.config import BaseConfig
from .utils.file_utils import normalize_path

__all__ = ["SignNodeConfig"]
from albs_common_lib.utils.file_utils import normalize_path
from albs_sign_lib.constants import DEFAULT_PARALLEL_FILE_UPLOAD_SIZE

from .utils.config import BaseConfig

DEFAULT_MASTER_URL = 'http://web_server:8000/api/v1/'
DEFAULT_WS_MASTER_URL = 'ws://web_server:8000/api/v1/'
DEFAULT_PULP_HOST = "http://pulp"
DEFAULT_PULP_USER = "pulp"
DEFAULT_PULP_PASSWORD = "test_pwd"
DEFAULT_PULP_CHUNK_SIZE = 8388608 # 8 MiB
# Max file size to allow parallel upload for
DEFAULT_PARALLEL_FILE_UPLOAD_SIZE = 52428800 # 500 MB
DEFAULT_PGP_PASSWORD = "test_pwd"
DEFAULT_SENTRY_DSN = ""
DEFAULT_SENTRY_ENVIRONMENT = "dev"
DEFAULT_SENTRY_TRACES_SAMPLE_RATE = 0.2
DEFAULT_JWT_TOKEN = "test_jwt"

COMMUNITY_KEY_SUFFIX = 'ALBS community repo'

GPG_SCENARIO_TEMPLATE = (
'%no-protection\n'
'Key-Type: RSA\n'
Expand Down Expand Up @@ -64,6 +59,7 @@ def __init__(self, config_file=None, **cmd_args):
"pulp_user": DEFAULT_PULP_USER,
"pulp_password": DEFAULT_PULP_PASSWORD,
"pulp_chunk_size": DEFAULT_PULP_CHUNK_SIZE,
"parallel_upload": True,
"parallel_upload_file_size": DEFAULT_PARALLEL_FILE_UPLOAD_SIZE,
"dev_pgp_key_password": DEFAULT_PGP_PASSWORD,
'sentry_dsn': DEFAULT_SENTRY_DSN,
Expand All @@ -83,13 +79,24 @@ def __init__(self, config_file=None, **cmd_args):
"node_id": {"type": "string", "required": True},
"master_url": {"type": "string", "required": True},
"ws_master_url": {"type": "string", "required": True},
"working_dir": {"type": "string", "required": True,
"coerce": normalize_path},
"working_dir": {
"type": "string",
"required": True,
"coerce": normalize_path,
},
"pulp_host": {"type": "string", "nullable": False},
"pulp_user": {"type": "string", "nullable": False},
"pulp_password": {"type": "string", "nullable": False},
"pulp_chunk_size": {"type": "integer", "nullable": False},
"parallel_upload_file_size": {"type": "integer", "nullable": False},
"parallel_upload": {
"type": "boolean",
"nullable": False,
"default": True,
},
"parallel_upload_file_size": {
"type": "integer",
"nullable": False,
},
"jwt_token": {"type": "string", "required": True},
"dev_pgp_key_password": {"type": "string", "nullable": False},
"sentry_dsn": {"type": "string", "nullable": True},
Expand All @@ -101,7 +108,8 @@ def __init__(self, config_file=None, **cmd_args):
'immudb_address': {'type': 'string', 'nullable': True},
'immudb_public_key_file': {'type': 'string', 'nullable': True},
'files_sign_cert_path': {
'type': 'string', 'required': False,
'type': 'string',
'required': False,
'coerce': normalize_path,
},
}
Expand Down
96 changes: 0 additions & 96 deletions sign_node/errors.py

This file was deleted.

18 changes: 0 additions & 18 deletions sign_node/models.py

This file was deleted.

87 changes: 0 additions & 87 deletions sign_node/package_sign.py

This file was deleted.

Loading

0 comments on commit 091dde2

Please sign in to comment.