diff --git a/docker/cfg/config.yaml b/docker/cfg/config.yaml new file mode 100644 index 00000000..5658fcc2 --- /dev/null +++ b/docker/cfg/config.yaml @@ -0,0 +1,63 @@ +actor_system_config: + cpu_count: 1 + node_type: STORAGE + use_auto_config: true +blob_storage_config: + service_set: + groups: + - erasure_species: none + rings: + - fail_domains: + - vdisk_locations: + - node_id: 1 + path: SectorMap:1:64 + pdisk_category: SSD +channel_profile_config: + profile: + - channel: + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + - erasure_species: none + pdisk_category: 0 + storage_pool_kind: ssd + profile_id: 0 +domains_config: + domain: + - name: Root + storage_pool_types: + - kind: ssd + pool_config: + box_id: 1 + erasure_species: none + kind: ssd + pdisk_filter: + - property: + - type: SSD + vdisk_kind: Default + state_storage: + - ring: + node: + - 1 + nto_select: 1 + ssid: 1 +grpc_config: + port: 2135 +host_configs: + - drive: + - path: SectorMap:1:64 + type: SSD + host_config_id: 1 +hosts: + - host: localhost + host_config_id: 1 + node_id: 1 + port: 19001 + walle_location: + body: 1 + data_center: az-1 + rack: "0" +static_erasure: none diff --git a/docker/compose.yaml b/docker/compose.yaml new file mode 100644 index 00000000..370ba79c --- /dev/null +++ b/docker/compose.yaml @@ -0,0 +1,191 @@ +x-template: &ydb-common + image: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + restart: always + hostname: localhost + platform: linux/amd64 + privileged: true + volumes: + - ./cfg/config.yaml:/opt/ydb/cfg/config.yaml + +name: ydb + +services: + + static-0: + <<: *ydb-common + container_name: static-0 + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "2135" + - --mon-port + - "8765" + - --ic-port + - "19001" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --node + - static + - --label + - deployment=docker + ports: + - 2135:2135 + - 8765:8765 + - 19001:19001 + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/2135" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + + static-init: + <<: *ydb-common + restart: on-failure + container_name: static-init + command: + - /opt/ydb/bin/ydbd + - -s + - grpc://localhost:2135 + - admin + - blobstorage + - config + - init + - --yaml-file + - /opt/ydb/cfg/config.yaml + depends_on: + static-0: + condition: service_healthy + + tenant-init: + <<: *ydb-common + restart: on-failure + container_name: tenant-init + command: + - /opt/ydb/bin/ydbd + - -s + - grpc://localhost:2135 + - admin + - database + - /Root/slo + - create + - ssd:1 + depends_on: + static-init: + condition: service_completed_successfully + + dynamic-1: + <<: *ydb-common + container_name: dynamic-1 + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "2136" + - --mon-port + - "8766" + - --ic-port + - "19002" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --tenant + - /Root/slo + - --node-broker + - grpc://localhost:2135 + - --label + - deployment=docker + ports: + - 2136:2136 + - 8766:8766 + - 19002:19002 + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/2136" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + depends_on: + static-0: + condition: service_healthy + static-init: + condition: service_completed_successfully + tenant-init: + condition: service_completed_successfully + + dynamic-2: + <<: *ydb-common + container_name: dynamic-2 + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "2137" + - --mon-port + - "8767" + - --ic-port + - "19003" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --tenant + - /Root/slo + - --node-broker + - grpc://localhost:2135 + - --label + - deployment=docker + ports: + - 2137:2137 + - 8767:8767 + - 19003:19003 + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/2137" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + depends_on: + static-0: + condition: service_healthy + static-init: + condition: service_completed_successfully + tenant-init: + condition: service_completed_successfully + + dynamic-3: + <<: *ydb-common + container_name: dynamic-3 + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "2138" + - --mon-port + - "8768" + - --ic-port + - "19004" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --tenant + - /Root/slo + - --node-broker + - grpc://localhost:2135 + - --label + - deployment=docker + ports: + - 2138:2138 + - 8768:8768 + - 19004:19004 + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/2138" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + depends_on: + static-0: + condition: service_healthy + static-init: + condition: service_completed_successfully + tenant-init: + condition: service_completed_successfully + diff --git a/docker/gen.js b/docker/gen.js new file mode 100644 index 00000000..4253a39d --- /dev/null +++ b/docker/gen.js @@ -0,0 +1,135 @@ +// This scripts generate compose file + +import fs from 'node:fs'; + +let tenant = "/Root/slo" + +// YDB Ports +let YDB_GRPC_PORT = 2135 +let YDB_MON_PORT = 8765 +let YDB_IC_PORT = 19001 + +// Generate YDB Static Node +let generateStaticNode = () => /** YAML */` + static-0: + <<: *ydb-common + container_name: static-0 + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "${YDB_GRPC_PORT}" + - --mon-port + - "${YDB_MON_PORT}" + - --ic-port + - "${YDB_IC_PORT}" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --node + - static + - --label + - deployment=docker + ports: + - ${YDB_GRPC_PORT}:${YDB_GRPC_PORT} + - ${YDB_MON_PORT}:${YDB_MON_PORT} + - ${YDB_IC_PORT}:${YDB_IC_PORT} + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/${YDB_GRPC_PORT}" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + + static-init: + <<: *ydb-common + restart: on-failure + container_name: static-init + command: + - /opt/ydb/bin/ydbd + - -s + - grpc://localhost:${YDB_GRPC_PORT} + - admin + - blobstorage + - config + - init + - --yaml-file + - /opt/ydb/cfg/config.yaml + depends_on: + static-0: + condition: service_healthy + + tenant-init: + <<: *ydb-common + restart: on-failure + container_name: tenant-init + command: + - /opt/ydb/bin/ydbd + - -s + - grpc://localhost:${YDB_GRPC_PORT} + - admin + - database + - ${tenant} + - create + - ssd:1 + depends_on: + static-init: + condition: service_completed_successfully +` + +// Generate YDB Dynamic Node +let generateDynamicNode = (idx) => /** YAML */` + dynamic-${idx}: + <<: *ydb-common + container_name: dynamic-${idx} + command: + - /opt/ydb/bin/ydbd + - server + - --grpc-port + - "${YDB_GRPC_PORT+idx}" + - --mon-port + - "${YDB_MON_PORT+idx}" + - --ic-port + - "${YDB_IC_PORT+idx}" + - --yaml-config + - /opt/ydb/cfg/config.yaml + - --tenant + - ${tenant} + - --node-broker + - grpc://localhost:${YDB_GRPC_PORT} + - --label + - deployment=docker + ports: + - ${YDB_GRPC_PORT+idx}:${YDB_GRPC_PORT+idx} + - ${YDB_MON_PORT+idx}:${YDB_MON_PORT+idx} + - ${YDB_IC_PORT+idx}:${YDB_IC_PORT+idx} + healthcheck: + test: bash -c "exec 6<> /dev/tcp/localhost/${YDB_GRPC_PORT+idx}" + interval: 10s + timeout: 1s + retries: 3 + start_period: 30s + depends_on: + static-0: + condition: service_healthy + static-init: + condition: service_completed_successfully + tenant-init: + condition: service_completed_successfully +` + +let composeFile = `x-template: &ydb-common + image: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + restart: always + hostname: localhost + platform: linux/amd64 + privileged: true + volumes: + - ./cfg/config.yaml:/opt/ydb/cfg/config.yaml + +name: ydb + +services: +${generateStaticNode()}${generateDynamicNode(1)}${generateDynamicNode(2)}${generateDynamicNode(3)} +`; + +fs.writeFileSync('compose.yaml', composeFile); diff --git a/k8s/ci/database.yaml b/k8s/ci/database.yaml index 75f986e9..4f6b164b 100644 --- a/k8s/ci/database.yaml +++ b/k8s/ci/database.yaml @@ -1,34 +1,37 @@ apiVersion: ydb.tech/v1alpha1 kind: Database metadata: - name: database-sample + name: database spec: monitoring: - enabled: true - interval: 3s - additionalLabels: - ydb-cluster: slo-storage - ydb-cluster-monitor: slo-storage - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: ydb-cluster - operator: In - values: - - slo-storage - topologyKey: 'kubernetes.io/hostname' + enabled: false image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:${{VERSION}} - domain: root - nodes: 6 + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + domain: Root + nodes: 3 resources: - containerResources: - limits: - cpu: 1 storageUnits: - - count: 1 - unitKind: ssd + - unitKind: ssd + count: 1 + service: + grpc: + tls: + enabled: false + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 + interconnect: + tls: + enabled: false + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 + status: + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 + additionalLabels: + ydb-cluster: slo-storage + ydb-cluster-monitor: slo-storage storageClusterRef: - name: storage-sample + name: storage diff --git a/k8s/ci/storage.yaml b/k8s/ci/storage.yaml index 5a2c2130..f203e830 100644 --- a/k8s/ci/storage.yaml +++ b/k8s/ci/storage.yaml @@ -1,54 +1,52 @@ apiVersion: ydb.tech/v1alpha1 kind: Storage metadata: - name: storage-sample + name: storage spec: monitoring: - enabled: true - interval: 3s + enabled: false + image: + name: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 + domain: Root + nodes: 1 + service: + grpc: + tls: + enabled: false + ipFamilies: + - IPv4 + interconnect: + tls: + enabled: false + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 + status: + ipFamilyPolicy: SingleStack + ipFamilies: + - IPv4 additionalLabels: ydb-cluster: slo-storage ydb-cluster-monitor: slo-storage - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: ydb-cluster - operator: In - values: - - slo-storage - topologyKey: 'kubernetes.io/hostname' - dataStore: - - volumeMode: Block - storageClassName: yc-network-ssd-nonreplicated - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 93Gi - image: - name: cr.yandex/crptqonuodf51kdj7a7d/ydb:${{VERSION}} - domain: root - nodes: 9 - erasure: mirror-3-dc - configuration: |- - static_erasure: mirror-3-dc + erasure: none + dataStore: [] + configuration: |+ + static_erasure: none host_configs: - - drive: - - path: /dev/kikimr_ssd_00 - type: SSD - host_config_id: 1 + - drive: + - path: SectorMap:1:64 + type: SSD + host_config_id: 1 grpc_config: port: 2135 domains_config: domain: - - name: root + - name: Root storage_pool_types: - kind: ssd pool_config: box_id: 1 - erasure_species: mirror-3-dc + erasure_species: none kind: ssd pdisk_filter: - property: @@ -56,98 +54,34 @@ spec: vdisk_kind: Default state_storage: - ring: - node: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] - nto_select: 5 + node: + - 1 + nto_select: 1 ssid: 1 actor_system_config: - batch_executor: 2 - io_executor: 3 - executor: - - name: System - spin_threshold: 0 - threads: 2 - type: BASIC - - name: User - spin_threshold: 0 - threads: 3 - type: BASIC - - name: Batch - spin_threshold: 0 - threads: 2 - type: BASIC - - name: IO - threads: 1 - time_per_mailbox_micro_secs: 100 - type: IO - - name: IC - spin_threshold: 10 - threads: 1 - time_per_mailbox_micro_secs: 100 - type: BASIC - scheduler: - progress_threshold: 10000 - resolution: 256 - spin_threshold: 0 - service_executor: - - executor_id: 4 - service_name: Interconnect + use_auto_config: true + node_type: STORAGE + cpu_count: 1 blob_storage_config: service_set: - availability_domains: 1 groups: - - erasure_species: mirror-3-dc - group_id: 0 - group_generation: 1 + - erasure_species: none rings: - fail_domains: - - vdisk_locations: - - node_id: 1 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 2 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 3 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - fail_domains: - - vdisk_locations: - - node_id: 4 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 5 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 6 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - fail_domains: - - vdisk_locations: - - node_id: 7 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 8 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 - - vdisk_locations: - - node_id: 9 - pdisk_category: SSD - path: /dev/kikimr_ssd_00 + - vdisk_locations: + - node_id: 1 + path: SectorMap:1:64 + pdisk_category: SSD channel_profile_config: profile: - channel: - - erasure_species: mirror-3-dc - pdisk_category: 1 + - erasure_species: none + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: mirror-3-dc - pdisk_category: 1 + - erasure_species: none + pdisk_category: 0 storage_pool_kind: ssd - - erasure_species: mirror-3-dc - pdisk_category: 1 + - erasure_species: none + pdisk_category: 0 storage_pool_kind: ssd profile_id: 0