123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- name: build-and-test
- on: push
-
- env:
- CC: gcc-4.9
- CXX: g++-4.9
- secret_account: ${{ secrets.DOCKER_USERNAME }}
- jobs:
- building:
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v3
-
- - name: Install gcc env
- run: |
- echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list
- echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" | sudo tee -a /etc/apt/sources.list
- sudo apt update
- sudo apt install gcc-4.9 g++-4.9
- shell: bash
-
- - name: Install dependency
- run: |
- sudo apt-get install -y make zlib1g zlib1g-dev bzip2 liblz4-dev libasan0 openssl libmxml-dev wget
- - name: update hsql
- run: |
- sh ${{github.workspace}}/script/download.sh
- tar -zxvf hsql.tar.gz
- cd hsql
- cp -rf include/ ${{github.workspace}}/src/libs/hsql/
- cp -f libs/libsqlparser.so ${{github.workspace}}/src/libs/hsql/libs/libsqlparser.so
- cp -f libs/libsqlparser.a ${{github.workspace}}/src/libs/hsql/libs/libsqlparser.a
-
- - name: cmake project
- run: |
- cd ${{github.workspace}}
- mkdir build
- cd build
- cmake ../
- make
- - name: Login docker hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Publish devel docker
- run: |
- cd ${{github.workspace}}
- cp build/src/core/dtcd dockerfiles/devel/
- cp build/src/agent/dtcagent dockerfiles/devel/
- cp build/src/agent-watchdog/agent-watchdog dockerfiles/devel/
- cp build/src/complex/async-conn dockerfiles/devel/
- cp build/src/connector/connector dockerfiles/devel/
- cp build/src/data_lifecycle/data-lifecycle-manager dockerfiles/devel/
- cp build/src/hwcserver/hwcserver dockerfiles/devel/
- cp build/src/rule/librule.so dockerfiles/devel/
- cp src/libs/hsql/libs/libsqlparser.so dockerfiles/devel/
- cp build/src/utils/conf-gen-utils dockerfiles/devel/
- cp src/libs/api/cc_api/libs/libdtcapi.so dockerfiles/devel/
- cd dockerfiles/devel/
- docker build -t ${{ secrets.DOCKER_USERNAME }}/devel:all .
- docker push ${{ secrets.DOCKER_USERNAME }}/devel:all
- docker build -t ${{ secrets.DOCKER_USERNAME }}/devel:latest .
- docker push ${{ secrets.DOCKER_USERNAME }}/devel:latest
- # Core Junction
- CORE:
- needs: building
- runs-on: ubuntu-20.04
- steps:
- - run: echo "Core Junction."
- # Agent Junction
- AGENT:
- needs: building
- runs-on: ubuntu-20.04
- steps:
- - run: echo "Agent Junction."
- # Layered Junction
- LAYERED:
- needs: building
- runs-on: ubuntu-20.04
- steps:
- - run: echo "Layered Junction."
- # Testing Cache Only
- test-dtc-cache-only:
- needs: CORE
- runs-on: ubuntu-20.04
- services:
- dtc:
- image: docker.io/kfysck/devel:all
- ports:
- - 20015:20015
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name dtc
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -c
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.cacheonly.yaml /usr/local/etc/dtc.yaml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- docker logs dtc
- cd ${{github.workspace}}/tests
- pytest test_dtcd_cache_only.py
- # Testing Cache Only via Agent.
- test-agent-cache-only:
- if: false
- needs: AGENT
- runs-on: ubuntu-20.04
- services:
- dtc:
- image: docker.io/kfysck/devel:all
- ports:
- - 20015:20015
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name dtc
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -c
- agent:
- image: docker.io/kfysck/devel:all
- ports:
- - 12001:12001
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name agent
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -a
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- sudo apt update
- sudo apt install -y net-tools
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.cacheonly.yaml /usr/local/etc/dtc.yaml
- sudo cp -f dockerfiles/devel/agent.single.dtcd.xml /usr/local/etc/agent.xml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- netstat -ntpl
- docker logs agent
- docker logs dtc
- cd ${{github.workspace}}/tests
- pytest test_agent_cache_only.py
- # Testing Layered Storage.
- test-agent-layered:
- if: false
- needs: LAYERED
- runs-on: ubuntu-20.04
- services:
- mysql:
- image: mysql:5.7
- ports:
- - 3306:3306
- env:
- MYSQL_ROOT_PASSWORD: 123456
- agent:
- image: docker.io/kfysck/devel:all
- ports:
- - 12001:12001
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name agent
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -ayc
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Init db table
- run: |
- sleep 5s
- mysql -h127.0.0.1 -uroot -p123456 -e "create database layer2;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "source tests/init.s1.sql;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "show tables;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "desc opensource;"
- mysql -h127.0.0.1 -uroot -p123456 -e "create database layer3;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer3 -e "source tests/init.s1.sql;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer3 -e "show tables;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer3 -e "desc opensource;"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.layered.yaml /usr/local/etc/dtc.yaml
- sudo cp -f dockerfiles/devel/agent.layered.xml /usr/local/etc/agent.xml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- netstat -ntpl
- docker logs agent
- cd ${{github.workspace}}/tests
- echo "show databases;"
- mysql -h127.0.0.1 -P12001 -uroot -p123456 -e "show databases;"
- echo "use layer2;"
- mysql -h127.0.0.1 -P12001 -uroot -p123456 -Dlayer2 -e "use layer2;"
- echo "show tables;"
- mysql -h127.0.0.1 -P12001 -uroot -p123456 -Dlayer2 -e "show tables;"
- # pytest test_agent_cache_only.py
- # Testing Cache with Datasource Scene 1 (Single DB and Single Table)
- test-dtc-ds-S-db-S-table:
- needs: CORE
- runs-on: ubuntu-20.04
- services:
- mysql:
- image: mysql:5.7
- ports:
- - 3306:3306
- env:
- MYSQL_ROOT_PASSWORD: 123456
- dtc:
- image: docker.io/kfysck/devel:all
- ports:
- - 20015:20015
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name dtc
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -c
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Init db table
- run: |
- sleep 5s
- mysql -h127.0.0.1 -uroot -p123456 -e "create database layer2;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "source tests/init.s1.sql;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "show tables;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "desc opensource;"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.dbaddition.s1.yaml /usr/local/etc/dtc.yaml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- docker logs dtc
- cd ${{github.workspace}}/tests
- pytest test_dtcd_datasource_s1.py
- # Testing Cache with Datasource Scene 1 (Single DB and Single Table) via Agent
- test-agent-ds-S-db-S-table:
- needs: AGENT
- if: false
- runs-on: ubuntu-20.04
- services:
- mysql:
- image: mysql:5.7
- ports:
- - 3306:3306
- env:
- MYSQL_ROOT_PASSWORD: 123456
- agent:
- image: docker.io/kfysck/devel:all
- ports:
- - 12001:12001
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name agent
- env:
- DTC_BIN: dtcagent
- dtc:
- image: docker.io/kfysck/devel:all
- ports:
- - 20015:20015
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name dtc
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -c
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Init db table
- run: |
- sleep 5s
- mysql -h127.0.0.1 -uroot -p123456 -e "create database layer2;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "source tests/init.s1.sql;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "show tables;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "desc opensource;"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.dbaddition.s1.yaml /usr/local/etc/dtc.yaml
- sudo cp -f dockerfiles/devel/agent.single.dtcd.xml /usr/local/etc/agent.xml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- docker logs agent
- docker logs dtc
- cd ${{github.workspace}}/tests
- pytest test_agent_datasource_s1.py
- # Testing Cache with Datasource Scene 2 (Single DB and Multi Table)
- test-dtc-ds-S-db-M-table:
- needs: CORE
- runs-on: ubuntu-20.04
- services:
- mysql:
- image: mysql:5.7
- ports:
- - 3306:3306
- env:
- MYSQL_ROOT_PASSWORD: 123456
- dtc:
- image: docker.io/kfysck/devel:all
- ports:
- - 20015:20015
- volumes:
- - /usr/local/etc:/usr/local/dtc/conf/
- options: --name dtc
- env:
- DTC_BIN: agent-watchdog
- DTC_ARGV: -c
- steps:
- - uses: actions/checkout@v3
-
- - name: Install python dependency
- run: |
- python -m pip install --upgrade pip
- pip install pytest
- pip install pymysql
- - name: Set up Python 3.7
- uses: actions/setup-python@v2
- with:
- python-version: "3.7"
- - name: Init db table
- run: |
- sleep 5s
- mysql -h127.0.0.1 -uroot -p123456 -e "create database layer2;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "source tests/init.s2.sql;"
- mysql -h127.0.0.1 -uroot -p123456 -Dlayer2 -e "show tables;"
- - name: Copy conf files.
- run: |
- cd ${{github.workspace}}
- sudo cp -f conf/log4cplus.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-hwc.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-wd.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-agent.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-async.conf /usr/local/etc/
- sudo cp -f conf/log4cplus-life.conf /usr/local/etc/
- sudo cp -f dockerfiles/devel/dtc.dbaddition.s2.yaml /usr/local/etc/dtc.yaml
- - name: Run Testing Cases
- run: |
- sleep 5s
- docker ps -a
- docker logs dtc
- cd ${{github.workspace}}/tests
- pytest test_dtcd_datasource_s2.py
|