-
Notifications
You must be signed in to change notification settings - Fork 10
feat: migrate AKernel deployment to Python YuanRong CLI #19
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
Open
mhsong1998-dot
wants to merge
1
commit into
inclusionAI:main
Choose a base branch
from
mhsong1998-dot:smh/python-cli-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
builder/config/openyuanrong-core-0.10.2rc2.constraints.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Runtime dependency lock for openyuanrong-core 0.10.2rc2 on Python 3.12. | ||
| # Regenerate and validate this file for both linux/amd64 and linux/arm64 when | ||
| # OPEN_YR_VERSION changes. | ||
| aiohappyeyeballs==2.7.1 | ||
| aiohttp==3.14.3 | ||
| aiosignal==1.4.0 | ||
| anyio==4.14.2 | ||
| attrs==26.1.0 | ||
| certifi==2026.7.22 | ||
| charset-normalizer==3.5.1 | ||
| click==8.4.2 | ||
| cloudpickle==3.1.2 | ||
| frozenlist==1.8.0 | ||
| h11==0.16.0 | ||
| httpcore==1.0.9 | ||
| httpx==0.28.1 | ||
| idna==3.19 | ||
| jinja2==3.1.6 | ||
| markupsafe==3.0.3 | ||
| msgpack==1.2.1 | ||
| multidict==6.7.1 | ||
| propcache==0.5.2 | ||
| protobuf==7.36.0 | ||
| pyyaml==6.0.3 | ||
| requests==2.34.2 | ||
| tomli-w==1.2.0 | ||
| typing-extensions==4.16.0 | ||
| urllib3==2.7.0 | ||
| websockets==17.0.1 | ||
| yarl==1.24.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| {# | ||
| AKernel runtime profile template. | ||
|
|
||
| Deployment values are resolved from the CLI-provided env mapping. Strings | ||
| containing Python CLI runtime expressions remain escaped for its second | ||
| rendering pass. | ||
| #} | ||
| {% macro toml_string(value) -%} | ||
| "{%- for char in value -%} | ||
| {%- set encoded = char | tojson -%} | ||
| {{- char if encoded | length == 14 else encoded[1:-1] -}} | ||
| {%- endfor -%}" | ||
| {%- endmacro %} | ||
| {% set role = env["AKERNEL_ROLE"] %} | ||
| {% set cluster_roles = ["master", "frontend"] %} | ||
| {% set node_roles = ["node", "standalone"] %} | ||
| {% if role not in cluster_roles + node_roles %} | ||
| {{ unsupported_akernel_role }} | ||
| {% endif %} | ||
| {% set is_cluster = role in cluster_roles %} | ||
| {% set is_node = role in node_roles %} | ||
| {% set is_agent = role == "node" %} | ||
| {% set is_standalone = role == "standalone" %} | ||
| {% set has_master_mode = not is_agent %} | ||
| {% set enable_metrics = env.get("ENABLE_METRICS", "false") | lower %} | ||
| {% set enable_trace = env.get("ENABLE_TRACE", "false") | lower %} | ||
| {% set traefik_enable_tls = "true" if env.get("TRAEFIK_ENABLE_TLS", "false") | lower == "true" else "false" %} | ||
| {% set configured_host_ip = env.get("YR_NODE_IP", "") | trim %} | ||
| {% set configured_local_ip = env.get("YR_LOCAL_IP", "") | trim %} | ||
| {% set enable_faas_frontend = env.get("ENABLE_FAAS_FRONTEND", "true") | lower %} | ||
| {% set enable_iam_server = env.get("ENABLE_IAM_SERVER", "true") | lower %} | ||
| {% set runtime_hostname = "{{ hostname }}" %} | ||
| {% set deploy_path_value = env["DEPLOY_PATH"] | trim %} | ||
| {% set component_log_path = env["YR_LOG_PATH"] | trim %} | ||
| {% set ds_worker_log_path = component_log_path ~ "/data_system/worker" %} | ||
|
|
||
| # Generated at startup from builder/config/yr/config.toml.jinja. | ||
|
|
||
| [values] | ||
| node_id = "{{ runtime_hostname }}" | ||
| deploy_path = {{ toml_string(deploy_path_value) }} | ||
| {% if configured_host_ip %} | ||
| host_ip = {{ toml_string(configured_host_ip) }} | ||
| {% endif %} | ||
| {% if configured_local_ip %} | ||
| local_ip = {{ toml_string(configured_local_ip) }} | ||
| {% endif %} | ||
| {% if is_cluster %} | ||
| cpu_num = 1 | ||
| memory_num = 3904 | ||
| shared_memory_num = 4096 | ||
| {% endif %} | ||
|
|
||
| [values.fs.log] | ||
| path = {{ toml_string(component_log_path) }} | ||
|
|
||
| [values.fs.tls] | ||
| base_path = "/home/yuanrong/.cert" | ||
|
|
||
| {% if not is_standalone %} | ||
| [values.etcd] | ||
| enable_multi_master = true | ||
| {% endif %} | ||
|
|
||
| {% if is_cluster or is_node %} | ||
| [[values.etcd.address]] | ||
| ip = {{ toml_string(configured_host_ip if is_standalone else env["ETCD_ADDRESS"]) }} | ||
| port = {{ env.get("ETCD_PORT", "2379") }} | ||
| peer_port = {{ env.get("ETCD_PEER_PORT", "2378") }} | ||
| {% endif %} | ||
|
|
||
| [values.frontend] | ||
| ssl_enable = true | ||
| client_auth_type = "NoClientCert" | ||
| frontend_lease_bypass = true | ||
| enable_function_token_auth = true | ||
| enable_func_token_auth = true | ||
| {% if role == "frontend" %} | ||
| meta_service_address = {{ toml_string(env["META_SERVICE_ADDRESS"]) }} | ||
| {% endif %} | ||
| iam_server_address = "127.0.0.1:31113" | ||
|
|
||
| [values.meta_service] | ||
| port = 31111 | ||
|
|
||
| {% if has_master_mode %} | ||
| [mode.master] | ||
| etcd = {{ "true" if is_standalone else "false" }} | ||
| ds_master = {{ "true" if is_standalone else "false" }} | ||
| frontend = {{ enable_faas_frontend if role == "master" else "true" if role in ["frontend", "standalone"] else "false" }} | ||
| function_master = {{ "true" if role in ["master", "standalone"] else "false" }} | ||
| function_scheduler = false | ||
| meta_service = {{ "true" if role in ["master", "standalone"] else "false" }} | ||
| iam_server = {{ enable_iam_server if role == "master" else "true" if role in ["frontend", "standalone"] else "false" }} | ||
| {% endif %} | ||
|
|
||
| [ds_worker.health_check] | ||
| endpoint = {{ toml_string(ds_worker_log_path ~ "/health") }} | ||
|
|
||
| [ds_worker.args] | ||
| log_dir = {{ toml_string(ds_worker_log_path) }} | ||
| health_check_path = {{ toml_string(ds_worker_log_path ~ "/health") }} | ||
| ready_check_path = {{ toml_string(ds_worker_log_path ~ "/ready") }} | ||
| {% if is_cluster %} | ||
| rpc_thread_num = 128 | ||
| node_timeout_s = 10 | ||
| node_dead_timeout_s = 30 | ||
| heartbeat_interval_ms = 3000 | ||
| {% endif %} | ||
| {% if is_node %} | ||
| node_timeout_s = 30 | ||
| client_dead_timeout_s = 60 | ||
| heartbeat_interval_ms = 1000 | ||
| node_dead_timeout_s = 120 | ||
| {% endif %} | ||
|
|
||
| [ds_master.args] | ||
| log_dir = {{ toml_string(component_log_path ~ "/data_system/master") }} | ||
|
|
||
| [function_master.args] | ||
| services_path = "/home/yuanrong/deploy/process/services.yaml" | ||
| metrics_config_file = "/home/yuanrong/metrics/metrics_config.json" | ||
| traefik_enable_tls = {{ traefik_enable_tls }} | ||
| traefik_http_entry_point = {{ toml_string(env.get("TRAEFIK_HTTP_ENTRYPOINT", "websecure")) }} | ||
| traefik_forward_timeout_ms = 3000 | ||
| {% if enable_metrics == "true" and (is_cluster or is_standalone) %} | ||
| enable_metrics = true | ||
| {% endif %} | ||
| {% if enable_trace == "true" and (is_cluster or is_standalone) %} | ||
| enable_trace = true | ||
| trace_config = {{ toml_string(env["YR_TRACE_CONFIG_CONTENT"]) }} | ||
| {% endif %} | ||
| {% if is_cluster or is_standalone %} | ||
| enable_traefik_provider = {{ "true" if env.get("TRAEFIK_MODE", "etcd") == "http" else "false" }} | ||
| {% endif %} | ||
| {% if is_cluster %} | ||
| system_timeout = 300000 | ||
| schedule_relaxed = 20 | ||
| {% elif is_standalone %} | ||
| system_timeout = 60000 | ||
| {% endif %} | ||
|
|
||
| [function_proxy.args] | ||
| services_path = "/home/yuanrong/deploy/process/services.yaml" | ||
| enable_inherit_env = false | ||
| npu_collection_mode = "off" | ||
| metrics_config_file = "/home/yuanrong/metrics/metrics_config.json" | ||
| enable_direct_routing = false | ||
| force_low_reliability_instance = true | ||
| traefik_enable_tls = {{ traefik_enable_tls }} | ||
| {% if enable_metrics == "true" %} | ||
| enable_metrics = true | ||
| {% endif %} | ||
| {% if enable_trace == "true" %} | ||
| enable_trace = true | ||
| trace_config = {{ toml_string(env["YR_TRACE_CONFIG_CONTENT"]) }} | ||
| {% endif %} | ||
| {% if is_node %} | ||
| enable_traefik_registry = {{ "true" if env.get("TRAEFIK_MODE", "etcd") == "etcd" else "false" }} | ||
| traefik_http_entrypoint = {{ toml_string(env.get("TRAEFIK_HTTP_ENTRYPOINT", "websecure")) }} | ||
| {% endif %} | ||
| log_expiration_enable = true | ||
| log_expiration_time_threshold = {{ 10 if is_agent else 7200 }} | ||
| log_expiration_cleanup_interval = {{ 10 if is_agent else 600 }} | ||
| log_expiration_max_file_count = {{ 50 if is_agent else 256 }} | ||
| {% if is_cluster %} | ||
| system_timeout = 300000 | ||
| pseudo_data_plane = true | ||
| {% elif is_node %} | ||
| system_timeout = 60000 | ||
| fc_agent_mgr_retry_times = 30 | ||
| fc_agent_mgr_retry_cycle = 60000 | ||
| {% endif %} | ||
| runtime_logs_dir = {{ toml_string(component_log_path) }} | ||
| {% if is_node %} | ||
| metrics_collector_type = "external" | ||
| snapshot_storage_mode = "local_only" | ||
| checkpoint_dir = "/home/akernel/checkpoints" | ||
| {% endif %} | ||
|
|
||
| # The CLI exposes the meta-service component port separately from values.meta_service. | ||
| [meta_service] | ||
| port = 31111 | ||
|
|
||
| [iam_server.args] | ||
| token_expired_time_span = 604800 | ||
| ssl_enable = true | ||
| iam_ssl_enable = true | ||
| local_listen_port = 31113 | ||
| local_ip = "127.0.0.1" | ||
| {% if enable_trace == "true" and (is_cluster or is_standalone) %} | ||
| enable_trace = true | ||
| {% endif %} | ||
|
|
||
| {% if enable_trace == "true" and (is_cluster or is_standalone) %} | ||
| [frontend.env] | ||
| ENABLE_TRACE = "true" | ||
| TRACE_CONFIG = {{ toml_string(env["YR_TRACE_CONFIG_CONTENT"]) }} | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.