App Studio gives a way to connect people with data by building modern, user-friendly front-end search applications quickly and simply. It provides a medium to go from smart or intelligent data access to delivering rich user experiences in and around the data. ASE(App Studio Enterprise) is a template for building a standalone Appkit application for connecting Fusion collections, It is the successor to the embedded App Studio in Fusion.
ASE is designed to be a lightweight template to get you started with Appkit development as quickly and as painlessly as possible. It supports building a Docker image and running it as a container makes it even more flexible and compatible to work with fusion 5 and above.
ASE provides inbuilt scripts that will easily create a docker image for our app. This Article will walk you through the steps to deploy AppStudio Enterprise on Google Kubernetes Engine. This can be deployed on choice of your Kubernetes platform.
Steps to AppStudio Enterprise on Google Kubernetes Engine:
1. Prepare GKE cluster for ASE deployment.
a. Make sure you are logged into gcloud:
$ gcloud config get-value core/account
Your active configuration is: [vrinda13]
If not, you can run:
$ gcloud auth login
b. Set default Project and compute zone:
gcloud config set project lw-support-team
$ gcloud config set compute/zone us-west1
c. Create a GKE cluster, skip if you want to use the Fusion GKE Cluster or any other existing cluster.
$ gcloud container clusters create ase-cluster --num-nodes=1
d. If you are creating a new cluster, you need to get authentication credentials to interact with the cluster:
This command configures kubectl to use the cluster you created. Skip, if you are not creating a new cluster.
$ gcloud container clusters get-credentials ase-cluster
2. Create ASE image on GKE Container Registry
a. Create docker image:
$./app-studio docker package -P <Profile> -t <image-name>
package Package App Studio Enterprise then build a Docker image.
start Package App Studio Enterprise, build a Docker image, then run a container on port 8080.
-P <profile> Specify the Appkit profile to use when App Studio Enterprise is packaged; defaults to development.
-i <image_name> Specify the image name to use when App Studio Enterprise is built as a Docker image; defaults to app-studio-enterprise. The image will be tagged as the latest
$ ./app-studio docker package -P production -i gcr.io/lw-support-team/app-studio-enterprise
b.Confirm ASE is not throwing any runtime error by running the container
$./app-studio docker start -P production -i app-studio-enterprise-production
This will start ASE on http://localhost:8080
3. Push the image to GCP container registry
$docker push gcr.io/<project-id>/<image-name>
project-id= GCP Project
image-name= ASE docker image name
$ docker push gcr.io/lw-support-team/app-studio-enterprise-production:latest
- Docker is installed.
- You are logged in to gcloud
- The image is public
4. Deploying an application to the cluster
a. Creating the Deployment
$ kubectl create deployment ase-deployment --image=gcr.io/lw-support-team/app-studio-enterprise-production:latest
creates a Deployment named ase-deployment.
b. Exposing the Deployment as Load Balancer Service
$ kubectl expose deployment ase-deployment --type LoadBalancer --port 80 --target-port 8080
Passing in the --type LoadBalancer flag creates a Compute Engine load balancer for your container. You can create a Service of type ClusterIP and expose it via Ingress too.
c. Verify the service:
$ kubectl get service ase-deployment
d. Access ASE app
From this command's output, copy the Service's external IP address from the EXTERNAL-IP column.
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ase-deplyment LoadBalancer 10.59.243.130 126.96.36.199 80:30874/TCP 50m
1. View Twigkit(Container) Logs:
To to the Pod details in GCP and look for the Container logs
2. License Error:
2020-08-25 15:07:57.635 IST
2020-08-25 09:37:57,635 - ERROR [http-bio-8080-exec-4:t.l.LicenseRestrictionFilter@63] - contextPath= - It appears that this application is being accessed from another machine (10.60.0.1). Your Twigkit license is a developer license and is only for use on a single-user machine. For testing or QA purposes please purchase a non-production license.
You need a new license to deploy ASE on Kubernetes. The dev license from http://dev.twigkit.net/ wont work for the dev env on kubernetes.
3. Push to GCP repository failing:
The push refers to repository [gcr.io/lw-support-team/app-studio-enterprise]
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
Login to GCP to avoid such errors
$ gcloud auth configure-docker