Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore "src/Apache.IoTDB/Apache.IoTDB.csproj"
- name: Check License Header
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/e2e-multinode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: E2E Tests in MultiNode IoTDB

on:
push:
branches: [ main, dev/* ]
pull_request:
branches: [ main ]

jobs:

build:
name: e2e test in MultiNode IoTDB
runs-on: ubuntu-latest
steps:

- name: Check out code into the CSharp module directory
uses: actions/checkout@v4

- name: Set Docker & Run Test
run: |
docker compose -f docker-compose-2c2d.yml up --build --abort-on-container-exit --remove-orphans

- name: Clean IoTDB & Shut Down Docker
run: |
docker compose -f docker-compose-2c2d.yml down
41 changes: 41 additions & 0 deletions .github/workflows/pre-commit-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Formatting

on:
workflow_dispatch:
pull_request:
branches:
- '**'
merge_group:
branches: [ main ]
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
formatting-checks:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Setup Python environment (for pre-commit)
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install pre-commit and dependencies
run: |
pip install pre-commit
pre-commit install-hooks

- name: Run pre-commit checks
run: |
pre-commit run --all-files
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ header:
- 'Apache.IoTDB.sln'
- '.gitignore'
- '.dockerignore'
- '.pre-commit-config.yaml'

comment: on-failure
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@


repos:
- repo: local
hooks:
- id: dotnet-format
name: dotnet format
entry: dotnet format --include
language: system
pass_filenames: true
files: '\.(cs|vb|fs|sln|csproj|fsproj)$'

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-yaml
- id: check-json
- id: check-xml

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["--ignore-words-list=fo,teh,ba"]

exclude: |
(?x)^(
src/Apache\.IoTDB/Rpc/|
.*\.md$
)
1 change: 0 additions & 1 deletion Apache-IoTDB-Client-CSharp-UserCase/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,3 @@ static async Task Main(string[] args)
}

}

2 changes: 0 additions & 2 deletions Apache.IoTDB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{DEAC57D3-4
docs\time_profile_zh.pdf = docs\time_profile_zh.pdf
EndProjectSection
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{4D457769-80CB-401F-9155-C3125C04FACD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Apache.IoTDB.Data", "src\Apache.IoTDB.Data\Apache.IoTDB.Data.csproj", "{4308656F-D174-49A6-ACE4-15894B017D55}"
EndProject
Global
Expand Down
133 changes: 133 additions & 0 deletions docker-compose-2c2d.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
version: "3"
services:

# ConfigNode 1
confignode-1:
image: apache/iotdb:2.0.1-beta-standalone
command: ["bash", "-c", "entrypoint.sh confignode"]
restart: always
healthcheck:
test: ["CMD", "ls", "/iotdb/data"]
interval: 3s
timeout: 5s
retries: 30
start_period: 30s
environment:
- cn_internal_address=127.0.0.1
- cn_internal_port=10710
- cn_consensus_port=10720
- cn_seed_config_node=127.0.0.1:10710
- schema_replication_factor=2
- data_replication_factor=2
privileged: true
volumes:
- ./iotdb/confignode-1/data:/iotdb/data
- ./iotdb/confignode-1/logs:/iotdb/logs
network_mode: host

# ConfigNode 2
confignode-2:
image: apache/iotdb:2.0.1-beta-standalone
command: ["bash", "-c", "entrypoint.sh confignode"]
restart: always
healthcheck:
test: ["CMD", "ls", "/iotdb/data"]
interval: 3s
timeout: 5s
retries: 30
start_period: 30s
environment:
- cn_internal_address=127.0.0.1
- cn_internal_port=10711 # 端口不同于confignode-1
- cn_consensus_port=10721 # 共识端口不同于confignode-1
- cn_seed_config_node=127.0.0.1:10710
- schema_replication_factor=2
- data_replication_factor=2
privileged: true
volumes:
- ./iotdb/confignode-2/data:/iotdb/data
- ./iotdb/confignode-2/logs:/iotdb/logs
network_mode: host

# DataNode 1
datanode-1:
image: apache/iotdb:2.0.1-beta-standalone
command: ["bash", "-c", "entrypoint.sh datanode"]
restart: always
healthcheck:
test: ["CMD", "ls", "/iotdb/data/datanode/system"]
interval: 10s
timeout: 60s
retries: 30
start_period: 30s
depends_on:
confignode-1:
condition: service_healthy
environment:
- dn_rpc_address=127.0.0.1
- dn_internal_address=127.0.0.1
- dn_seed_config_node=127.0.0.1:10710
- dn_rpc_port=6667
- dn_internal_port=10730
- dn_mpp_data_exchange_port=10740
- dn_schema_region_consensus_port=10750
- dn_data_region_consensus_port=10760
- schema_replication_factor=2
- data_replication_factor=2
privileged: true
volumes:
- ./iotdb/datanode-1/data:/iotdb/data
- ./iotdb/datanode-1/logs:/iotdb/logs
network_mode: host

# DataNode 2
datanode-2:
image: apache/iotdb:2.0.1-beta-standalone
command: ["bash", "-c", "entrypoint.sh datanode"]
restart: always
healthcheck:
test: ["CMD", "ls", "/iotdb/data/datanode/system"]
interval: 10s
timeout: 60s
retries: 30
start_period: 30s
depends_on:
confignode-1:
condition: service_healthy
confignode-2:
condition: service_healthy
environment:
- dn_rpc_address=127.0.0.1
- dn_internal_address=127.0.0.1
- dn_seed_config_node=127.0.0.1:10710
- dn_rpc_port=6668 # 端口不同于datanode-1
- dn_internal_port=10731 # 内部端口不同于datanode-1
- dn_mpp_data_exchange_port=10741
- dn_schema_region_consensus_port=10751
- dn_data_region_consensus_port=10761
- schema_replication_factor=2
- data_replication_factor=2
privileged: true
volumes:
- ./iotdb/datanode-2/data:/iotdb/data
- ./iotdb/datanode-2/logs:/iotdb/logs
network_mode: host

# C# Client
apache.iotdb.samples:
image: ${DOCKER_REGISTRY-}apacheiotdbsamples
depends_on:
confignode-1:
condition: service_healthy
confignode-2:
condition: service_healthy
datanode-1:
condition: service_healthy
datanode-2:
condition: service_healthy
build:
context: .
dockerfile: samples/Apache.IoTDB.Samples/Dockerfile
command: ["--multi", "localhost:6667", "localhost:6668"]
# command: ["sleep", "infinity"]
network_mode: host
15 changes: 0 additions & 15 deletions docker-compose.dcproj

This file was deleted.

1 change: 0 additions & 1 deletion docker-compose.override.yml

This file was deleted.

7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ services:
build:
context: .
dockerfile: samples/Apache.IoTDB.Samples/Dockerfile
command: ["--single", "iotdb"]
networks:
iotdb-network:
ipv4_address: 172.18.0.2

iotdb:
image: apache/iotdb:2.0.1-beta-datanode
restart: always
Expand All @@ -37,7 +38,7 @@ services:
- dn_rpc_address=iotdb
- dn_internal_address=iotdb
- dn_seed_config_node=iotdb-confignode-1:22277

iotdb-confignode-1:
image: apache/iotdb:2.0.1-beta-confignode
restart: always
Expand All @@ -57,6 +58,6 @@ services:
- cn_seed_config_node=iotdb-confignode-1:22277


networks:
networks:
iotdb-network:
external: true
2 changes: 1 addition & 1 deletion launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
}
}
}
}
}
3 changes: 2 additions & 1 deletion samples/Apache.IoTDB.Samples/Apache.IoTDB.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>
Expand All @@ -19,6 +19,7 @@
<PackageReference Include="ConsoleTableExt" Version="3.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.0.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions samples/Apache.IoTDB.Samples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY ["samples/Apache.IoTDB.Samples/Apache.IoTDB.Samples.csproj", "samples/Apache.IoTDB.Samples/"]
COPY ["src/Apache.IoTDB/Apache.IoTDB.csproj", "src/Apache.IoTDB/"]
Expand All @@ -36,4 +36,4 @@ RUN dotnet publish "Apache.IoTDB.Samples.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Apache.IoTDB.Samples.dll"]
ENTRYPOINT ["dotnet", "Apache.IoTDB.Samples.dll"]
Loading
Loading