您可以在 CycleCloud 叢集上修改叢集定義組態區段中的 ,以啟用 run_list。 HTCondor 叢集有三個基本元件。 第一個是中央管理員,可提供排程和管理精靈。 第二個元件是一或多個排程器,工作會從其中提交至系統。 最後一個元件是一或多個執行節點,也就是執行計算的主機。 簡單的 HTCondor 範本可能如下所示:
[cluster htcondor]
[[node manager]]
ImageName = cycle.image.centos7
MachineType = Standard_A4 # 8 cores
[[[configuration]]]
run_list = role[central_manager]
[[node scheduler]]
ImageName = cycle.image.centos7
MachineType = Standard_A4 # 8 cores
[[[configuration]]]
run_list = role[condor_scheduler_role],role[filer_role],role[scheduler]
[[nodearray execute]]
ImageName = cycle.image.centos7
MachineType = Standard_A1 # 1 core
Count = 1
[[[configuration]]]
run_list = role[usc_execute]
當您在 CycleCloud 中匯入並啟動具有此定義的叢集時,會取得「管理員」和「排程器」節點,以及一個「執行」節點。 您可以使用 命令,將「執行」cyclecloud add_node節點新增至叢集。 若要再多新增 10 個「執行」節點,請使用下列命令:
cyclecloud add_node htcondor -t execute -c 10
HTCondor 自動調整
CycleCloud 支援 HTCondor 的自動調整。 軟體會監視佇列的狀態,並視需要開啟和關閉節點,以最佳時間和成本完成工作。 若要啟用 HTCondor 的自動調整功能,請將 Autoscale=true 新增至您的叢集定義:
[cluster htcondor]
Autoscale = True
HTCondor 進階使用方式
如果您知道作業的平均執行時間,請在作業中定義 average_runtime (以分鐘為單位)。 CycleCloud 會使用該值來啟動節點數目下限。 例如,如果提交五個 10 分鐘的作業,且 average_runtime 設定為 10,CycleCloud 只會啟動一個節點,而不是五個節點。
自動調整節點陣列的規模
根據預設,HTCondor 會從名為 execute 的 nodearray 要求核心。 如果作業需要不同的 nodearray (例如,如果工作流程中的特定作業有很高的記憶體需求),請針對作業指定 slot_type 屬性。 例如,新增 +slot_type = "highmemory" 會導致 HTCondor 從 highmemory nodearray 而不是 execute 要求節點 (此設定目前需要在 nodearray 的 htcondor.slot_type = "highmemory" 區段中設定 [[[configuration]]])。 此設定不會影響 HTCondor 排程作業的方式,因此您可能要在作業的 slot_type 或 requirements 表示式中包含 rank startd 屬性。 例如: Requirements = target.slot_type = "highmemory" 。
將作業提交至 HTCondor
將作業提交至 HTCondor 排程器最一般的方式是命令 (從排程器節點執行):
condor_submit my_job.submit
範例提交檔案可能如下所示:
Universe = vanilla
Executable = do_science
Arguments = -v --win-prize=true
Output = log/$(Cluster).$(Process).out
Error = log/$(Cluster).$(Process).err
Should_transfer_files = if_needed
When_to_transfer_output = On_exit
+average_runtime = 10
+slot_type = "highmemory"
Queue
HTCondor 組態參考
下列 HTCondor 特定組態選項可自訂功能:
| HTCondor 特定組態選項 | 說明 |
|---|---|
| htcondor.agent_enabled | 如果為 true,請使用 condor_agent 進行作業提交和輪詢。 預設值:false |
| htcondor.agent_version | 要使用的 condor_agent 版本。 預設值:1.27 |
| htcondor.classad_lifetime | classads 的預設存留期 (以秒為單位)。 預設值:700 |
| htcondor.condor_owner | 擁有 HTCondor 縮減指令碼的 Linux 帳戶。 預設值:root |
| htcondor.condor_group | 擁有 HTCondor scaledown 指令碼的 Linux 群組。 預設值:root |
| htcondor.data_dir | 記錄、多工緩衝處理目錄、執行目錄和本機組態檔的目錄。 預設值:/mnt/condor_data (Linux)、C:\All Services\condor_local (Windows) |
| htcondor.ignore_hyperthreads | (僅限 Windows) 將 CPU 數目設定為所偵測到 CPU 的一半,以「停用」超執行緒。 如果使用自動調整,請使用 [[node]] 或 [[nodearray]] 區段中的 Cores 組態設定來指定非超執行緒核心計數。 預設值:false |
| htcondor.install_dir | 安裝 HTCondor 的目的地目錄。 預設值:/opt/condor (Linux)、C:\condor (Windows) |
| htcondor.job_start_count | 每個週期啟動的作業數目。 0 為無限制。 預設值:20 |
| htcondor.job_start_delay | 每個作業開始間隔之間的秒數。 0 為立即。 預設值:1 |
| htcondor.max_history_log | 作業歷程記錄檔案的大小上限 (以位元組為單位)。 預設值:20971520 |
| htcondor.max_history_rotations | 要保留的作業歷程記錄檔案數目上限。 預設值:20 |
| htcondor.negotiator_cycle_delay | 新的交涉器週期開始前的最小秒數。 預設值:20 |
| htcondor.negotiator_interval | condor_negotiator 開始交涉週期的頻率 (以秒為單位)。 預設值:60 |
| htcondor.negotiator_inform_startd | 如果為 true,當與作業相符時,交涉器會通知 startd。 預設值:true |
| htcondor.remove_stopped_nodes | 如果為 true,則會從 CycleServer 檢視中移除已停止的執行節點,而不是標示為「關閉」。 |
| htcondor.running | 如果為 true,則 HTCondor 收集器和交涉器精靈會在中央管理員上執行。 否則,只有 condor_master 會執行。 預設值:true |
| htcondor.scheduler_dual | 如果為 true,排程器會執行兩個 schedd。 預設值:true |
| htcondor.single_slot | 如果為 true,則會將機器視為單一位置 (無論機器擁有多少核心數)。 預設值:false |
| htcondor.slot_type | 定義節點陣列的 slot_type 以進行自動調整。 預設值:execute |
| htcondor.update_interval | startd 將更新發佈至收集器的間隔 (以秒為單位)。 預設值:240 |
| htcondor.use_cache_config | 如果為 true,請使用 cache_config 讓執行個體輪詢 CycleServer 以進行設定。 預設值:false |
| htcondor.version | 要安裝的 HTCondor 版本。 預設值:8.2.6 |
HTCondor 自動產生的組態檔
HTCondor 具有大量的組態設定,包括使用者定義的屬性。 CycleCloud 可讓您使用叢集中定義的屬性來建立自訂組態檔:
| 屬性 | 說明 |
|---|---|
| htcondor.custom_config.enabled | 如果為 true,則會使用指定的屬性產生組態檔。 預設值:false |
| htcondor.custom_config.file_name | 要寫入的檔名 (置於 htcondor.data_dir/config 中)。 預設值:ZZZ-custom_config.txt |
| htcondor.custom_config.settings | 要寫入自訂組態檔的屬性,例如 htcondor.custom_config.settings.max_jobs_running = 5000 |
備註
您無法使用此方法指定包含 . 的 HTCondor 組態屬性。 如果您需要這類屬性,請在逐步指南或隨 cluster-init 一起安裝的檔案中加以指定。
CycleCloud 支援跨排程器的標準自動停止屬性集:
| 屬性 | 說明 |
|---|---|
| cyclecloud.cluster.autoscale.stop_enabled | 啟用此節點上的自動停止。 是/否 |
| cyclecloud.cluster.autoscale.idle_time_after_jobs | 節點在工作自動停止前,完成工作之後閑置的時間量 (以秒為單位)。 |
| cyclecloud.cluster.autoscale.idle_time_before_jobs | 節點在自動停止之前的閒置時間(以秒為單位),即在完成所有作業後到停止前的時間。 |