{"id":15180586,"url":"https://github.com/computate-org/smartvillage-platform","last_synced_at":"2025-04-04T15:13:54.342Z","repository":{"id":41221668,"uuid":"468769183","full_name":"computate-org/smartvillage-platform","owner":"computate-org","description":"Red Hat Global Social Innovation Program is partnering with Boston University and Smarta Byar in order to collaborate on creating a global and open research platform allowing researchers to study what social sustainability means by using a digital twin of Veberöd, Sweden as the test village, supported by Smarta Byar. ","archived":false,"fork":false,"pushed_at":"2024-04-17T13:27:50.000Z","size":24249,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T00:43:06.830Z","etag":null,"topics":["asynchronous","clustering","iot","openshift","reactive","smartdevices","vertx","vertx-web"],"latest_commit_sha":null,"homepage":"https://www.smartabyarsmartvillage.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/computate-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-11T13:52:03.000Z","updated_at":"2024-10-06T19:39:45.000Z","dependencies_parsed_at":"2023-12-19T07:23:47.113Z","dependency_job_id":"f7998141-5b63-4852-8038-5266ae067b00","html_url":"https://github.com/computate-org/smartvillage-platform","commit_stats":{"total_commits":292,"total_committers":1,"mean_commits":292.0,"dds":0.0,"last_synced_commit":"caee3431c1c3d4a00eff50e0c7a6fad843f0c2bf"},"previous_names":["computate-org/smartvillage-platform"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computate-org%2Fsmartvillage-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computate-org%2Fsmartvillage-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computate-org%2Fsmartvillage-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computate-org%2Fsmartvillage-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/computate-org","download_url":"https://codeload.github.com/computate-org/smartvillage-platform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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":["asynchronous","clustering","iot","openshift","reactive","smartdevices","vertx","vertx-web"],"created_at":"2024-09-27T16:23:08.344Z","updated_at":"2025-04-04T15:13:54.325Z","avatar_url":"https://github.com/computate-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Install Ansible dependencies\n\n```bash\nansible-galaxy collection install community.hashi\\_vault\npip3 install hvac\n```\n\n# Obtain postgres password\n\n```bash\n# Get JDBC_PASSWORD: \noc -n postgres get secret/postgres-cluster-pguser-smartvillage -o jsonpath='{.data.password}' | base64 -d; echo\n```\n\n# Obtain kafka secrets\n\n```bash\n\n# Get KAFKA_SSL_KEYSTORE_LOCATION: \noc extract -n smart-village-view secret/smartvillage-kafka --to=$HOME/.local/src/smartabyar-smartvillage/config/ --keys=user.p12 --confirm\n\n# Get KAFKA_SSL_KEYSTORE_PASSWORD: \noc -n smart-village-view get secret/smartvillage-kafka -o jsonpath='{.data.user\\.password}' | base64 -d; echo\n\n# Get KAFKA_SSL_TRUSTSTORE_LOCATION: \noc extract -n smart-village-view secret/smartvillage-kafka-cluster-ca-cert --to=$HOME/.local/src/smartabyar-smartvillage/config/ --keys=ca.p12 --confirm\n\n# Get KAFKA_SSL_TRUSTSTORE_PASSWORD: \noc -n smart-village-view get secret/smartvillage-kafka-cluster-ca-cert -o jsonpath='{.data.ca\\.password}' | base64 -d; echo\n```\n\n# Setup smartvillage-platform development environment on MacOSX or Linux (Fedora, RHEL, CentOS, Ubuntu)\n\n## Install Ansible dependencies on Linux\n\n```bash\npkcon install -y git\npkcon install -y python3\npkcon install -y python3-pip\npip install virtualenv psycopg2-binary openshift\n```\n\n## Install Ansible dependencies on MacOSX\n\n```bash\nbrew install git python gnu-tar\npip3 install virtualenv\n```\n\n## Install the latest Python and setup a new Python virtualenv\n\nThis step might be virtualenv-3 for you. \n\n```bash\nvirtualenv ~/python\n\nsource ~/python/bin/activate\necho \"source ~/python/bin/activate\" | tee -a ~/.bashrc\nsource ~/.bashrc\n```\n\n## Install the latest Ansible\n\n```bash\npip install setuptools_rust wheel\npip install --upgrade pip\npip install ansible\n```\n\n## Update the Ansible Galaxy collections for kubernetes.core\n\n```bash\nansible-galaxy collection install kubernetes.core\n```\n\n## Update the Ansible Galaxy collections for kubernetes.core\n\n```bash\nansible-galaxy collection install kubernetes.core\n```\n\n# Setup the project\n\n## Setup the directory for the project and clone the git repository into it \n\n```bash\ninstall -d ~/.local/src/smartvillage-platform\ngit clone git@github.com:computate-org/smartvillage-platform.git ~/.local/src/smartvillage-platform\n```\n\n## Setup the Ansible Galaxy roles for installing the complete project locally. \n\n```bash\ninstall -d ~/.ansible/roles\ngit clone git@github.com:computate-org/computate_project.git ~/.ansible/roles/computate.computate_project\n```\n\n## Run the Ansible Galaxy roles to install the complete project locally. \n\n```bash\nansible-playbook ~/.ansible/roles/computate.computate_project/install.yml -e SITE_NAME=smartvillage-platform -e ENABLE_CODE_GENERATION_SERVICE=true\n```\n\n## Running the project build and test suite\n\nThe smartvillage-platform project uses Maven to build and test the software. \nYou can run the build and test suite with this command: \n\n```\ncd ~/.local/src/smartvillage-platform\nmvn clean install\n```\n\n## Running the project install to override secret variables\n\nYou can also inject your own secret variables with an Ansible Vault into the project install automation if you want to override any values. \n\nHere is an example of creating a vault directory and creating a new vault, it will ask for a password. \nBe sure to not commit your vault to source control, it should be ignored by default in the .gitignore file that is created in the project. \n\n```bash\ninstall -d ~/.local/src/smartvillage-platform-ansible/vault\nansible-vault create ~/.local/src/smartvillage-platform-ansible/vault/$USER-local\n```\n\nYou can edit the vault, it will ask for the password. \n\n```bash\nansible-vault edit ~/.local/src/smartvillage-platform-ansible/vault/$USER-local\n```\n\nYou can then run the project install automation again with the secrets in the vault, it will ask for the password. \n\n```bash\nansible-playbook ~/.ansible/roles/computate.computate_project/install.yml -e SITE_NAME=smartvillage-platform -e ENABLE_CODE_GENERATION_SERVICE=true -e @~/.local/src/smartvillage-platform-ansible/vault/$USER-local --vault-id @prompt\n```\n\n# Configure Eclipse IDE \n\nYou can download Eclipse Installer here: \n\nhttps://www.eclipse.org/downloads/packages/\n\nAfter you download the Eclipse installer, create a directory for it and extract it with this command: \n\n```bash\ninstall -d ~/.local/opt/eclipse-installer\ntar xvf ~/Downloads/eclipse-inst-jre-linux64.tar.gz -C ~/.local/opt/eclipse-installer --strip-components=1\n```\n\nNow run the Eclipse installer: \n\n```bash\n~/.local/opt/eclipse-installer/eclipse-inst\n```\n\n- Select [ Eclipse IDE for Java Developers ]\n- I recommend installing Eclipse in the following subdirectory of your home directory: .local/opt/eclipse\n- Click [ Accept Now ] for the User Agreement\n\nWhen you run Eclipse Studio, I suggest you create your workspace here: ~/.local/src\n\n## Install these update sites: \n\nIn Eclipse, go to Help -\u003e Install New Software...\n\nAdd these update sites and install these useful plugins: \n\n### Vrapper Vim Plugin\n- http://vrapper.sourceforge.net/update-site/stable\n    - Choose the \"Vrapper\" plugin if you want to be able to edit code with Vim commands\n    - Vrapper keys to unbind in Window -\u003e Preferences -\u003e General -\u003e Keys: \n        - ctrl+d, ctrl+u, ctrl+r, shift+ctrl+v, alt+v\n    - Vrapper keys to set: \n        - and search for \"Vrapper\" and set the keys to alt+v\n\n### DevStyle for dark theme\n\n- http://www.genuitec.com/updates/devstyle/ci/\n    - Choose \"DevStyle Features\" for themes\n\n### YAML Editor\n\n- http://www.genuitec.com/updates/devstyle/ci/\n    - Choose \"DevStyle Features\" for themes\n\n## Import the smartvillage-platform project into Eclipse\n\n* In Eclipse, go to File -\u003e Import...\n* Select Maven -\u003e Existing Maven Projects\n* Click [ Next \u003e ]\n* Browse to the directory: ~/.local/src/smartvillage-platform\n* Click [ Finish ]\n\n## Setup a Eclipse Debug/Run configuration to generate the OpenAPI 3 spec and the SQL create and drop scripts in smartvillage-platform\n\n* In Eclipse, go to File -\u003e Debug Configurations...\n* Right click on Java Application -\u003e New Configuration\n* Name: smartvillage-platform-OpenAPIGenerator\n* Project: smartvillage-platform\n* Main class: org.computate.smartvillage.enus.vertx.MainVerticle\n\n### In the Environment tab\n\nSetup the following variables to setup the Vert.x verticle. \n\n* CONFIG_PATH: ~/.local/src/smartvillage-platform/config/smartvillage-platform.yml\n* RUN_OPENAPI3_GENERATOR: true\n* RUN_SQL_GENERATOR: true\n* RUN_FIWARE_GENERATOR: true\n\nClick [ Apply ] and [ Debug ] to debug the generation of the OpenAPI Spec src/main/resources/webroot and the SQL create and drop scripts in src/main/resources/sql. \n\n## Setup a Eclipse Debug/Run configuration to run and debug smartvillage-platform\n\n* In Eclipse, go to File -\u003e Debug Configurations...\n* Right click on Java Application -\u003e New Configuration\n* Name: smartvillage-platform\n* Project: smartvillage-platform\n* Main class: org.computate.smartvillage.enus.vertx.MainVerticle\n\n### In the \"Arguments\" tab\n\nSetup the following VM arguments to disable caching for easier web development: \n\n```\n-DfileResolverCachingEnabled=false -Dvertx.disableFileCaching=true\n```\n\n### In the Environment tab\n\nSetup the following variables to setup the Vert.x verticle. \n\n* CONFIG_PATH: ~/.local/src/smartvillage-platform/config/smartvillage-platform.yml\n* VERTXWEB_ENVIRONMENT: dev\n\nClick [ Apply ] and [ Debug ] to debug the application. \n\n# Deploy smartvillage-platform to OpenShift with Ansible\n\nTo deploy smartvillage-platform to OpenShift with Ansible, you will want to follow the instructions to install Ansible on your system first above \"Install Ansible dependencies on Linux\". \n\n## Setup ~/.ansible/roles directory\n\nA default place to install Ansible roles from Ansible Galaxy is in ~/.ansible/roles. Make sure this directory exists: \n\n```bash\ninstall -d ~/.ansible/roles\n```\n\n## Clone the Ansible roles for deploying the applications to OpenShift\n\n```bash\ngit clone git@github.com:computate-org/computate_postgres_openshift.git ~/.ansible/roles/computate.computate_postgres_openshift\ngit clone git@github.com:computate-org/computate_zookeeper_openshift.git ~/.ansible/roles/computate.computate_zookeeper_openshift\ngit clone git@github.com:computate-org/computate_solr_openshift.git ~/.ansible/roles/computate.computate_solr_openshift\ngit clone git@github.com:computate-org/computate_project_openshift.git ~/.ansible/roles/computate.computate_project_openshift\n```\n\n## Create an ansible vault for your OpenShift.\n\nYou can create and edit an encrypted ansible vault with a password for the host secrets for your shared OpenShift inventory to deploy smartvillage-platform.\nIt will have you create a password when you save the file for the first time, like using vim to exit. \n\n```bash\ninstall -d ~/.local/src/smartvillage-platform-ansible\ninstall -d ~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault\nansible-vault create ~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault\nansible-vault edit ~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault\n```\n\nHere is an example of a vault that I have used to deploy the smartvillage-platform application. \nYou will want to update these values to reflect your OpenShift environment, like the REDHAT_OPENSHIFT_TOKEN which you will need to obtain after logging into OpenShift. \nOr the REDHAT_OPENSHIFT_STORAGE_CLASS_NAME which might be different than gp2 for you. \nIf so, try creating a persistent volume in the UI to figure out a good storage class for your environment: \n\n```yaml\nSITE_NAME: smartvillage-platform\n\nREDHAT_OPENSHIFT_HOST: https://api.rh-us-east-1.openshift.com\nREDHAT_OPENSHIFT_TOKEN: OcrtrXzKNKVj0riR2FvfqORgGfnURx98G8zRPd2MUvs\nREDHAT_OPENSHIFT_NAMESPACE: rh-impact\nREDHAT_OPENSHIFT_STORAGE_CLASS_NAME: gp2\n\nPOSTGRES_DB_NAME: sampledb\nPOSTGRES_DB_USER: computate\nPOSTGRES_DB_PASSWORD: qVTaaa23aIkLmw\nPOSTGRES_VOLUME_SIZE: 1Gi\nPOSTGRES_STORAGE_CLASS_NAME: \"{{ REDHAT_OPENSHIFT_STORAGE_CLASS_NAME }}\"\n\nZOOKEEPER_VOLUME_SIZE: 1Gi\nZOOKEEPER_STORAGE_CLASS_NAME: \"{{ REDHAT_OPENSHIFT_STORAGE_CLASS_NAME }}\"\n\nSOLR_VOLUME_SIZE: 2Gi\nSOLR_STORAGE_CLASS_NAME: \"{{ REDHAT_OPENSHIFT_STORAGE_CLASS_NAME }}\"\n\nAUTH_REALM: SMARTVILLAGE\nAUTH_CLIENT: smartvillage\nAUTH_SECRET: ...\nAUTH_HOST_NAME: sso.computate.org\nAUTH_PORT: 443\nAUTH_SSL: true\nAUTH_TOKEN_URI: \"/auth/realms/SMARTVILLAGE/protocol/openid-connect/token\"\n```\n\n## Run the Ansible automation to deploy the applications to OpenShift\n\n```bash\n\nansible-playbook --vault-id @prompt -e @~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault ~/.ansible/roles/computate.computate_postgres_openshift/install.yml -e SITE_NAME=smartvillage-platform\n\nansible-playbook --vault-id @prompt -e @~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault ~/.ansible/roles/computate.computate_zookeeper_openshift/install.yml -e SITE_NAME=smartvillage-platform\n\nansible-playbook --vault-id @prompt -e @~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault ~/.ansible/roles/computate.computate_solr_openshift/install.yml -e SITE_NAME=smartvillage-platform\n\nansible-playbook --vault-id @prompt -e @~/.local/src/smartvillage-platform-ansible/vault/$USER-staging/vault ~/.ansible/roles/computate.computate_project_openshift/install.yml -e SITE_NAME=smartvillage-platform\n```\n\n## How to run the application as a Podman container\n\n### Install the prerequiste packages for buildah and podman\n\n```bash\npkcon install -y buildah\npkcon install -y podman\n```\n\n### Build the container with podman\n\n```bash\ncd ~/.local/src/smartvillage-platform\npodman build -t computateorg/smartvillage-platform:latest .\n```\n\n### Push the container up to quay.io\n```bash\npodman login quay.io\npodman push computateorg/smartvillage-platform:latest quay.io/computateorg/smartvillage-platform:latest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputate-org%2Fsmartvillage-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomputate-org%2Fsmartvillage-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputate-org%2Fsmartvillage-platform/lists"}