{"id":21069296,"url":"https://github.com/selcuksert/spectrum","last_synced_at":"2026-05-12T04:33:30.250Z","repository":{"id":130791128,"uuid":"439695477","full_name":"selcuksert/spectrum","owner":"selcuksert","description":"Containerized fake spectrum generator","archived":false,"fork":false,"pushed_at":"2021-12-23T19:45:54.000Z","size":2741,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T21:42:14.338Z","etag":null,"topics":["amqlib","kubernetes","minikube","nodejs","plotlyjs","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selcuksert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-18T19:12:58.000Z","updated_at":"2021-12-23T19:45:56.000Z","dependencies_parsed_at":"2023-03-13T11:14:53.759Z","dependency_job_id":null,"html_url":"https://github.com/selcuksert/spectrum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuksert%2Fspectrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuksert%2Fspectrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuksert%2Fspectrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selcuksert%2Fspectrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selcuksert","download_url":"https://codeload.github.com/selcuksert/spectrum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243510285,"owners_count":20302334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqlib","kubernetes","minikube","nodejs","plotlyjs","websocket"],"created_at":"2024-11-19T18:34:04.890Z","updated_at":"2026-05-12T04:33:30.182Z","avatar_url":"https://github.com/selcuksert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spectrum\nContainerized fake spectrum generator backed by NodeJS and RabbitMQ and visualized via Bootstrap powered HTML5 UI that comprises PlotlyJS and WebSocket and packed via webpack:\n\n\u003cp float=\"center\"\u003e\n  \u003cimg src=\"./docs/images/mf.png\" width=\"49%\" /\u003e\n  \u003cimg src=\"./docs/images/hf.png\" width=\"49%\" /\u003e\n  \u003cimg src=\"./docs/images/vhf.png\" width=\"49%\" /\u003e\n  \u003cimg src=\"./docs/images/uhf.png\" width=\"49%\" /\u003e\n\u003c/p\u003e\n\n## Docker Compose\nThe project has docker-compose [setup](./docker/compose/docker-compose.yml) with Traefik edge router:\n\n@ [compose](./docker/compose) directory:\n```shell\n% docker-compose up --build\n```\n\nThe hosts file should contain following entries that matches to localhost:\n```shell\n% cat /etc/hosts\nlocalhost app.poc.local\nlocalhost web.poc.local\nlocalhost mq.poc.local\n```\n\n## Kubernetes (k8s)\nThe project has deployment objects generated via [kompose](https://kompose.io/) tool using a [compliant compose file](./docker/compose/docker-compose.k8s.yml) derived from original compose [file](./docker/compose/docker-compose.yml). The generation steps is as follows:\n* For local deployments minikube should be started and ingress controller (NGINX) should be enabled:\n  ```shell\n  % minikube start\n  😄  minikube v1.24.0 on Darwin 12.1\n  ...\n  🐳  Preparing Kubernetes v1.22.3 on Docker 20.10.8 .../ \n  🏄  Done! kubectl is now configured to use \"minikube\" cluster and \"default\" namespace by default\n  % eval $(minikube -p minikube docker-env)\n  % minikube addons enable ingress\n  ```\n* As minikube node runs on VM a public DNS entry should exist for that VM\n  ```shell\n  % minikube ssh\n  # rm /etc/resolv.conf\n  # echo \"nameserver 8.8.8.8\" \u003e\u003e /etc/resolv.conf\n  # echo \"nameserver 192.168.64.1\" \u003e\u003e /etc/resolv.conf\n  # echo \"search .\" \u003e\u003e /etc/resolv.conf\n  # systemctl restart docker\n  # exit\n  logout\n  $ exit\n  logout\n  ssh: Process exited with status 130\n  ```\n\n@ [compose](./docker/compose) directory:\n\n* As original compose file contains environment variables from [.env](./docker/compose/.env) file one need to convert this to a file with variables interpolated: \n    ```shell\n    % docker-compose -f docker-compose.k8s.yml convert \u003e docker-compose.k8s.converted.yml\n    ```\n* The converted version is not compatible with kompose tool as service definitions should be seperated with a white space and ports should be defined in `\u003chost-port\u003e:\u003ccontainer-port\u003e` format:\n  ```shell\n  ERROR Could not parse config for project compose : Unsupported config option for services service: 'generatorHF'\n  ```\n* After converted file is normalized kompose tool is executed to generate k8s object based on given compose file. The `--build` option should also be used to build custom images defined in compose file and push them to Docker registry of minikube. The k8s related files are saved in [k8s](./k8s) folder:\n  ```shell\n  % kompose convert -f docker-compose.k8s.converted.yml --build local --out ../../k8s\n  INFO Service name in docker-compose has been changed from \"generatorUHF\" to \"generatoruhf\" \n  INFO Service name in docker-compose has been changed from \"processorHF\" to \"processorhf\"\n  ...\n  INFO Build key detected. Attempting to build image 'custom/spectrum/generator'\n  INFO Building image 'custom/spectrum/generator' from directory 'app'\n  ...\n  INFO Building image 'custom/spectrum/ui' from directory 'ui' \n  INFO Image 'custom/spectrum/ui' from directory 'ui' built successfully\n  INFO Kubernetes file \"../../k8s/mq-service.yaml\" created\n  ...\n  INFO Kubernetes file \"../../k8s/processorvhf-deployment.yaml\" created\n  INFO Kubernetes file \"../../k8s/ui-deployment.yaml\" created\n  ```\n* @ [k8s](./k8s) directory `imagePullPolicy` should be updated as `Never` for deployments with custom built images:\n  ```shell\n  % for file in $(ls *-deployment.yaml); do\n      patch=\"{\\\"spec\\\":{\\\"template\\\":{\\\"spec\\\":{\\\"containers\\\":[{\\\"name\\\":\\\"$(echo $file | awk -F'-' '{print $1}')\\\", \\\"imagePullPolicy\\\": \\\"Never\\\"}]}}}}\"\n      kubectl patch -f $file -p $patch --dry-run=client --output yaml \u003e \"patched.${file}\"\n      rm $file\n    done\n  ```\n* @ [k8s](./k8s) directory the service and deployments can be created:\n  ```shell\n  % kubectl apply -f .                                                                 \n  deployment.apps/generatorhf created\n  ...\n  service/ui-tcp configured\n  \n  % kubectl apply -f ./ingress \n  ingress.networking.k8s.io/processorhf-ingress created\n  ingress.networking.k8s.io/processormf-ingress created\n  ingress.networking.k8s.io/processoruhf-ingress created\n  ingress.networking.k8s.io/processorvhf-ingress created\n  ```\n* All pods should be in running state:\n  ```shell\n  % kubectl get pods\n  NAME                            READY   STATUS    RESTARTS   AGE\n  generatorhf-6b98c95b75-xfhd6    1/1     Running   0          9s\n  generatormf-67ff45d8d-ddbk6     1/1     Running   0          9s\n  generatoruhf-84db4c9b88-ftp2j   1/1     Running   0          9s\n  generatorvhf-9bfc78965-74jnn    1/1     Running   0          9s\n  mq-64c86d8d7b-mnnsw             1/1     Running   0          9s\n  processorhf-76b896f6b7-wvtsk    1/1     Running   0          9s\n  processormf-54d9f96776-zl67b    1/1     Running   0          9s\n  processoruhf-54bd7fb48b-mvp4b   1/1     Running   0          9s\n  processorvhf-6ddb9d6567-jglfm   1/1     Running   0          9s\n  ui-86955b6b77-prn9t             1/1     Running   0          8s\n  ```\n* The hosts file should contain following entries that matches to minikube IP:\n  ```shell\n  % minikube ip\n  192.168.64.10\n  % cat /etc/hosts\n  192.168.64.10 app.poc.local\n  192.168.64.10 web.poc.local\n  192.168.64.10 mq.poc.local\n  ```\n* To launch the UI minikube service command should be invoked via CLI:\n  ```shell\n  minikube service ui-tcp                   \n  |-----------|--------|-------------|----------------------------|\n  | NAMESPACE |  NAME  | TARGET PORT |            URL             |\n  |-----------|--------|-------------|----------------------------|\n  | default   | ui-tcp | 8080/8080   | http://192.168.64.10:30890 |\n  |-----------|--------|-------------|----------------------------|\n  🎉  Opening service default/ui-tcp in default browser...\n  ```\n\n## OpenShift (OCP)\nThe project contains deployment utilities tested on CodeReady Containers (CRC) platform:\n* A [build script](./ocp/build.sh) to generate and push images via S2I and custom methods\n* A [deploy script](./ocp/deploy.sh) that generates, updates and deploys app resources and apps.\n\n![ocp](./docs/images/ocp.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselcuksert%2Fspectrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselcuksert%2Fspectrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselcuksert%2Fspectrum/lists"}