Search

Jiffy Installation

Articles

Prerequisites for Kubernetes

  • Kubernetes cluster setup: Creating an Amazon EKS cluster
  • DockerHub repository must be reachable from nodes.
  • SSL certificates: Valid SSL certificates as per the DNS of the Core server, DB server, and the Kubernetes cluster.
  • Kubectl, helm3 packages installed on the core server for installing pods and necessary permission should be available for deploying containers on the Kubernetes cluster.
  • Helm charts downloaded to the core server into /tmp/{jiffy-install}/{helm}

    • wget –user {username} –ask-password downloads.jiffy.ai/4.5/Release/jiffy-helms-aws-V4.5.zip
    • unzip jiffy-helms-aws-V4.5.zip

Prerequisites for Core Server and DB Server

  • SSH connectivity between core server and DB server (preferred method using the private key).
  • EFS volumes to be mounted into the following paths. *{core server mountpoint}/jiffy/auth/ *{core server mountpoint}/jiffy/ml/config/
  • Connected users must have sudo privilege (For root installation).
  • Repositories/Internet access should be provided on the DB and Core machines. *Recommended repositories:

    For RHEL Users For CentOS
    rhel-7-server-rpms epel-release
    rhel-7-server-extras-rpms centos-release-scl
    rhel-7-server-optional-rpms docker-ce
    rhel-server-rhscl-7-rpms pypi.org
    docker-ce
    docker-ce
    pypi.org
  • Extract the ansible-playbook tar file in the core server (tar -xf jiffy-playbook.tar.gz), as normal user. The extracted files include the inventory and variable.yml.

  • Inventory file filled as per the user environment(contains all the details of the machines, authentication method).

  • Variables file filled as per the user environment(contains all the parameters, such as, username, configurable values, mountpoint, etc.).

  • Execute the following command to download Artifacts to a new folder under /tmp/{jiffy-install} in core machine.

wget --user {username} --ask-{password} downloads.jiffy.ai/4.5/Release/jiffy-installation.tar.gz

sha1sum: 00368671024b5f3cbe367e53ac9c7efcc0676fd2

md5sum: da8eedc7ad19f910ff39adb49168741b

wget --user {username} --ask-{password} downloads.jiffy.ai/4.5/Release/jiffy-playbook.tar.gz

sha1sum: 8c96cfbd4aaa319818ac1abc465df7038986d4bd

md5sum: f0c5203c797859eba1ae2e705584a95e

Installation Steps

Kubernetes deployment

  1. Update efs mount point values in pvcreation.yml prior to triggering the deployment.
    1. volumeHandle: {EFS ID}:/jiffyauthdata
    2. volumeHandle: {EFS ID}:/mldata/config
  2. Run the following commands to create persistent volume, persistent volume claim, and deploy Kubernetes pods.

Create namespace jiffy-cognitive

kubectl create namespace jiffy-cognitive

Commands to create persistent volumes

  • kubectl apply -f pvcreation.yml -n jiffy-cognitive
  • kubectl apply -f pvc-creation.yml -n jiffy-cognitive
  • kubectl apply -f imagepull-creds.yml -n jiffy-cognitive

Commands to deploy Kubernetes pods

  • helm install portfolio portfolio/ –set image.tag=JARVIS-MAIN-Portfolio_18807Sep21 –set image.repository=jiffyai/portfolio –set replicaCount=1 -n jiffy-cognitive
  • helm install pdfsplit pdfsplit/ –set image.tag=JARVIS-MAIN-Pdfsplit_2007Sep21 –set image.repository=jiffyai/pdfsplit –set replicaCount=1 -n jiffy-cognitive
  • helm install bolml bolml/ –set image.tag=JARVIS-MAIN-T4.3.011807Sep21 –set image.repository=jiffyai/bolml –set replicaCount=1 -n jiffy-cognitive
  • helm install bol-category bol_category/ –set image.tag=JARVIS-MAIN-vendorcategorisation_6407Sep21 –set image.repository=jiffyai/bolcategory –set replicaCount=1 -n jiffy-cognitive
  • helm install handwritingsegmentation handwritingsegmentation/ –set image.tag=JARVIS-MAIN-HWSegmentaion_3802Sep21 –set image.repository=jiffyai/hwsegmentation –set replicaCount=1 -n jiffy-cognitive
  • helm install invoicecategory invoicecategory/ –set image.tag=JARVIS-MAIN-T4.3.011807Sep21 –set image.repository=jiffyai/invoicecategory –set replicaCount=1 -n jiffy-cognitive
  • helm install pdf2image pdf2image/ –set image.tag=JARVIS-MAIN-Pdf2Image_2107Sep21 –set image.repository=jiffyai/pdf2image –set replicaCount=1 -n jiffy-cognitive
  • helm install pdf2json-service pdf2json-service/ –set image.tag=JARVIS-MAIN-Pdf2JsonService_1901Sep21 –set image.repository=jiffyai/pdf2json-service –set replicaCount=1 -n jiffy-cognitive
  • helm install template-converter template-converter/ –set image.tag=JARVIS-MAIN-104 –set image.repository=jiffyai/template-converter –set replicaCount=1 -n jiffy-cognitive
  • helm install w2split w2split/ –set image.tag=JARVIS-MAIN-W2Split_4807Sep21 –set image.repository=jiffyai/w2split –set replicaCount=1 -n jiffy-cognitive
  • helm install backward-comp backward-comp/ –set image.tag=JARVIS-MAIN-BackwardCompatibilityEngine2307Sep21 –set image.repository=jiffyai/backward-compatibility-engine –set replicaCount=1 -n jiffy-cognitive
  • helm install functionator functionator/ –set image.tag=JARVIS-MAIN-116 –set image.repository=jiffyai/functionator –set replicaCount=1 -n jiffy-cognitive
  • helm install invoiceml invoiceml/ –set image.tag=JARVIS-MAIN-T4.3.011807Sep21 –set image.repository=jiffyai/invoiceml –set replicaCount=1 -n jiffy-cognitive

Update key, cert path in the command below which is specifically created for Kubernetes

kubectl create secret tls tlssecret1 –key {key path of Kubernetes} –cert {cert path of Kubernetes} -n default

Create classic load balancer

kubectl apply -f ingress-nginx.yaml

Core and DB Server Deployment

  1. Change directory to the installation path, where the download artifacts are present.

    cd /tmp/{jiffy-install}

  2. Execute the following command to install ansible and dependent packages in the core server:

    chmod u+x preAnsibleSetup.sh
    ./preAnsibleSetup.sh

  3. Update the inventory file. Click here to download a sample Inventory file.
  4. Configure the variable.yml file in the /tmp/{jiffyinstall}folder as per the corresponding environment. Click here to download a sample Variables file.
  5. Execute the play book to begin the installation and follow instructions on the screen.

    ansible-playbook main.yml -i inventory -e @variable.yml

    For debug mode,

    ansible-playbook main.yml -i inventory -e @variable.yml -v

    For detailed debug mode,

    ansible-playbook main.yml -i inventory -e @variable.yml -vvvv

  6. Update privileges for the vault bootstrap script.

    chown {jiffyuser}:{jiffyuser} vaultBootstrap.sh

  7. Switch to Jiffy user to initialize the vault.

    • sudo su {jiffyuser}
    • chmod u+x vaultBootstrap.sh
    • ./vaultBootstrap.sh

  8. Follow screen prompt to complete vault initialization.
  9. Switch back to sudo user.
  10. Update variable vault_token: {replaceme} in variables.yml with vault token.
  11. Execute the below ansible command to bootstrap application:
    1. with masterkey prompt:

      ansible-playbook jiffybootstrap.yml -e @variable.yml

    2. without masterkey prompt:

      ansible-playbook jiffybootstrap.yml -e masterKey=‘{replaceme}’ -e @variable.yml

Generate Self Signed Certificates

(Use only in non-prod environments as a temporary measure if valid SSLs are not available.)

  1. To Generate SSL Certificate for DB Instance and Cognitive Instance:

    1. Navigate to /tmp/{jiffyinstall}; folder.
    2. Execute the following commands:

      chmod +x generate-db-cert.sh
      ./generate-db-cert.sh -d {DBInstanceDomainname}

    3. The following files are generated:
      • db_ca_key.pem
      • db_ca_cert.pem
      • dbcn_cert.pem
      • dbcn_key.pem
  2. Localhost certificates for the core server are generated by ansible and are available under /tmp/{jiffyinstall}

    • ca_key.pem
    • ca_cert.pem
    • localhost_key.pem
    • localhost_cert.pem
Did you find what you were looking for?