diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000..0db69568216a1 Binary files /dev/null and b/.coverage differ diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000000000..8aa7fb96e3fe5 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +ignore = E226,E302,E41,W504,W605,Q000,N806,D103,D104,D106,D107,D202,D204,D400,D403,D401,I001,D208,D205,D100,D101,D102,D105,D205,D208,N802,N803,I004,I003 +exclude = static, templates, server_configuration, venv, migrations +max-line-length = 120 diff --git a/.github/ISSUE_TEMPLATE/-----.md b/.github/ISSUE_TEMPLATE/-----.md new file mode 100644 index 0000000000000..e51535f341c07 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/-----.md @@ -0,0 +1,13 @@ +--- +name: 기능 요청 +about: 데이터 수집 시스템에 대한 추가 기능을 요청합니다. +title: '' +labels: '' +assignees: '' + +--- + +**설비 연동 단말, 데이터 수집 서버, 전처리 에이전트에 관한 문제점이 있다면 각 영역에 대한 기능을 요청하시기 바랍니다.** +실비 단말: [추가 요청 기능] +데이터 수집 서버: [추가 요청 기능] +전처리 에이전트: [추가 요청 기능] diff --git a/.github/ISSUE_TEMPLATE/Feature_Agent.md b/.github/ISSUE_TEMPLATE/Feature_Agent.md new file mode 100644 index 0000000000000..f9ea47e809fb6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_Agent.md @@ -0,0 +1,13 @@ +--- +name: 설비 추가 +about: 엣지 에이전트에 추가할 설비에 대해 기술합니다. +title: "[CONTROLLER-]" +labels: '' +assignees: '' + +--- + +** 엣지 에이전트는 다양한 제조사의 설비와 통신을 수행합니다. ** +***사용가능한 설비에 대한 Modbus ASCII/RTU에 대한 메모리 맵을 제공해 주시기 바랍니다.*** +ex) +Bender | Model Name | Memory Address | Function diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000000000..00b570a708ede --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,18 @@ +--- +name: Bug report +about: Please report bug +title: "[BUG REPORT]" +labels: bug +assignees: prismdata-dc + +--- + +** Please describe error or bug when you run iiot_server.py ** +Run File: iiot_server.py +Error: +Advice: + +** Please describe error or bug when you run iiot_mqtt_aget.py ** +Run File: iiot_mqtt_agent.py +Error: +Advice: diff --git a/.github/ISSUE_TEMPLATE/pull-request-issue-template.md b/.github/ISSUE_TEMPLATE/pull-request-issue-template.md new file mode 100644 index 0000000000000..8094ced0b6604 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/pull-request-issue-template.md @@ -0,0 +1,14 @@ +--- +name: Pull Request issue template +about: Describe this Pull Request issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + +## Title + +## Work list + +## Notice diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000000000..48b90ab2752c5 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + python3 whalesharkiiot_api_test.py \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 4e1ef42d2b7c2..0000000000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000..ae945fa16bf83 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +venv/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000..04e122c017f07 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at dataignitelab@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000..8d7ca746bd1f9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# How to contribute to WhaleShark_IIoT +WhaleShark_IIoT is open to everyone, and we welcome any kinds of contribution. +We believe that our project can grow with your interests in helping others' necessities. + +## Style Guide +WhaleShark_IIoT has several style guidelines that you must follow. +Before your start, please read the below instructions carefully. + +### Linting and Code Convention +To maintain the code style and quality, we adopted python PEP8 +The rules are based on the [Python3 Style Guide](https://www.python.org/dev/peps/pep-0008/) with some modifications. + +### Commit Log Guidelines +WhaleShark_IIoT follows formatted commit logs based on [Conventional Commits](https://www.conventionalcommits.org/) for many different purposes (like creating CHANGELOG, ease history searching, etc.). +To not break the current format, you'll be forced to follow our commit log guidelines. +Before your commit/push, make sure follow our commit log guidelines. + +The outline is as below: +```bash +[optional scope]: + +[optional body] + +[optional footer] +``` + +- #### Types + - **feat**: A new feature + - **fix**: A bug fix + - **docs**: Documentation only changes + - **style**: Changes that do not affect the meaning of the code. Such as white-space, formatting, missing semi-colons, etc. + - **refactor**: A code change that neither fixes a bug nor adds a feature + - **test**: Adding missing tests. Changing tests. + - **chore**: Changes to the build process or tools and libraries such as documentation generation + - **skip**: For commits made by after the 1st commit. Usually for applying code review changes. + +- #### Description + A short description of the commit. + + ```bash + fix(Axis): Correct tick rendering + ``` + + Example commit applying code review (after the 1st commit) + > **Note:** Commit log starting with `skip:` type will be ignored by commit hook constraint. + ```bash + skip: Applied the review + ``` + +- #### Body + A short descriptive message part of the commit. + + Example commit of fixing a bug: + ```bash + (): + + Update condition of tick to avoid unnecessary tick rendering + +