Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
martynvdijke committed Oct 5, 2021
2 parents 132ed8e + 97fe7f3 commit dd01450
Show file tree
Hide file tree
Showing 82 changed files with 6,006 additions and 57 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,28 @@ jobs:
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: loudify_runner
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name : "Checkout commit"
uses: actions/checkout@v2
with:
ref: dev

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: $

- name: Install dependencies
run: |
make deps
- name: Run tox
shell: bash
working-directory: ${{runner.workspace}}/dev/build
working-directory: ${{runner.workspace}}/loudify
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: make tox
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/dev_docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: dev build status
name: dev build docker status

on:
push:
Expand All @@ -18,15 +18,17 @@ jobs:
runs-on: loudify_runner

steps:
- uses: actions/checkout@v2
- name : "Checkout commit"
uses: actions/checkout@v2
with:
ref: dev


- name: Generate Docker image loudify-broker
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}
working-directory: ${{runner.workspace}}/loudify

run: make build_image
run: sudo make build_image

28 changes: 28 additions & 0 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish

on:
release:
types: [created]

jobs:
publish:
runs-on: loudify_runner
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
make deps
- name: Publish to PyPi
env:
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
make publish
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ FROM python:latest

RUN pip install --no-cache-dir loudify

WORKDIR /usr/src/app
COPY bin/broker.py .

# run the command
CMD [ "python", "./broker.py", "-p 5555" ]

# tell the port number the container should expose
EXPOSE 5000

# run the command
# CMD ["python", "./app.py"]
# CMD . /opt/venv/bin/activate && exec python myapp.py
EXPOSE 5555
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,39 @@ venv: ## Makes new virtual venv and loads all dependencies

coverage: ## Run tests with coverage
python -m coverage erase
python -m coverage run --include=gr_lora_sdr_profiler/* -m pytest -ra
python -m coverage run --include=loudify/* -m pytest -ra
python -m coverage report -m

deps: ## Install dependencies
python -m pip install --upgrade pip
python -m pip install black coverage flake8 flit mccabe mypy pylint pytest tox pyzmq
python -m pip freeze > requirements.txt
pip install -r requirements.txt

lint: ## Lint and static-check
python -m flake8 gr_lora_sdr_profiler
python -m pylint gr_lora_sdr_profiler
python -m mypy gr_lora_sdr_profiler

python -m flake8 loudify
python -m pylint loudify
python -m mypy loudify
\
publish: ## Publish to PyPi
python -m flit publish
flit publish

push: ## Push code with tags
git push && git push --tags

test: ## Run tests
python -m pytest -ra

launch_stack:
ADMIN_USER=admin \
ADMIN_PASSWORD=admin \
SLACK_URL=https://hooks.slack.com/services/TOKEN \
SLACK_CHANNEL=devops-alerts \
SLACK_USER=alertmanager \
docker stack deploy -c docker-compose.yml mon

requirements: ## Update requirements.txt
python -m pip freeze > requirements.txt

tox: ## Run tox
python -m tox
tox

build_image: ##Build docker image
docker build -t martynvandijke/loudify-broker:dev .
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[![GitHub license](https://img.shields.io/github/license/martynvdijke/loudify-worker)](https://github.com/martynvdijke/loudify/blob/dev/LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Downloads](https://static.pepy.tech/personalized-badge/loudify?period=total&units=international_system&left_color=black&right_color=grey&left_text=Downloads)](https://pepy.tech/project/loudify)
[![docker build status](https://github.com/martynvdijke/loudify/actions/workflows/dev_docker_build.yml/badge.svg)](https://github.com/martynvdijke/loudify/actions/workflows/dev_docker_build.yml)

<br />
<p align="center">
Expand Down
8 changes: 8 additions & 0 deletions bin/broker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Project handler for local execution."""

import loudify

def run_broker():
loudify.main_broker()

run_broker()
8 changes: 8 additions & 0 deletions bin/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Project handler for local execution."""

import loudify

def run_client():
loudify.main_client()

run_client()
8 changes: 8 additions & 0 deletions bin/worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Project handler for local execution."""

import loudify

def run_worker():
loudify.main_worker()

run_worker()
Loading

0 comments on commit dd01450

Please sign in to comment.