You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/10/24 14:00:55 UTC

[iotdb] branch master updated: Use 1c1d docker to run python and influxdb protocal IT (#7703)

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e9a5850eb4 Use 1c1d docker to run python and influxdb protocal IT (#7703)
e9a5850eb4 is described below

commit e9a5850eb43d8d68c6b32e1be5eded00a0f8fb4f
Author: Haonan <hh...@outlook.com>
AuthorDate: Mon Oct 24 22:00:49 2022 +0800

    Use 1c1d docker to run python and influxdb protocal IT (#7703)
---
 .dockerignore                                      |  1 +
 .github/workflows/client-python.yml                |  4 +-
 .github/workflows/influxdb-protocol.yml            |  2 +-
 client-py/requirements.txt                         |  4 +-
 client-py/tests/test_dataframe.py                  |  4 +-
 .../src/main/DockerCompose/start-1c1d.sh           |  7 +--
 docker/src/main/Dockerfile-1c1d                    | 56 +++++++++++++++++++++
 docker/src/main/Dockerfile-1c1d-influxdb           | 57 ++++++++++++++++++++++
 8 files changed, 125 insertions(+), 10 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 995e35a90d..288d980b3f 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -19,3 +19,4 @@
 
 *
 !distribution
+!docker/src/main/DockerCompose/start-1c1d.sh
diff --git a/.github/workflows/client-python.yml b/.github/workflows/client-python.yml
index 230f9a29c5..d70b230b0e 100644
--- a/.github/workflows/client-python.yml
+++ b/.github/workflows/client-python.yml
@@ -53,11 +53,11 @@ jobs:
         run: mvn -B clean install -pl distribution,client-py -am -DskipTests
       - name: Build IoTDB server docker image
         run: |
-          docker build . -f docker/src/main/Dockerfile-single -t "iotdb:dev"
+          docker build . -f docker/src/main/Dockerfile-1c1d -t "iotdb:dev"
           docker images
       - name: Install IoTDB python client requirements
         run: pip3 install -r client-py/requirements_dev.txt
       - name: Integration test
         shell: bash
         run: |
-          cd client-py && pytest .
\ No newline at end of file
+          cd client-py && pytest --ignore=tests/test_template.py
\ No newline at end of file
diff --git a/.github/workflows/influxdb-protocol.yml b/.github/workflows/influxdb-protocol.yml
index 7aac7da02c..9a111fd9dc 100644
--- a/.github/workflows/influxdb-protocol.yml
+++ b/.github/workflows/influxdb-protocol.yml
@@ -61,7 +61,7 @@ jobs:
 
       - name: Build Docker Image
         run: |
-          docker build . -f docker/src/main/Dockerfile-single-influxdb -t "apache/iotdb:influxdb-protocol-on"
+          docker build . -f docker/src/main/Dockerfile-1c1d-influxdb -t "apache/iotdb:influxdb-protocol-on"
           docker images
 
       - name: IT Test
diff --git a/client-py/requirements.txt b/client-py/requirements.txt
index 8715d50595..521bb7ed83 100644
--- a/client-py/requirements.txt
+++ b/client-py/requirements.txt
@@ -17,10 +17,10 @@
 #
 
 # Pandas Export
-pandas~=1.3.5
+pandas>=1.3.5
 # Testcontainer
 testcontainers==3.3.0
-numpy~=1.21.4
+numpy>=1.21.4
 # SQLAlchemy Dialect
 sqlalchemy == 1.3.20
 sqlalchemy-utils == 0.36.8
\ No newline at end of file
diff --git a/client-py/tests/test_dataframe.py b/client-py/tests/test_dataframe.py
index c7cce58ea5..f4f97a0b98 100644
--- a/client-py/tests/test_dataframe.py
+++ b/client-py/tests/test_dataframe.py
@@ -78,8 +78,8 @@ def test_non_time_query():
                 "FLOAT",
                 "GORILLA",
                 "SNAPPY",
-                None,
-                None,
+                "null",
+                "null",
             ]
         ],
     )
diff --git a/.dockerignore b/docker/src/main/DockerCompose/start-1c1d.sh
old mode 100644
new mode 100755
similarity index 88%
copy from .dockerignore
copy to docker/src/main/DockerCompose/start-1c1d.sh
index 995e35a90d..9fd58e86c5
--- a/.dockerignore
+++ b/docker/src/main/DockerCompose/start-1c1d.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,6 +17,6 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
-*
-!distribution
+nohup /iotdb/sbin/start-confignode.sh > /dev/null 2>&1 &
+sleep 5
+/iotdb/sbin/start-datanode.sh
diff --git a/docker/src/main/Dockerfile-1c1d b/docker/src/main/Dockerfile-1c1d
new file mode 100644
index 0000000000..6419f0a0d0
--- /dev/null
+++ b/docker/src/main/Dockerfile-1c1d
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# docker build context is the root path of the repository
+
+FROM openjdk:11-jre-slim
+
+ADD distribution/target/apache-iotdb-*-all-bin.zip /
+ADD docker/src/main/DockerCompose/start-1c1d.sh /
+
+RUN apt update \
+  && apt install lsof dos2unix procps unzip -y \
+  && unzip /apache-iotdb-*-bin.zip -d / \
+  && rm /apache-iotdb-*-bin.zip \
+  && mv /apache-iotdb-* /iotdb \
+  && mv /start-1c1d.sh /iotdb/sbin \
+  && apt remove unzip -y \
+  && apt autoremove -y \
+  && apt purge --auto-remove -y \
+  && apt clean -y \
+RUN dos2unix /iotdb/sbin/start-1c1d.sh
+RUN dos2unix /iotdb/sbin/start-confignode.sh
+RUN dos2unix /iotdb/sbin/../conf/confignode-env.sh
+RUN dos2unix /iotdb/sbin/start-datanode.sh
+RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
+EXPOSE 6667
+EXPOSE 31999
+EXPOSE 5555
+EXPOSE 8086
+EXPOSE 8181
+EXPOSE 22278
+EXPOSE 22277
+EXPOSE 8777
+EXPOSE 9003
+EXPOSE 40010
+EXPOSE 50010
+VOLUME /iotdb/data
+VOLUME /iotdb/logs
+ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
+ENTRYPOINT ["/iotdb/sbin/start-1c1d.sh"]
diff --git a/docker/src/main/Dockerfile-1c1d-influxdb b/docker/src/main/Dockerfile-1c1d-influxdb
new file mode 100644
index 0000000000..9488efbdc0
--- /dev/null
+++ b/docker/src/main/Dockerfile-1c1d-influxdb
@@ -0,0 +1,57 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# docker build context is the root path of the repository
+
+FROM openjdk:11-jre-slim
+
+ADD distribution/target/apache-iotdb-*-all-bin.zip /
+ADD docker/src/main/DockerCompose/start-1c1d.sh /
+
+RUN apt update \
+  && apt install lsof dos2unix procps unzip -y \
+  && unzip /apache-iotdb-*-bin.zip -d / \
+  && rm /apache-iotdb-*-bin.zip \
+  && mv /apache-iotdb-* /iotdb \
+  && mv /start-1c1d.sh /iotdb/sbin \
+  && sed -i '/^# enable_influxdb_rpc_service=false/a enable_influxdb_rpc_service=true' /iotdb/sbin/../conf/iotdb-datanode.properties \
+  && apt remove unzip -y \
+  && apt autoremove -y \
+  && apt purge --auto-remove -y \
+  && apt clean -y
+RUN dos2unix /iotdb/sbin/start-1c1d.sh
+RUN dos2unix /iotdb/sbin/start-confignode.sh
+RUN dos2unix /iotdb/sbin/../conf/confignode-env.sh
+RUN dos2unix /iotdb/sbin/start-datanode.sh
+RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
+EXPOSE 6667
+EXPOSE 31999
+EXPOSE 5555
+EXPOSE 8086
+EXPOSE 8181
+EXPOSE 22278
+EXPOSE 22277
+EXPOSE 8777
+EXPOSE 9003
+EXPOSE 40010
+EXPOSE 50010
+VOLUME /iotdb/data
+VOLUME /iotdb/logs
+ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
+ENTRYPOINT ["/iotdb/sbin/start-1c1d.sh"]