Skip to content

Commit

Permalink
Implement Docker container for MQ service
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Oct 26, 2024
1 parent de0e848 commit d51368f
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build_and_publish_pypi_and_release:
uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master
secrets: inherit
# build_and_publish_docker:
# needs: build_and_publish_pypi_and_release
# uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
# secrets: inherit
build_and_publish_docker:
needs: build_and_publish_pypi_and_release
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
version_file: "version.py"
publish_prerelease: true
# build_and_publish_docker:
# needs: publish_alpha_release
# uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
# secrets: inherit
build_and_publish_docker:
needs: publish_alpha_release
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
with:
python_version: "3.8"
# docker_build_tests:
# uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
unit_tests:
strategy:
matrix:
Expand Down
Empty file.
9 changes: 9 additions & 0 deletions docker_overlay/etc/neon/diana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
log_level: INFO
logs:
level_overrides:
error:
- pika
warning:
- filelock
info: []
debug: []
18 changes: 18 additions & 0 deletions neon_users_service/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from neon_users_service.mq_connector import NeonUsersConnector
from ovos_utils import wait_for_exit_signal
from ovos_utils.log import LOG, init_service_logger

init_service_logger("neon-users-service")


def main():
connector = NeonUsersConnector(None)
LOG.info("Starting Neon Users Service")
connector.run()
LOG.info("Started Neon Users Service")
wait_for_exit_signal()
LOG.info("Shut down")


if __name__ == "__main__":
main()
3 changes: 1 addition & 2 deletions neon_users_service/mq_connector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Optional

import pika.channel
from ovos_utils import LOG, wait_for_exit_signal
from ovos_config.config import Configuration
from ovos_utils import LOG

from neon_mq_connector.connector import MQConnector
from neon_mq_connector.utils.network_utils import b64_to_dict, dict_to_b64
from neon_users_service.models import MQRequest, User
Expand Down
1 change: 1 addition & 0 deletions requirements/mq.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neon-mq-connector~=0.7,>=0.7.2a3
3 changes: 2 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pydantic~=2.0
ovos-config~=0.1
ovos-config~=0.1
ovos-utils~=0.0
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ def get_requirements(requirements_filename: str):
package_data={'neon_users_service': ['default_config.yaml']},
include_package_data=True,
install_requires=get_requirements("requirements.txt"),
extras_require={"test": get_requirements("test_requirements.txt")},
extras_require={"test": get_requirements("test_requirements.txt"),
"mq": get_requirements("mq.txt")},
zip_safe=True,
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
]
],
entry_points={
'console_scripts': [
'neon_users_service=neon_users_service.__main__:main'
]
}
)

0 comments on commit d51368f

Please sign in to comment.