Compare commits

...

15 Commits

Author SHA1 Message Date
oblom0v
0c2dc913d7 Fix image tags since double quotes in .env are interpreted as part of the value 2021-08-19 12:43:02 +02:00
Dmitry Dunaev
fd16bf1439 Fix: logging for current version 2021-08-02 15:19:15 +03:00
jaspreetsachdev
4268735b91 Update for release 2.0.0
Release v2.0.0 images
2021-07-30 13:49:17 -04:00
jaspreetsachdev
a7ce7258ec Updated for 2.0.0 Release
Updated for 2.0.0 Release
2021-07-30 13:47:43 -04:00
Dmitry Dunaev
2cbab9dc21 Release: 2.0.0 2021-07-30 17:05:09 +02:00
Dmitry Dunaev
1c006d532a [WIFI-2884] Add: release management pipeline 2021-07-29 14:09:53 +03:00
Johann Hoffmann
4c849204bb Update README.md 2021-07-28 16:02:15 +02:00
Johann Hoffmann
e7969b762f Update README.md 2021-07-28 13:55:36 +02:00
Dmitry Dunaev
c55f50a771 Merge pull request #12 from Telecominfraproject/fix/make-chown-optional
Add: run chown execution flag
2021-07-28 10:57:38 +03:00
Dmitry Dunaev
3f07e5e299 Add: run chown execution flag 2021-07-28 10:50:23 +03:00
Johann Hoffmann
08e51ff81d [WIFI-3232] Fix Docker Compose deployment (#11)
* Switch to SQLite and expose websocket service on all host interfaces

* Expose fileupload port since devices connect to it
2021-07-27 10:28:04 +02:00
Dmitry Dunaev
e939e0b420 Merge pull request #9 from Telecominfraproject/feature/helm-services-overrides
Chg: make all services use predictable names
2021-07-26 13:02:16 +03:00
Dmitry Dunaev
7e9efb2b71 Chg: make all services use predictable names 2021-07-26 12:59:33 +03:00
Johann Hoffmann
36b5d12afc Downgrade rttys (#8)
* Downgrade rttys and and expose the service on the host

* Remove db config property
2021-07-23 13:03:28 +02:00
Dmitry Dunaev
b5ed453f1c Merge pull request #7 from Telecominfraproject/feature/helm-docs
[WIFI-2592] Add: Helm README and extended overall README
2021-07-21 16:21:33 +03:00
16 changed files with 135 additions and 74 deletions

76
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: Release chart package
on:
push:
tags:
- 'v*'
defaults:
run:
shell: bash
jobs:
helm-package:
runs-on: ubuntu-20.04
env:
HELM_REPO_URL: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
HELM_REPO_USERNAME: ucentral
steps:
- name: Checkout uCentral assembly chart repo
uses: actions/checkout@v2
with:
path: wlan-cloud-ucentral-deploy
repository: Telecominfraproject/wlan-cloud-ucentral-deploy
- name: Run pre-checks
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
pip3 install yq -q
export CHART_VERSION=$(cat Chart.yaml | yq .version -r)
export GIT_TAG=$(echo ${GITHUB_REF} | sed -e 's/refs\/tags\/[v]//' | tr '/' '-')
if [ "$CHART_VERSION" != "$GIT_TAG" ]; then
echo "Chart version in Chart.yaml ($CHART_VERSION) is different from Git tag ($GIT_TAG)";
exit 1
fi
if [ "$(cat Chart.yaml | yq '.dependencies[].repository' -r | grep -E 'ref=(main|master)' | wc -l)" != "0" ]; then
echo "Some of the dependencies does not have a fixed version set. List of affected dependencies:";
cat Chart.yaml | yq '.dependencies[].repository' -r | grep -E 'ref=(main|master)';
exit 1
fi
- name: Build package
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
helm plugin install https://github.com/aslafy-z/helm-git --version 0.10.0
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependency update
mkdir dist
helm package . -d dist
- name: Login into Helm repo
run: helm repo add remote-repo ${{ env.HELM_REPO_URL }} --username ${{ env.HELM_REPO_USERNAME }} --password ${{ secrets.HELM_REPO_PASSWORD }}
- name: Push Helm package into Helm repo
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
pip3 install yq -q
export CHART_NAME=$(cat Chart.yaml | yq .name -r)
export CHART_VERSION=$(cat Chart.yaml | yq .version -r)
helm plugin install https://github.com/belitre/helm-push-artifactory-plugin --version v1.0.2
helm push-artifactory dist/$CHART_NAME-$CHART_VERSION.tgz remote-repo
- name: Generate GitHub release body
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
pip3 install yq -q
echo "Versions of packages in this release:" > release.txt
echo >> release.txt
cat Chart.yaml | yq -r '.dependencies[] | "\(.name) - \(.repository) v\(.version)"' >> release.txt
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: wlan-cloud-ucentral-deploy/chart/release.txt
files: wlan-cloud-ucentral-deploy/chart/dist/*

View File

@@ -8,3 +8,13 @@ Currently 2 deployment methods are supported:
2. [Docker-compose](docker-compose) - may be used for local deployments
Details on every type of deployment may be found in the corresponding directories
## How to cut a new release
This is a short version of [uCentral branching model](https://telecominfraproject.atlassian.net/wiki/spaces/WIFI/pages/1416364078/uCentral+branching+model) doc with specifics for this repo. To cut a new release following steps must be done:
1. Create release branch with next Chart version (check Git tags for the latest version - for example if latest tag was `v0.1.0`, create release branch `release/v0.1.1`), set required microservices tags in refs in Chart.yaml (for example, if we want to have this version to be tied to ucentralgw release version `v2.0.0`, we should set its repository to `"git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw@helm?ref=v2.0.0"`).
2. Increase Helm version in [Chart.yaml](./chart/Chart.yaml) to the same version as Git tag (for example if the latest git tag is `v0.1.0`, set version `0.1.1` (**without v in it**) in Chart.yaml).
3. Also increase the microservice image tags used by the Docker Compose deployment according to the release in the [.env](./docker-compose/.env) file.
4. Create new git tag from release branch. The Git tag should have the same name as the intended release version. Once the tag is pushed to the repo, Github will trigger a build process that will create an assembly Helm chart bundle with all version fixed to the release equal to the Git tag name and will publish it to the public Artifactory and as GitHub release asset.
5. Release to the QA namespace using the packaged Helm assembly chart to verify there are no issues related to the deployment.

View File

@@ -1,18 +1,18 @@
dependencies:
- name: ucentralgw
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw@helm?ref=master
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw@helm?ref=v2.0.0
version: 0.1.0
- name: ucentralsec
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralsec@helm?ref=main
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralsec@helm?ref=v2.0.0
version: 0.1.0
- name: ucentralgwui
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui@helm?ref=main
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui@helm?ref=v2.0.0
version: 0.1.0
- name: rttys
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty@chart?ref=main
repository: git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty@chart?ref=v0.1.0
version: 0.1.0
- name: kafka
repository: https://charts.bitnami.com/bitnami
version: 13.0.2
digest: sha256:53ad7494db63a30c02f01a6d9262efadeb475a51259b0351b90079456baf30cf
generated: "2021-07-21T15:04:25.34215441+03:00"
digest: sha256:9c9d4eefb4d86337134eae961a297ad76eb025d077d78b82847f5653983161c5
generated: "2021-08-02T13:50:27.857633819+03:00"

View File

@@ -2,20 +2,20 @@ apiVersion: v2
name: wlan-cloud-ucentral
appVersion: "1.0"
description: A Helm chart for Kubernetes
version: 0.1.0
version: 2.0.0
dependencies:
- name: ucentralgw
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw@helm?ref=master"
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw@helm?ref=v2.0.0"
version: 0.1.0
- name: ucentralsec
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralsec@helm?ref=main"
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralsec@helm?ref=v2.0.0"
version: 0.1.0
- name: ucentralgwui
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui@helm?ref=main"
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui@helm?ref=v2.0.0"
version: 0.1.0
condition: ucentralgwui.enabled
- name: rttys
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty@chart?ref=main"
repository: "git+https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty@chart?ref=v0.1.0"
version: 0.1.0
condition: rttys.enabled
- name: kafka

View File

@@ -1,18 +1,29 @@
# uCentralGW (https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/)
ucentralgw:
fullnameOverride: ucentralgw
configProperties:
ucentral.kafka.enable: "true"
ucentral.kafka.brokerlist: kafka:9092
logging.formatters.f1.pattern: "%Y-%m-%d %H:%M:%S %s: [%p] %t"
logging.loggers.root.channel: c1
# uCentralSec (https://github.com/Telecominfraproject/wlan-cloud-ucentralsec)
ucentralsec:
fullnameOverride: ucentralsec
configProperties:
ucentral.kafka.enable: "true"
ucentral.kafka.brokerlist: kafka:9092
logging.formatters.f1.pattern: "%Y-%m-%d %H:%M:%S %s: [%p] %t"
logging.loggers.root.channel: c1
# rttys (https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty)
rttys:
enabled: true
fullnameOverride: rttys
config:
token: 96181c567b4d0d98c50f127230068fa8
@@ -29,6 +40,11 @@ kafka:
minBrokerId: 100
zookeeper:
fullnameOverride: zookeeper
# uCentral UI (https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui/)
ucentralgwui:
enabled: true
fullnameOverride: ucentralgwui

View File

@@ -1,9 +1,7 @@
COMPOSE_PROJECT_NAME=ucentral
POSTGRES_TAG=latest
MYSQL_TAG=latest
UCENTRALGW_TAG=master
UCENTRALGWUI_TAG=main
UCENTRALSEC_TAG=main
RTTYS_TAG=3.6.0
UCENTRALGW_TAG=v2.0.0
UCENTRALGWUI_TAG=v2.0.0
UCENTRALSEC_TAG=v2.0.0
RTTYS_TAG=3.5.0
KAFKA_TAG=latest
ZOOKEEPER_TAG=latest

View File

@@ -1,4 +0,0 @@
MYSQL_ROOT_PASSWORD=root
MYSQL_USER=rttys
MYSQL_PASSWORD=rttys
MYSQL_DATABASE=rttys

View File

@@ -1,5 +0,0 @@
POSTGRES_PASSWORD=ucentralgw
POSTGRES_USER=ucentralgw
UCENTRALSEC_DB=ucentralsec
UCENTRALSEC_DB_USER=ucentralsec
UCENTRALSEC_DB_PASSWORD=ucentralsec

View File

@@ -1,2 +1,3 @@
RUN_CHOWN=true
UCENTRALGW_ROOT=/ucentralgw-data
UCENTRALGW_CONFIG=/ucentralgw-data

View File

@@ -1,2 +1,3 @@
RUN_CHOWN=true
UCENTRALSEC_ROOT=/ucentralsec-data
UCENTRALSEC_CONFIG=/ucentralsec-data

View File

@@ -1,19 +1,20 @@
# Docker Compose
With the provided Docker Compose file you can instantiate a complete deployment of the uCentral microservices and related components for local development purposes. To spin up a local development environment:
1. Switch into the project directory with `cd docker-compose/`.
2. This repository contains a gateway certificate signed by TIP and a self-signed certificate for the REST API and other components which are used by default in the Compose deployment. The certificates are valid for the `*.wlan.local` domain and the Docker Compose uCentral microservice configs use `ucentral.wlan.local` as a hostname, so make sure you add an entry in your hosts file (or in your local DNS solution) which points to `127.0.0.1`.
2. This repository contains a gateway certificate signed by TIP and a self-signed certificate for the REST API and other components which are used by default in the Compose deployment. The certificates are valid for the `*.wlan.local` domain and the Docker Compose uCentral microservice configs use `ucentral.wlan.local` as a hostname, so make sure you add an entry in your hosts file (or in your local DNS solution) which points to `127.0.0.1` or whatever the IP of the host running the deployment is. Be aware that by default only port `15002` (websocket) and `16003` (fileupload) are exposed on all interfaces and the rest only on localhost. Make sure to adapt that according to your needs.
3. If you have your own certificates and want to use the deployment for anything other than local development copy your certs into the `certs/` directory and reference them in the appropriate sections of the microservice configuration files. Make sure to also adapt the sections which reference the hostname. For more information on certificates please see the [certificates section](https://github.com/Telecominfraproject/wlan-cloud-ucentralgw#certificates) of this README and/or [CERTIFICATES.md](https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/master/CERTIFICATES.md).
4. Docker Compose pulls the microservice images from the JFrog repository. If you want to change the image tag or some of the image versions which are used for the other services, have a look into the `.env` file. You'll also find service specific `.env` files in this directory. Edit them if you want to change database passwords (highly recommended!) or other configuration data. Don't forget to adapt your changes in the application configuration files.
5. Open `docker-compose/ucentralgw-data/ucentralgw.properties` to change [authentication data](https://github.com/Telecominfraproject/wlan-cloud-ucentralgw#default-username-and-password) for uCentralGW (again highly recommended!).
6. Spin up the deployment with `docker-compose up -d`.
7. Add the self-signed certificates to the system trust store of the containers with `./add-ca-cert.sh`.
8. Either add the `certs/restapi-ca.pem` certificate to your trusted browser certificates or add a certificate exception in your browser by visiting `https://ucentral.wlan.local:16001` and accepting the SSL certificate warning.
9. Navigate to the UI which listens to `127.0.0.1` or `ucentral.wlan.local` and login with your uCentralGW authentication data.
10. To use the [curl test script](https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/main/TEST_CURL.md) to talk to the API set the following environment variables:
8. Either add the `certs/restapi-ca.pem` certificate to your trusted browser certificates or add SSL certificate exceptions in your browser by visiting `https://ucentral.wlan.local:16001` and `https://ucentral.wlan.local:16002` (make sure to visit both and add the exceptions).
9. Connect to your AP via SSH and add a static hosts entry in `/etc/hosts` for `ucentral.wlan.local` which points to the address of the host the Compose deployment runs on.
10. Navigate to the UI `http://ucentral.wlan.local` and login with your uCentralGW authentication data.
11. To use the [curl test script](https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/main/TEST_CURL.md) to talk to the API set the following environment variables:
```
export UCENTRALSEC="ucentral.wlan.local:16001"
export FLAGS="-s --cacert <your-wlan-cloud-ucentral-deploy-location>/docker-compose/certs/restapi-ca.pem"
```
The `--cacert` option is necessary since the REST API certificates are self-signed. Omit the option if you provide your own signed certificates.
PS: The Docker Compose deployment creates five local volumes to persist mostly database data and data for Zookeeper and Kafka. If you want re-create the deployment and remove all persistent application and database data just delete the volumes with `docker volume rm $(docker volume ls -qf name=ucentral)` after you stopped the services with `docker-compose down`.
PS: The deployment creates local volumes to persist mostly application and database data. In addition to that several bind mounts are created: one for the `docker-compose/certs/` directory which is used by multiple services, and the other ones mount service specific data directories and configuration files located under `docker-compose/` into the appropriate containers. Be aware that for the bind mounts the host directories and files will be owned by the user in the container. Since the files are under version control, you may have to change the ownership to your user again before pulling changes.

View File

@@ -1,10 +1,6 @@
version: '3'
volumes:
postgresql_data:
driver: local
mysql_data:
driver: local
zookeeper_data:
driver: local
zookeeper_datalog:
@@ -13,37 +9,18 @@ volumes:
driver: local
services:
postgresql:
image: "postgres:${POSTGRES_TAG}"
env_file:
- .env_postgresql
restart: unless-stopped
volumes:
- postgresql_data:/var/lib/postgresql/data
- ./init-ucentralsec-db.sh:/docker-entrypoint-initdb.d/init-ucentralsec-db.sh
mysql:
image: "mysql:${MYSQL_TAG}"
env_file:
- .env_mysql
restart: unless-stopped
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- mysql_data:/var/lib/mysql
ucentralgw.wlan.local:
image: "tip-tip-wlan-cloud-ucentral.jfrog.io/ucentralgw:${UCENTRALGW_TAG}"
env_file:
- .env_ucentralgw
depends_on:
- postgresql
- kafka
- rttys
restart: unless-stopped
ports:
- "127.0.0.1:15002:15002"
- "15002:15002"
- "127.0.0.1:16002:16002"
- "127.0.0.1:16003:16003"
- "16003:16003"
- "127.0.0.1:16102:16102"
volumes:
- ./ucentralgw-data:/ucentralgw-data
@@ -64,7 +41,6 @@ services:
env_file:
- .env_ucentralsec
depends_on:
- postgresql
- kafka
- rttys
- ucentralgw.wlan.local
@@ -78,9 +54,10 @@ services:
rttys:
image: "tip-tip-wlan-cloud-ucentral.jfrog.io/rttys:${RTTYS_TAG}"
depends_on:
- mysql
restart: unless-stopped
ports:
- "127.0.0.1:5912:5912"
- "127.0.0.1:5913:5913"
volumes:
- ./certs/restapi-cert.pem:/etc/rttys/restapi-cert.pem
- ./certs/restapi-key.pem:/etc/rttys/restapi-key.pem

View File

@@ -1,8 +0,0 @@
#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER $UCENTRALSEC_DB_USER WITH ENCRYPTED PASSWORD '$UCENTRALSEC_DB_PASSWORD';
CREATE DATABASE $UCENTRALSEC_DB;
GRANT ALL PRIVILEGES ON DATABASE $UCENTRALSEC_DB TO $UCENTRALSEC_DB_USER;
EOSQL

View File

@@ -14,5 +14,3 @@ token: 96181c567b4d0d98c50f127230068fa8
# http://localhost:5913/connect/rtty1
white-list: "*"
#white-list: rtty1 rtty2
# mysql database source
db: rttys:rttys@tcp(mysql)/rttys

View File

@@ -82,7 +82,7 @@ firmware.autoupdate.policy.default = auto
# rtty
#
rtty.enabled = true
rtty.server = rttys
rtty.server = ucentral.wlan.local
rtty.port = 5912
rtty.token = 96181c567b4d0d98c50f127230068fa8
rtty.timeout = 60
@@ -113,8 +113,8 @@ ucentral.kafka.queue.buffering.max.ms = 50
# Only one selected at a time. If you select multiple, this service will die if a horrible
# death and might make your beer flat.
#
#storage.type = sqlite
storage.type = postgresql
storage.type = sqlite
#storage.type = postgresql
#storage.type = mysql
#storage.type = odbc

View File

@@ -75,8 +75,8 @@ ucentral.kafka.queue.buffering.max.ms = 50
# Only one selected at a time. If you select multiple, this service will die if a horrible
# death and might make your beer flat.
#
#storage.type = sqlite
storage.type = postgresql
storage.type = sqlite
#storage.type = postgresql
#storage.type = mysql
#storage.type = odbc