-
Notifications
You must be signed in to change notification settings - Fork 83
feat(clp-package): Replace package execution container with clp-package; Change default taskfile task to docker-images:package.
#1357
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
Changes from 11 commits
fdc113f
2959d60
a1c2cb1
99c919c
b3a6b3e
16741ed
1789641
68dbc59
27e133e
572de87
e6fddbc
b4a8976
f0767a2
9fb998e
876f925
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -427,7 +427,7 @@ def load_config_file( | |
| clp_config = CLPConfig() | ||
|
|
||
| clp_config.make_config_paths_absolute(clp_home) | ||
| clp_config.load_execution_container_name() | ||
| clp_config.load_container_image_ref() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainLGTM! Central configuration loading updated to new container image reference mechanism. The change from Verify that 🏁 Script executed: #!/bin/bash
# Description: Verify error handling in load_container_image_ref for missing image ID and VERSION files
# Search for the implementation of load_container_image_ref
ast-grep --pattern $'def load_container_image_ref($$$):
$$$'
# Check for file existence checks and error handling
rg -nP -A10 'def load_container_image_ref' --type=pyLength of output: 2391 Add error handling for missing VERSION file in 🤖 Prompt for AI Agents |
||
|
|
||
| validate_path_for_container_mount(clp_config.data_directory) | ||
| validate_path_for_container_mount(clp_config.logs_directory) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,14 +83,13 @@ | |
| COMPRESSION_JOBS_TABLE_NAME = "compression_jobs" | ||
| COMPRESSION_TASKS_TABLE_NAME = "compression_tasks" | ||
|
|
||
| OS_RELEASE_FILE_PATH = pathlib.Path("etc") / "os-release" | ||
|
|
||
| CLP_DEFAULT_CREDENTIALS_FILE_PATH = pathlib.Path("etc") / "credentials.yml" | ||
| CLP_DEFAULT_DATA_DIRECTORY_PATH = pathlib.Path("var") / "data" | ||
| CLP_DEFAULT_DATASET_NAME = "default" | ||
| CLP_METADATA_TABLE_PREFIX = "clp_" | ||
| CLP_PACKAGE_CONTAINER_IMAGE_ID_PATH = pathlib.Path("clp-package-image.id") | ||
| CLP_SHARED_CONFIG_FILENAME = ".clp-config.yml" | ||
|
|
||
| CLP_VERSION_FILE_PATH = pathlib.Path("VERSION") | ||
|
|
||
| # Environment variable names | ||
| CLP_DB_USER_ENV_VAR_NAME = "CLP_DB_USER" | ||
|
|
@@ -876,7 +875,7 @@ def _get_env_var(name: str) -> str: | |
|
|
||
|
|
||
| class CLPConfig(BaseModel): | ||
| execution_container: Optional[str] = None | ||
| container_image_ref: Optional[str] = None | ||
|
|
||
| logs_input: Union[FsIngestionConfig, S3IngestionConfig] = FsIngestionConfig() | ||
|
|
||
|
|
@@ -902,7 +901,10 @@ class CLPConfig(BaseModel): | |
| logs_directory: pathlib.Path = pathlib.Path("var") / "log" | ||
| aws_config_directory: Optional[pathlib.Path] = None | ||
|
|
||
| _os_release_file_path: pathlib.Path = PrivateAttr(default=OS_RELEASE_FILE_PATH) | ||
| _container_image_id_path: pathlib.Path = PrivateAttr( | ||
| default=CLP_PACKAGE_CONTAINER_IMAGE_ID_PATH | ||
| ) | ||
| _version_file_path: pathlib.Path = PrivateAttr(default=CLP_VERSION_FILE_PATH) | ||
|
|
||
| @field_validator("aws_config_directory") | ||
| @classmethod | ||
|
|
@@ -919,7 +921,10 @@ def make_config_paths_absolute(self, clp_home: pathlib.Path): | |
| self.stream_output.storage.make_config_paths_absolute(clp_home) | ||
| self.data_directory = make_config_path_absolute(clp_home, self.data_directory) | ||
| self.logs_directory = make_config_path_absolute(clp_home, self.logs_directory) | ||
| self._os_release_file_path = make_config_path_absolute(clp_home, self._os_release_file_path) | ||
| self._container_image_id_path = make_config_path_absolute( | ||
| clp_home, self._container_image_id_path | ||
| ) | ||
| self._version_file_path = make_config_path_absolute(clp_home, self._version_file_path) | ||
|
|
||
| def validate_logs_input_config(self): | ||
| logs_input_type = self.logs_input.type | ||
|
|
@@ -1007,22 +1012,18 @@ def validate_aws_config_dir(self): | |
| "aws_config_directory should not be set when profile authentication is not used" | ||
| ) | ||
|
|
||
| def load_execution_container_name(self): | ||
| if self.execution_container is not None: | ||
| def load_container_image_ref(self): | ||
| if self.container_image_ref is not None: | ||
| # Accept configured value for debug purposes | ||
| return | ||
|
|
||
| os_release = dotenv_values(self._os_release_file_path) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should have removed the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: Length of output: 1741 🏁 Script executed: Length of output: 85 🏁 Script executed: Length of output: 42 @junhaoliao, I've filed issue #1443 to track the removal of the unused Summary:
The issue has been assigned to you with the tasks and context needed for the cleanup. 🧬 Code Graph Analysis Resultscomponents/clp-py-utils/clp_py_utils/clp_config.py [Snippet 1]
|
||
| if "ubuntu" == os_release["ID"]: | ||
| self.execution_container = ( | ||
| f"clp-execution-x86-{os_release['ID']}-{os_release['VERSION_CODENAME']}:main" | ||
| ) | ||
| if self._container_image_id_path.exists(): | ||
| with open(self._container_image_id_path) as image_id_file: | ||
| self.container_image_ref = image_id_file.read().strip() | ||
| else: | ||
| raise NotImplementedError( | ||
| f"Unsupported OS {os_release['ID']} in {OS_RELEASE_FILE_PATH}" | ||
| ) | ||
|
|
||
| self.execution_container = "ghcr.io/y-scope/clp/" + self.execution_container | ||
| with open(self._version_file_path) as version_file: | ||
| clp_package_version = version_file.read().strip() | ||
| self.container_image_ref = f"ghcr.io/y-scope/clp/clp-package:{clp_package_version}" | ||
|
|
||
| def get_shared_config_file_path(self) -> pathlib.Path: | ||
| return self.logs_directory / CLP_SHARED_CONFIG_FILENAME | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ vars: | |
|
|
||
| tasks: | ||
| default: | ||
| deps: ["package"] | ||
| deps: ["docker-images:package"] | ||
|
|
||
| clean: | ||
| cmds: | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now get rid of
inputs.image_type, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hesitated, thinking we might still need
inputs.image_typeto build a different minimal worker image for multi-node deployments. since that isn't coming any time soon andinputs.image_typeis unused for now, i agree we should remove