Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Cloud Foundry is an open source platform as a service (PaaS) for developers to deploy and scale applications without manually configuring and managing servers. The promise of “write once, run anywhere” means developers can build their apps on a programming language or framework of their choice, and be able to deploy it to any underlying cloud environment.
...
The Cloud Foundry platform is available from either the Cloud Foundry Foundation as open source software, or as a commercial product or service from multiple providers. Pivotal Cloud Foundry (PCF) is a commercial offering from Pivotal, which is now part of VMware.
As an open source low code platform to visually build enterprise web apps for coders and non-coders, Joget DX is a good complement for Cloud Foundry.
In this example, we will deploy Joget DX on PCF Dev from Pivotal. PCF Dev is a lightweight, easy to install distribution of Cloud Foundry designed to run on a developer machine, making it easier to locally develop, test and explore Cloud Foundry.
...
Install PCF Dev according to the instructions in the Pivotal Documentation.
Once installed, you may download the vm image from here and start PCF Dev using the command
Code Block |
---|
cf dev start -f ~/pcfdev-v1.2.0-linux.tgz -s mysql |
and you should see the output:
Code Block |
---|
Downloading VMResources... Progress: |====================>| 100%100.0% VM downloaded ImportingSetting State... Creating the VM... Starting the VM... ProvisioningFetching VM Address... Waiting for services to start the VM... Deploying the BOSH Director... 40 out of 40 running _______ _______ _______ ______ _______ __ __ | || || | | | | || | | | | _ || || ___| | _ || ___|| |_| | | |_| || || |___ | | | || |___ | | | ___|| _|| ___| | |_| || ___|| | | | | |_ | | | || |___ | | |___| |_______||___| |______| |_______| |___| is now running. To begin using PCF Dev, please run: cf login -a https://api.local.pcfdev.io --skip-ssl-validation Admin user => Email: admin / Password: admin Regular user => Email: user / Password: pass |
Follow the instructions provided at the end of to connect to PCF Dev, by logging in using the admin user and choosing the pcfdev-org organization:
Code Block |
---|
cf login -a https://api.local.pcfdev.io --skip-ssl-validation
|
You should have output like the following:
Code Block |
---|
API endpoint: https://api.local.pcfdev.io
Email> admin
Password>
Authenticating...
OK
Select an org (or press enter to skip):
1. pcfdev-org
2. system
Org> 1
Targeted org pcfdev-org
Targeted space pcfdev-space |
...
In Cloud Foundry, all external dependencies such as databases, file systems and so on are considered services. Cloud Foundry allows administrators to provide a marketplace of services, from which users can provision reserved resources on-demand.
Here, we will create a MySQL Database Service.
In the command line, search the marketplace for MySQL plans available.
Code Block |
---|
cf marketplace -s p-mysql |
Create a service instance with the 1gb plan with the name jogetdb:
Code Block |
---|
cf create-service p-mysql 1gb jogetdb
|
More detailed information can be found at https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry-dev/connect-a-database
In Cloud Foundry, a volume service provides a reliable, persistent file system.
Create a service instance using the PCF Local Volume Service with the name jogetdata:
Code Block |
---|
cf create-service local-volume free-local-disk jogetdata |
More detailed information can be found at https://docs.cloudfoundry.org/devguide/services/using-vol-services.html and https://github.com/cloudfoundry/local-volume-release
Download Joget from https://www.joget.org/download/
Install Joget https://dev.joget.org/community/display/KBv6/Installing+Joget
Look for the Joget WAR file jw.war in joget_installation_directory/apache-tomcat/webapps.
Push the WAR to the Cloud Foundry space with a memory allocation of 1G and application name joget:
Code Block |
---|
cf push joget -p joget_installation_directory/apache-tomcat-8.5.23/webapps/jw.war -m 1G --no-start |
Note that we use the --no-start parameter to delay the start of the application, because we need to set a couple of environment variables before starting up.
Set the Apache Tomcat context path to /jw:
Code Block |
---|
cf set-env joget JBP_CONFIG_TOMCAT '{tomcat: {context_path: "/jw"}}'
|
Next, disable the Spring auto reconfiguration. This is because the Joget WAR already performs the necessary initialization at startup, and the auto configuration will interfere with it:
Code Block |
---|
cf set-env joget JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '[enabled: false]'
|
Bind the local volume service to mount the persistent filesystem to the Joget data directory:
Code Block |
---|
cf bind-service joget jogetdata -c '{"mount":"/home/vcap/wflow"}'
|
Bind the MySQL database service:
Code Block |
---|
cf bind-service joget jogetdb
|
Verify that the services are bound to the Joget application:
Code Block |
---|
cf services |
For example the output shows the services bound to the joget application:
Code Block |
---|
name service plan bound apps last operation
jogetdata local-volume free-local-disk joget create succeeded
jogetdb p-mysql 1gb joget create succeeded
|
Start the Joget application:
Code Block |
---|
cf start joget |
Now that the Joget platform has been deployed in Cloud Foundry, the final step is to setup the database schema, based on https://docs.cloudfoundry.org/devguide/services/migrate-db.html#single-migration.
...
If you are using Joget prior to version 6.0.3, you need to modify the default Joget SQL setup script due to a limitation in MySQL for PCF where explicit locking is not supported i.e. LOCK TABLES.
SSH into the application:
Code Block |
---|
cf ssh joget |
And download the modified script:
...
Deploying PAS...
Done (22m38s)
Deploying Apps-Manager...
Done (3m12s)
Deploying Mysql...
Done (2m12s)
██████╗ ██████╗███████╗██████╗ ███████╗██╗ ██╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔════╝██║ ██║
██████╔╝██║ █████╗ ██║ ██║█████╗ ██║ ██║
██╔═══╝ ██║ ██╔══╝ ██║ ██║██╔══╝ ╚██╗ ██╔╝
██║ ╚██████╗██║ ██████╔╝███████╗ ╚████╔╝
╚═╝ ╚═════╝╚═╝ ╚═════╝ ╚══════╝ ╚═══╝
is now running!
To begin using PCF Dev, please run:
cf login -a https://api.dev.cfdev.sh --skip-ssl-validation
Admin user => Email: admin / Password: admin
Regular user => Email: user / Password: pass
To access Apps Manager, navigate here: https://apps.dev.cfdev.sh
To deploy a particular service, please run:
cf dev deploy-service <service-name> [Available services: mysql,redis,rabbitmq,scs] |
Follow the instructions provided at the end of to connect to PCF Dev, by logging in using the admin user and choosing the pcfdev-org organization:
Code Block |
---|
cf login -a https://api.dev.cfdev.sh --skip-ssl-validation
|
You should have output like the following:
Code Block |
---|
API endpoint: https://api.dev.cfdev.sh
Your CF API version (2.125.0) is no longer supported. Upgrade to a newer version of the API (minimum version 2.128.0). Please refer to https://github.com/cloudfoundry/cli/wiki/Versioning-Policy#cf-cli-minimum-supported-version
Email: admin
Password:
Authenticating...
OK
Select an org:
1. cfdev-org
2. system
Org (enter to skip): 1
Targeted org cfdev-org
Targeted space cfdev-space
API endpoint: https://api.dev.cfdev.sh (API version: 3.76.0)
User: admin
Org: cfdev-org
Space: cfdev-space |
In Cloud Foundry, all external dependencies such as databases, file systems and so on are considered services. Cloud Foundry allows administrators to provide a marketplace of services, from which users can provision reserved resources on-demand.
Here, we will create a MySQL Database Service.
In the command line, search the marketplace for MySQL plans available.
Code Block |
---|
cf marketplace -s p.mysql |
Create a service instance with the db-small plan with the name jogetdb:
Code Block |
---|
cf create-service p.mysql db-small jogetdb
|
More detailed information can be found at https://tanzu.vmware.com/tutorials/getting-started/connect-a-database
In Cloud Foundry, a volume service provides a reliable, persistent file system. However in the latest CF Dev, it doesn't come with any volume service. Nevertheless, we should have that in production environment so Joget DX can read or write to it.
For example, create a service instance using the PCF Local Volume Service with the name jogetdata:
Code Block |
---|
cf create-service local-volume free-local-disk jogetdata |
More detailed information can be found at https://docs.cloudfoundry.org/devguide/services/using-vol-services.html and https://github.com/cloudfoundry/local-volume-release
Download Joget DX from https://www.joget.org/download/
Install Joget DX https://dev.joget.org/community/display/DX7/Installation+Guide
Look for the Joget DX WAR file jw.war in joget_installation_directory/apache-tomcat/webapps.
Push the WAR to the Cloud Foundry space with a memory allocation of 1G and application name joget:
Code Block |
---|
cf push joget -p joget-enterprise-linux-7.0.0/apache-tomcat-8.5.41/webapps/jw.war -m 1G --no-start -b https://github.com/cloudfoundry/java-buildpack.git |
Note that we use the --no-start parameter to delay the start of the application, because we need to set a couple of environment variables before starting up.
Set the Apache Tomcat version to 8.5 and context path to /jw:
Code Block |
---|
cf set-env joget JBP_CONFIG_TOMCAT '[tomcat: { version: 8.5.+, context_path: "/jw" }]'
|
Next, disable the Spring auto reconfiguration. This is because the Joget DX WAR already performs the necessary initialization at startup, and the auto configuration will interfere with it:
Code Block |
---|
cf set-env joget JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '[enabled: false]'
|
Bind the volume service to mount the persistent filesystem to the Joget DX data directory:
Code Block |
---|
cf bind-service joget jogetdata -c '{"mount":"/home/vcap/wflow"}'
|
Bind the MySQL database service:
Code Block |
---|
cf bind-service joget jogetdb
|
Verify that the services are bound to the Joget application:
Code Block |
---|
cf services |
For example the output shows the services bound to the joget application:
Code Block |
---|
name service plan bound apps last operation broker upgrade available
jogetdb p.mysql db-small joget create succeeded dedicated-mysql-broker |
Start the Joget application:
Code Block |
---|
cf start joget |
Now that the Joget platform has been deployed in Cloud Foundry, the final step is to setup the database schema, based on https://docs.cloudfoundry.org/devguide/services/migrate-db.html#single-migration.
At this point, we can obtain the MySQL database service credentials by viewing the environment variables:
...
In particular, note down the p-mysql service hostname, port, name, username and password.
Code Block |
---|
System-Provided: { "VCAP_SERVICES": { "local-volume": [ { "credentials": {}, "label": "local-volume", "name": "jogetdata", "plan": "free-local-disk", "provider": null, "syslog_drain_url": null, "tags": [ "local" ], "volume_mounts": [ { "container_dir": "/home/vcap/wflow", "device_type": "shared", "mode": "rw" } ] } ], "p-mysql": [ { Getting env variables for app joget in org cfdev-org / space cfdev-space as admin... OK System-Provided: { "VCAP_SERVICES": { "p.mysql": [ { "binding_name": null, "credentials": { "hostname": "mysqlq-brokern1s3y1.local.pcfdev.ioq-g173.bosh", "jdbcUrl": "jdbc:mysql://mysqlq-brokern1s3y1.local.pcfdev.ioq-g173.bosh:3306/cfservice_d13b2f40_c124_4c4b_a900_2269e10a7052instance_db?user=XMpalSAOEYcClZl2e35c7904b0c8402096ef491aa0a17151\u0026password=xgd4xt398r8hkct6\u0026useSSL=uSRs0B1D6NPNuLOefalse", "name": "cfservice_d13b2f40_c124_4c4b_a900_2269e10a7052instance_db", "password": "uSRs0B1D6NPNuLOexgd4xt398r8hkct6", "port": 3306, "uri": "mysql://XMpalSAOEYcClZl2e35c7904b0c8402096ef491aa0a17151:uSRs0B1D6NPNuLOe@mysqlxgd4xt398r8hkct6@q-brokern1s3y1.local.pcfdev.ioq-g173.bosh:3306/cfservice_d13b2f40_c124_4c4b_a900_2269e10a7052instance_db?reconnect=true", "username": "XMpalSAOEYcClZl2e35c7904b0c8402096ef491aa0a17151" }, }, "instance_name": "jogetdb", "label": "p-.mysql", "name": "jogetdb", "plan": "1gbdb-small", "provider": null, "syslog_drain_url": null, "tags": [ "mysql" ], "volume_mounts": [] } ] } } { "VCAP_APPLICATION": { "application_id": "a450291af80eeb36-0440b149-47274aed-ba78a3dc-c65f12d99961a0cca32c0e1f", "application_name": "joget", "application_uris": [ "joget.localdev.pcfdevcfdev.iosh" ], "application_version": "aedb805392375e68-728874b1-427241f6-bcf79d11-85eab3dbd3605f196629fb4a", "cf_api": "httphttps://api.localdev.pcfdevcfdev.iosh", "limits": { "disk": 5121024, "fds": 16384, "mem": 1024 }, "name": "joget", "space_id": "4376eb8245d5b30a-39356bb1-49c14ccb-b54399f1-8df589392831e45912c40ef1", "space_name": "pcfdevcfdev-space", "uris": [ "joget.localdev.pcfdevcfdev.iosh" ], "users": null, "version": "aedb805392375e68-728874b1-427241f6-bcf79d11-85eab3dbd3605f196629fb4a" } } User-Provided: JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: [enabled: false] JBP_CONFIG_TOMCAT: {[tomcat: { version: 8.5.+, context_path: "/jw" }}] |
Access Joget DX at http://joget.localdev.pcfdevcfdev.iosh/jw/ and you will be presented with the database setup page.
Proceed to setup the database according to the instructions at at https://dev.joget.org/community/display/KBv6DX7/Setting+Up+Database.
Once setup is complete, you will be brought to the Joget DX App Center.
...
View PCF Dev App Manager:
https://apps.localdev.pcfdevcfdev.iosh