drools workbench in cloudfoundry. - drools

I am trying to deploy drools workbench in cloudfoundry. I am not able to push a docker image to my company's CF env, but these docker images works in my local PCF Dev.
So, I pushed a war file to my CF env.
cf push kie -p kie-drools-wb-distribution-wars-6.4.0.Final-wildfly8.war -b jboss-buildpack-offline -m 2g -k 2g -t 180
the application is running in CF. But I am not sure how to get launch the application, to see login page and workbench.
Please help.

Looking at the Dockerfile for drools-workbench (https://hub.docker.com/r/jboss/drools-workbench/~/dockerfile/) it appears to start the workbench using bin/start_drools-wb.sh file, however the JBoss buildpack appears to start the application using standalone.sh
Perhaps you should look at how the application should be started and adapt the start command.

Related

How can I host my backend flask app on heroku?

I have a reach app acting as the frontend and a flask app acting as the backend.
I hosted the frontend on heroku. The problem is with the backend.
When ever I deploy it on heroku it builds fine but I always get The below.
when I check the logs, I see the below.
I'm not sure what the issue is but I am thinking its in models file.
database_path = os.environ['DATABASE_URL']
db = SQLAlchemy()
def setup_db(app, database_path=database_path):
if database_path.startswith("postgres://"):
database_path = database_path.replace("postgres://", "postgresql://", 1)
app.config["SQLALCHEMY_DATABASE_URI"] = database_path
engine = sqlalchemy.create_engine(database_path)
if not database_exists(engine.url):
create_database(engine.url)
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.app = app
db.init_app(app)
db.create_all()
Any ideas?
if I didnt include enough information I apologize, I am brand new to running my web pages outside of my local machine.
EDIT:
I created procfile and added
web: gunicorn flaskr:app
new log is
my app structure is
First Try this in while deploying
heroku addons:create heroku-postgresql:hobby-dev
If that doesn't fix it, try the below
It looks from the logs that you have not configured the dynamo properly in your Procfile. Use gunicorn and try adding this to your Profile web: gunicorn app:app. This should fix the problem. If not, as you are using postgresql, it would be helpful if you download the heroku addon for postgresql from here
This should fix your problem. If Not, below listed are all the steps for deploying a heroku app. Please check if you followed all the below steps properly and in order.
For Flask I recommend doing the following things
Download heroku cli
Start a virtual environment with python -m venv . in your project fil
Activate the virtual environment
Login to your heroku account in the cli with heroku login
Install gunicorn pip install gunicorn
In your virtual environment, install the modules again with pip
Create a requirements.txt with pip freeze > requirements.txt
Create "Procfile" with the following info web: gunicorn app:app, this will fix the dynamo problem in the log
Start a empty git repository with git init
Create a appropiate .gitignore, you can find the template here
Create a new heroku app with heroku create my-app-flask
Add files to heroku git, git add .
As You are using postgresql, it would be helpful if you download the heroku addon for your app Get it here
Finally, git commit -m "Message" and git push heroku master
This should fix your problem.

How to deploy a Scala/Akka application?

I'm developing an application which subscribes to Instagram real times updates(Users). I need to provide an urlcallback in order to receive the users updates.
Curl -F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'object=user' \
-F 'aspect=media' \
-F 'verify_token=myVerifyToken' \
-F 'callback_url=http://YOUR-CALLBACK/URL' \
https://api.instagram.com/v1/subscriptions/
Now my application is running on localhost.
How can I deploy a Scala application in order to have a real urlcallback?
Configure sbt-native-packager at your project by modifying build.sbt and project/plugins.sbt files.
Build your application using sbt-native-packager, either on your local machine or on a build server like Jenkins. This creates a zip, docker image, rpm or Debian. In case you run an Debian type server like Ubuntu, the Debian file would be the easiest choice.
Upload the just created file to your server, using for example scp or rsync. The files created by the build are located in the target directory of your project.
Install your app on your server. In case you are running a Debian type server like Ubuntu and created a Debian file at the build process, a simple dpkg -i will install your app.
In your case you should install a proxy like nginx and configure your app as an nginx backend. See: http://nginx.org/en/docs/http/ngx_http_upstream_module.html
you could use sbt-assembly plugin, make a fat jar with "sbt assembly" in the console and then do java -jar aplication.jar.
There are a couple of ways to deploy your Scala application. If it is a web application, then you can package that application in a .war file and deploy on any machine which has a web server.The another option is you can use an AWS EC2 instance or AWS Elasticbeanstalk service to deploy your .war file.In any case,your urlCallback would be "http://:/"

Deploying to Heroku with my persistence.xml (JPA) without using Spring

I have an error in application deployment with "git push master heroku" while locally it works fine.
I want to use my persistence.xml for access to my data base of H2 (I will be use maybe PostgreSQL) all with my data source on WildFly 10.
I found no reference other than the Spring. (I can not use it)
Thank you!
I've deployed JavaEE web app (with jsf, javabean, ejb, di etc) on Heroku. Heroku will allow you to run shell script for starting your application like class with a main method or executable .jar file. Not on the pre installed fullstack application server. Also if you gonna run java app on Heroku your project should be maven.
To make it work from command line you can use cloud ready run anywhere tiny servers like payara-micro, wildfly-swarm, spring-boot. It turns your app and server into single executable jar (Uber JAR). Also tomcat and jetty have wrappers for build uberJar.
I use payara-micro and it's great that very little jar can run almost all of JavaEE features with session replication. Follow this link for instructions payara-micro how to (read also maven parts).
When you git push to Heroku(with heroku cli tool) it will automatically builds your project and run script from file called Procfile from your project root directory. Sample procfile:
web: java -jar target/myapp.jar --port $PORT
Consider $PORT part from above snippet. When Heroku runtime (dyno) starts it will open random port (I think so) and bind to $PORT environment variable. So here I'm passing that accessibe port to payara-micro server for listen. Other mentioned servers should work with similar procedures. You can find documentations at heroku devcenterr
For JPA and database connectivity Heroku provides JDBC_DATABASE_URL and DATABASE_URL environment variables that have connection information (url etc) for you to connect database. I couln't find the way to hook up those variables into persistence.xml. But you can create and configure EntityManagerFactory and EntityManager programmatically.
Hope it helps.

AWS EB deployment - where is my app?

I packaged my Scala/LiftWeb app with the sbt one-jar plugin into a single executable jar file and packed it up with Docker, exposing the embedded Jetty's port in the Dockerfile.
It runs fine locally on Docker and appearently deploys clean on AWS EB using the CLI deployment tools. On the received EB URL however, all I see is the congrats page saying "Your Docker Container is now running in Elastic Beanstalk on your own dedicated environment in the AWS Cloud.".
So, where is my app? Do I miss any steps making my app publicly available on my EB instance?
For future reference, the problem was caused by using an obsolete 2.x version of the aws-eb-cli tools package. Upgrading it to 3.x made the error obvious - building the docker image has failed on AWS.
What I was looking for was running an existing docker image, I found instruction for this scenario at https://aws.amazon.com/blogs/aws/aws-elastic-beanstalk-for-docker/.
Thanks a lot for Nick for asking the right questions which made me realize the obsolete tools package!

how to download the applications from my cloudbees account to local directory for modification

I am trying to create and deploy a grails application on the cloud bees i tried using both, cloud-bees sdk and as well as the eclipse sdk . I don't no much how to use the cloud bees sdk so I tried using the eclipse sdk.
In eclipse SDK the command is being executed but only thing fails is that it throws an error, now I want to create and deploy the application on the cloud.
Can you please help me?
You should use the CloudBees SDK to deploy a Grails application on CloudBees platform.
You can find the documentation here.
Basically, you can see on the doc these are the steps in the case you don't need database binding:
Create your application
bees app:create -a my-app jvmPermSize=128
Setting the Grails Environment of the Tomcat server
bees config:set -a my-app -P grails.env=production
Deploy your application
bees app:deploy -a my-app target/my-app-0.1.war
You can generate the war file of your application using the command below:
grails war