diff --git a/compose/ai.yml b/compose/ai.yml deleted file mode 100644 index d4c448d..0000000 --- a/compose/ai.yml +++ /dev/null @@ -1,26 +0,0 @@ -services: - ai: - image: ${NAMESPACE:-jumpserver}/core:${VERSION} - container_name: jms_ai - hostname: jms_ai - ulimits: - core: 0 - restart: always - command: start ai - env_file: - - ${CONFIG_FILE} - environment: - CORE_WORKER: ${CHAT_AI_WORKERS:-2} - CHAT_AI_CORE_BASE_URL: ${CHAT_AI_CORE_BASE_URL:-http://core:8080} - LC_ALL: C.UTF-8 - volumes: - - ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs - - ${VOLUME_DIR}/core/data:/opt/jumpserver/data - healthcheck: - test: "check http://localhost:8088/api/health/" - interval: 10s - timeout: 5s - retries: 3 - start_period: 30s - networks: - - net diff --git a/compose/kael.yml b/compose/kael.yml new file mode 100644 index 0000000..e90c67b --- /dev/null +++ b/compose/kael.yml @@ -0,0 +1,20 @@ +services: + kael: + image: ${NAMESPACE:-jumpserver}/kael:${VERSION} + container_name: jms_kael + hostname: jms_kael + ulimits: + core: 0 + restart: always + env_file: + - ${CONFIG_SAFE_FILE} + volumes: + - ${VOLUME_DIR}/kael/data:/opt/kael/data + healthcheck: + test: "check http://localhost:8083/kael/health/ready" + interval: 10s + timeout: 5s + retries: 3 + start_period: 30s + networks: + - net diff --git a/compose/web.yml b/compose/web.yml index c5f9cd0..dcff40c 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -18,10 +18,9 @@ services: GZIP: ${GZIP:-on} CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-4096m} CORE_ENABLED: ${CORE_ENABLED:-1} - CHAT_AI_SERVICE_ENABLED: ${AI_ENABLED:-1} KOKO_ENABLED: ${KOKO_ENABLED:-1} CHEN_ENABLED: ${CHEN_ENABLED:-1} - KAEL_ENABLED: ${KAEL_ENABLED:-0} + KAEL_ENABLED: ${KAEL_ENABLED:-1} RAZOR_ENABLED: ${RAZOR_ENABLED:-1} # Compatibility for older web images; the value is derived from the # edition and is not a user-configurable JDMC switch. diff --git a/config-example.txt b/config-example.txt index 05d58f8..7823265 100644 --- a/config-example.txt +++ b/config-example.txt @@ -145,7 +145,7 @@ DOMAINS= # Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off # CORE_ENABLED=0 -# AI_ENABLED=0 +# KAEL_ENABLED=0 # CELERY_ENABLED=0 # KOKO_ENABLED=0 # CHEN_ENABLED=0 @@ -153,11 +153,6 @@ DOMAINS= # VIDEO_WORKER_ENABLED=0 # CELERY_PRIVILEGED=false -# Chat AI runs in an independent container and reuses the Core image. -# -# CHAT_AI_WORKERS=2 -# CHAT_AI_CORE_BASE_URL=http://core:8080 - # JDMC is installed as a mandatory host-side systemd service when USE_XPACK=1. # Community Edition does not download or install JDMC. JDMC inherits VOLUME_DIR # from the installer and has no separate enable/disable switch. diff --git a/scripts/gists/image.sh b/scripts/gists/image.sh index 3b724ae..5b795bc 100644 --- a/scripts/gists/image.sh +++ b/scripts/gists/image.sh @@ -51,7 +51,7 @@ function get_image_mappings() { for service in ${enabled_services}; do case "${service}" in - "" | ai | celery | jdmc) + "" | celery | jdmc) ;; *) emit_image_mapping \ diff --git a/scripts/gists/service.sh b/scripts/gists/service.sh index 8d0a350..b4e14c5 100644 --- a/scripts/gists/service.sh +++ b/scripts/gists/service.sh @@ -1,5 +1,5 @@ -common_services=(core ai celery koko chen web) +common_services=(core kael celery koko chen web) xpack_services=(magnus razor xrdp video-worker nec) diff --git a/tests/test_compose.sh b/tests/test_compose.sh index 85e5ab4..54aac2b 100755 --- a/tests/test_compose.sh +++ b/tests/test_compose.sh @@ -15,13 +15,21 @@ mkdir -p "${test_dir}" cp "${TEST_ROOT}/config-example.txt" "${test_dir}/config.txt" cp "${TEST_ROOT}/config-example.txt" "${test_dir}/config_safe.txt" -( +default_config=$( cd "${TEST_ROOT}" export JS_CONFIG_DIR="${test_dir}" . ./scripts/utils.sh compose_cmd=$(get_docker_compose_cmd_line) - ${compose_cmd} --env-file "${CONFIG_FILE}" config --quiet + assert_contains "${compose_cmd}" 'compose/kael.yml' 'default Compose command must include Kael' + if [[ "${compose_cmd}" == *'compose/ai.yml'* ]]; then + fail 'default Compose command must not include the removed AI service' + fi + ${compose_cmd} --env-file "${CONFIG_FILE}" config ) +assert_contains "${default_config}" 'jms_kael' 'rendered Compose config must contain Kael' +if [[ "${default_config}" == *'jms_ai'* ]]; then + fail 'rendered Compose config must not contain the removed AI service' +fi printf '%s\n' \ 'USE_XPACK=1' \ @@ -48,6 +56,7 @@ offline_manifest=$( . ./scripts/utils.sh get_offline_image_manifest ) +assert_contains "${offline_manifest}" 'jumpserver/kael:' 'offline manifest must contain the Kael image' for optional_image in elasticsearch minio grafana/loki grafana/promtail; do if [[ "${offline_manifest}" == *"${optional_image}"* ]]; then fail "optional image must not be included in the offline manifest: ${optional_image}"